15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_POLICY_DOCUMENT_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_POLICY_DOCUMENT_H
18 #include "google/cloud/storage/version.h"
37 : elements_(std::move(elements)) {}
39 std::vector<std::string>
const&
elements()
const {
return elements_; }
47 static std::vector<std::string>
ExactMatch(std::string
const& field,
48 std::string
const& value) {
49 std::vector<std::string> result;
50 result.emplace_back(
"eq");
51 result.emplace_back(std::string(
"$") + field);
52 result.emplace_back(value);
58 std::string
const& value) {
59 std::vector<std::string> result;
60 result.emplace_back(field);
61 result.emplace_back(value);
65 static std::vector<std::string>
StartsWith(std::string
const& field,
66 std::string
const& value) {
67 std::vector<std::string> result;
68 result.emplace_back(
"starts-with");
69 result.emplace_back(std::string(
"$") + field);
70 result.emplace_back(value);
75 std::int32_t max_range) {
76 std::vector<std::string> result;
77 result.emplace_back(
"content-length-range");
78 result.emplace_back(std::to_string(min_range));
79 result.emplace_back(std::to_string(max_range));
85 std::vector<std::string> elements_;
100 return std::rel_ops::operator!=(lhs, rhs);
105 return std::rel_ops::operator>(lhs, rhs);
110 return std::rel_ops::operator<=(lhs, rhs);
115 return std::rel_ops::operator>=(lhs, rhs);
150 std::chrono::seconds expiration,
151 std::chrono::system_clock::time_point timestamp =
152 std::chrono::system_clock::now(),
154 :
bucket(std::move(bucket)),
155 object(std::move(object)),