public function setMeta(array $meta)
    {
        $headers = [];
        $metaType = $this->objectMetaType();

        // We will replace any 'X-{Object}-Meta-' prefixes in meta name
        // and prepend final header names with same prefix so API will
        // receive sanitized headers and won't produce any errors.

        foreach ($meta as $name => $value) {
            $key = str_replace('X-'.$metaType.'-Meta-', '', $name);
            $headers['X-'.$metaType.'-Meta-'.$key] = $value;
        }

        $response = $this->apiClient()->request('POST', $this->absolutePath(), ['headers' => $headers]);

        if ($response->getStatusCode() !== 202) {
            throw new ApiRequestFailedException('Unable to update container meta data.', $response->getStatusCode());
        }

        return true;
    }
public function setMeta(array $meta)
    {
        $headers = [];
        $metaType = $this->objectMetaType();

        // We will replace any 'X-{Object}-Meta-' prefixes in meta name
        // and prepend final header names with same prefix so API will
        // receive sanitized headers and won't produce any errors.

        foreach ($meta as $name => $value) {
            $key = str_replace('X-'.$metaType.'-Meta-', '', $name);
            $headers['X-'.$metaType.'-Meta-'.$key] = $value;
        }

        $response = $this->apiClient()->request('POST', $this->absolutePath(), ['headers' => $headers]);

        if ($response->getStatusCode() !== 202) {
            throw new ApiRequestFailedException('Unable to update container meta data.', $response->getStatusCode());
        }

        return true;
    }
public function setMeta ( array $ meta ) { $ headers = [ ] ; $ metaType = $ this -> objectMetaType ( ) ; // We will replace any 'X-{Object}-Meta-' prefixes in meta name // and prepend final header names with same prefix so API will // receive sanitized headers and won't produce any errors. foreach ( $ meta as $ name => $ value ) { $ key = str_replace ( 'X-' . $ metaType . '-Meta-' , '' , $ name ) ; $ headers [ 'X-' . $ metaType . '-Meta-' . $ key ] = $ value ; } $ response = $ this -> apiClient ( ) -> request ( 'POST' , $ this -> absolutePath ( ) , [ 'headers' => $ headers ] ) ; if ( $ response -> getStatusCode ( ) !== 202 ) { throw new ApiRequestFailedException ( 'Unable to update container meta data.' , $ response -> getStatusCode ( ) ) ; } return true ; }
Updates object meta data.

@param array $meta Array of meta data (without "X-{Object}-Meta" prefixes).

@throws \ArgentCrusade\Selectel\CloudStorage\Exceptions\ApiRequestFailedException

@return bool
Updates object meta data .