public function view($params, $optParams = [])
    {
        if (is_string($params)) {
            $params = ['publicId' => $params];
        }
        if ($optParams instanceof ViewParams) {
            $optParams = $optParams->toArray(true);
        }

        return $this->sendRequest(['cloudId', 'publicId'], [
            'restAction' => 'view',
            'uri' => '/c/<cloudId>/o/<publicId>',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) use ($params) {
            if ($response->data && !isset($response->data['cloudId'])) {
                $response->data['cloudId'] = $this->client->getParam($params, 'cloudId');
            }

            return isset($response->data) ? new Image($response->data) : $response;
        });
    }
public function view($params, $optParams = [])
    {
        if (is_string($params)) {
            $params = ['publicId' => $params];
        }
        if ($optParams instanceof ViewParams) {
            $optParams = $optParams->toArray(true);
        }

        return $this->sendRequest(['cloudId', 'publicId'], [
            'restAction' => 'view',
            'uri' => '/c/<cloudId>/o/<publicId>',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) use ($params) {
            if ($response->data && !isset($response->data['cloudId'])) {
                $response->data['cloudId'] = $this->client->getParam($params, 'cloudId');
            }

            return isset($response->data) ? new Image($response->data) : $response;
        });
    }
public function view ( $ params , $ optParams = [ ] ) { if ( is_string ( $ params ) ) { $ params = [ 'publicId' => $ params ] ; } if ( $ optParams instanceof ViewParams ) { $ optParams = $ optParams -> toArray ( true ) ; } return $ this -> sendRequest ( [ 'cloudId' , 'publicId' ] , [ 'restAction' => 'view' , 'uri' => '/c/<cloudId>/o/<publicId>' , 'params' => $ params , 'getParams' => $ optParams , ] , function ( $ response ) use ( $ params ) { if ( $ response -> data && ! isset ( $ response -> data [ 'cloudId' ] ) ) { $ response -> data [ 'cloudId' ] = $ this -> client -> getParam ( $ params , 'cloudId' ) ; } return isset ( $ response -> data ) ? new Image ( $ response -> data ) : $ response ; } ) ; }
Fetches an image.

@param array $params Required API parameters

<li>cloudId - cloud ID
<li>publicId - image ID
@param ImageViewParams|array $optParams Optional API parameters

<li>projection - an array of projection flags: noExif, noObject, noDimensions

@return Image|Response
Fetches an image .