web::http::http_request update_message(const cloud_queue& queue, const cloud_queue_message& message, std::chrono::seconds visibility_timeout, bool update_contents, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
    {
        uri_builder.append_query(U("popreceipt"), message.pop_receipt());
        uri_builder.append_query(U("visibilitytimeout"), visibility_timeout.count());

        web::http::http_request request = queue_base_request(web::http::methods::PUT, uri_builder, timeout, context);

        if (update_contents)
        {
            protocol::message_writer writer;
            std::string content = writer.write(message.content_as_string());
            request.set_body(content);
        }

        return request;
    }
    web::http::http_request add_message(const cloud_queue& queue, const cloud_queue_message& message, std::chrono::seconds time_to_live, std::chrono::seconds initial_visibility_timeout, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
    {
        if (time_to_live.count() >= 0LL && time_to_live.count() != 604800LL)
        {
            uri_builder.append_query(U("messagettl"), time_to_live.count());
        }

        if (initial_visibility_timeout.count() > 0LL)
        {
            uri_builder.append_query(U("visibilitytimeout"), initial_visibility_timeout.count());
        }

        web::http::http_request request = queue_base_request(web::http::methods::POST, uri_builder, timeout, context);

        protocol::message_writer writer;
        std::string content = writer.write(message.content_as_string());
        request.set_body(content);

        return request;
    }