public function update($params, $optParams = [])
    {
        if (!$params instanceof Cloud) {
            throw new InvalidParamException(Cloud::class . ' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'update',
            'restId' => $params->id,
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Cloud($response->data) : $response;
        });
    }
public function update($params, $optParams = [])
    {
        if (!$params instanceof Cloud) {
            throw new InvalidParamException(Cloud::class . ' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'update',
            'restId' => $params->id,
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Cloud($response->data) : $response;
        });
    }
public function update ( $ params , $ optParams = [ ] ) { if ( ! $ params instanceof Cloud ) { throw new InvalidParamException ( Cloud :: class . ' is required!' ) ; } return $ this -> sendRequest ( [ ] , [ 'restAction' => 'update' , 'restId' => $ params -> id , 'postParams' => $ params -> toArray ( ) , 'getParams' => $ optParams , ] , function ( $ response ) { return isset ( $ response -> data ) ? new Cloud ( $ response -> data ) : $ response ; } ) ; }
Updates a cloud.

@param Cloud $params    Cloud object
@param array|Cloud  $optParams Optional API parameters

@return Cloud|Response

@throws InvalidParamException
Updates a cloud .