15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_NOTIFICATION_METADATA_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_STORAGE_NOTIFICATION_METADATA_H
18#include "google/cloud/storage/version.h"
19#include "google/cloud/status_or.h"
27GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
29struct NotificationMetadataParser;
33
34
35
36
37
38
39
40
41
42
48 : etag_(std::move(etag)), id_(std::move(id)) {}
51
52
58 return custom_attributes_.end() != custom_attributes_.find(key);
62 return custom_attributes_.at(key);
67 auto i = custom_attributes_.find(key);
68 if (i == custom_attributes_.end()) {
71 custom_attributes_.erase(i);
78 auto i = custom_attributes_.lower_bound(key);
79 if (i == custom_attributes_.end() || i->first != key) {
80 custom_attributes_.emplace_hint(i, std::move(key), std::move(value));
82 i->second = std::move(value);
89 return custom_attributes_;
92 return custom_attributes_;
96 std::string
const&
etag()
const {
return etag_; }
100
101
102
103
104
105
106
108 std::string
const&
event_type(std::size_t index)
const {
109 return event_types_.at(index);
113 event_types_.emplace_back(std::move(e));
117 std::vector<std::string>
const&
event_types()
const {
return event_types_; }
121 std::string
const&
id()
const {
return id_; }
122 std::string
const&
kind()
const {
return kind_; }
126 object_name_prefix_ = std::move(v);
130 std::string
const&
payload_format()
const {
return payload_format_; }
132 payload_format_ = std::move(v);
136 std::string
const&
self_link()
const {
return self_link_; }
138 std::string
const&
topic()
const {
return topic_; }
140 topic_ = std::move(v);
145 friend struct internal::NotificationMetadataParser;
146 friend std::ostream& operator<<(std::ostream& os,
150 std::map<std::string, std::string> custom_attributes_;
152 std::vector<std::string> event_types_;
155 std::string object_name_prefix_;
156 std::string payload_format_;
157 std::string self_link_;
183 return std::rel_ops::operator!=(lhs, rhs);
188 return std::rel_ops::operator>(lhs, rhs);
193 return std::rel_ops::operator<=(lhs, rhs);
198 return std::rel_ops::operator>=(lhs, rhs);
203GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Contains all the Google Cloud Storage C++ client APIs.
Definition: auto_finalize.h:24
bool operator>(NotificationMetadata const &lhs, NotificationMetadata const &rhs)
Definition: notification_metadata.h:186
bool operator!=(NotificationMetadata const &lhs, NotificationMetadata const &rhs)
Definition: notification_metadata.h:181
bool operator<(NotificationMetadata const &lhs, NotificationMetadata const &rhs)
Definition: notification_metadata.h:171
bool operator>=(NotificationMetadata const &lhs, NotificationMetadata const &rhs)
Definition: notification_metadata.h:196
bool operator<=(NotificationMetadata const &lhs, NotificationMetadata const &rhs)
Definition: notification_metadata.h:191
bool operator==(NotificationMetadata const &lhs, NotificationMetadata const &rhs)
Definition: notification_metadata.h:161