public function b2UpdateBucket($URL, $token, $bucketId, $public, $bucketInfo = null, $lifecycleRules = null,  $ifRevisionIs = null)
    {
        $curl = $this->prepareCurl();
        $browser = new Browser($curl);
        $payload = array(
            'accountId' => $this->accountId,
            'bucketId' => $bucketId,
            'bucketType' => $public ? 'allPublic' : 'allPrivate',
        );
        if(!is_null($bucketInfo)){
            $payload["bucketInfo"] = $bucketInfo;
        }
        if(!is_null($lifecycleRules)){
            $payload["lifecycleRules"] = $lifecycleRules;
        }
        if(!is_null($ifRevisionIs)){
            $payload["ifRevisionIs"] = $ifRevisionIs;
        }
        $response = $browser->post($URL.'/b2api/v1/b2_update_bucket', $this->getHeaders($token), json_encode($payload));

        return new B2Response($response);
    }