internal override HttpRequestMessageBuilder BuildRequest(HttpRequestMessageBuilder requestMessageBuilder)
    {
        requestMessageBuilder.AddQueryParameter("object-lock", "");
        var body = utils.MarshalXML(new ObjectLockConfiguration(), "http://s3.amazonaws.com/doc/2006-03-01/");

        requestMessageBuilder.AddXmlBody(body);
        requestMessageBuilder.AddOrUpdateHeaderParameter("Content-Md5",
                                                         utils.getMD5SumStr(Encoding.UTF8.GetBytes(body)));
        return(requestMessageBuilder);
    }
    internal override HttpRequestMessageBuilder BuildRequest(HttpRequestMessageBuilder requestMessageBuilder)
    {
        requestMessageBuilder.AddQueryParameter("tagging", "");
        var body = BucketTags.MarshalXML();

        requestMessageBuilder.AddXmlBody(body);
        requestMessageBuilder.AddOrUpdateHeaderParameter("Content-Md5",
                                                         utils.getMD5SumStr(Encoding.UTF8.GetBytes(body)));

        //
        return(requestMessageBuilder);
    }
    internal override HttpRequestMessageBuilder BuildRequest(HttpRequestMessageBuilder requestMessageBuilder)
    {
        var config = new VersioningConfiguration(CurrentVersioningStatus == VersioningStatus.Enabled);

        var body = utils.MarshalXML(config, "http://s3.amazonaws.com/doc/2006-03-01/");

        requestMessageBuilder.AddXmlBody(body);
        requestMessageBuilder.AddOrUpdateHeaderParameter("Content-Md5",
                                                         utils.getMD5SumStr(Encoding.UTF8.GetBytes(body)));

        requestMessageBuilder.AddQueryParameter("versioning", "");
        return(requestMessageBuilder);
    }
    internal override HttpRequestMessageBuilder BuildRequest(HttpRequestMessageBuilder requestMessageBuilder)
    {
        // ``us-east-1`` is not a valid location constraint according to amazon, so we skip it.
        if (!string.IsNullOrEmpty(Location) && Location != "us-east-1")
        {
            var config = new CreateBucketConfiguration(Location);
            var body   = utils.MarshalXML(config, "http://s3.amazonaws.com/doc/2006-03-01/");
            requestMessageBuilder.AddXmlBody(body);
            requestMessageBuilder.AddOrUpdateHeaderParameter("Content-Md5",
                                                             utils.getMD5SumStr(Encoding.UTF8.GetBytes(body)));
        }

        if (ObjectLock)
        {
            requestMessageBuilder.AddOrUpdateHeaderParameter("X-Amz-Bucket-Object-Lock-Enabled", "true");
        }
        return(requestMessageBuilder);
    }
    internal override HttpRequestMessageBuilder BuildRequest(HttpRequestMessageBuilder requestMessageBuilder)
    {
        requestMessageBuilder.AddQueryParameter("object-lock", "");
        var body = utils.MarshalXML(LockConfiguration, "http://s3.amazonaws.com/doc/2006-03-01/");

        // Convert string to a byte array
        // byte[] bodyInBytes = Encoding.ASCII.GetBytes(body);

        // requestMessageBuilder.BodyParameters.Add("content-type", "text/xml");
        // requestMessageBuilder.SetBody(bodyInBytes);
        //
        // string body = utils.MarshalXML(config, "http://s3.amazonaws.com/doc/2006-03-01/");
        requestMessageBuilder.AddXmlBody(body);
        requestMessageBuilder.AddOrUpdateHeaderParameter("Content-Md5",
                                                         utils.getMD5SumStr(Encoding.UTF8.GetBytes(body)));
        //
        return(requestMessageBuilder);
    }