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

@param SuperBackup $params    SuperBackup object
@param array       $optParams Optional API parameters

@return SuperBackup|Response

@throws InvalidParamException
Updates a superbackup .