private function deserializeObjectList(ResponseInterface $response, ObjectListQuery $byFields): ObjectList
    {
        $data = $response->getBody();

        /** @var ObjectList $list */
        $list = $this->deserialize($data, ObjectList::class);

        // Set the json representation of each entry in the list.
        $decoded = \GuzzleHttp\json_decode($data, true);
        foreach ($list as $index => $item) {
            $entry = $decoded['entries'][$index];
            if (isset($decoded['$xmlns'])) {
                $entry['$xmlns'] = $decoded['$xmlns'];
            }
            $item->setJson(\GuzzleHttp\json_encode($entry));
        }
        $list->setObjectListQuery($byFields);
        $list->setDataObjectFactory($this);

        return $list;
    }
private function deserializeObjectList(ResponseInterface $response, ObjectListQuery $byFields): ObjectList
    {
        $data = $response->getBody();

        /** @var ObjectList $list */
        $list = $this->deserialize($data, ObjectList::class);

        // Set the json representation of each entry in the list.
        $decoded = \GuzzleHttp\json_decode($data, true);
        foreach ($list as $index => $item) {
            $entry = $decoded['entries'][$index];
            if (isset($decoded['$xmlns'])) {
                $entry['$xmlns'] = $decoded['$xmlns'];
            }
            $item->setJson(\GuzzleHttp\json_encode($entry));
        }
        $list->setObjectListQuery($byFields);
        $list->setDataObjectFactory($this);

        return $list;
    }
private function deserializeObjectList ( ResponseInterface $ response , ObjectListQuery $ byFields ) : ObjectList { $ data = $ response -> getBody ( ) ; /** @var ObjectList $list */ $ list = $ this -> deserialize ( $ data , ObjectList :: class ) ; // Set the json representation of each entry in the list. $ decoded = \ GuzzleHttp \ json_decode ( $ data , true ) ; foreach ( $ list as $ index => $ item ) { $ entry = $ decoded [ 'entries' ] [ $ index ] ; if ( isset ( $ decoded [ '$xmlns' ] ) ) { $ entry [ '$xmlns' ] = $ decoded [ '$xmlns' ] ; } $ item -> setJson ( \ GuzzleHttp \ json_encode ( $ entry ) ) ; } $ list -> setObjectListQuery ( $ byFields ) ; $ list -> setDataObjectFactory ( $ this ) ; return $ list ; }
Deserialize an object list response.

@param ResponseInterface $response The response to deserialize.
@param ObjectListQuery   $byFields The fields used to limit the response.

@return ObjectList The deserialized list.
Deserialize an object list response .