15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_APP_PROFILE_CONFIG_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_APP_PROFILE_CONFIG_H
18#include "google/cloud/bigtable/version.h"
19#include <google/bigtable/admin/v2/bigtable_instance_admin.pb.h>
25GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
30 google::bigtable::admin::v2::CreateAppProfileRequest proto)
31 : proto_(std::move(proto)) {}
34
35
36
37
38
39
40
41
42
43
44
45
46
48 std::string profile_id, std::vector<std::string> cluster_ids = {});
51
52
53
54
55
56
57
58
59
60
61
62
63
65 std::string profile_id, std::string cluster_id,
66 bool allow_transactional_writes =
false);
69 proto_.set_ignore_warnings(value);
74 proto_.mutable_app_profile()->set_description(std::move(description));
79 proto_.mutable_app_profile()->set_etag(std::move(etag));
83 google::bigtable::admin::v2::CreateAppProfileRequest
const&
as_proto()
88 google::bigtable::admin::v2::CreateAppProfileRequest&&
as_proto() && {
89 return std::move(proto_);
93 AppProfileConfig() =
default;
95 google::bigtable::admin::v2::CreateAppProfileRequest proto_;
104 proto_.set_ignore_warnings(value);
108 proto_.mutable_app_profile()->set_description(std::move(description));
109 AddPathIfNotPresent(
"description");
113 proto_.mutable_app_profile()->set_etag(std::move(etag));
114 AddPathIfNotPresent(
"etag");
118 std::vector<std::string> cluster_ids = {}) {
120 *proto_.mutable_app_profile()->mutable_multi_cluster_routing_use_any();
121 for (
auto&& cluster_id : cluster_ids) {
122 mc_routing.add_cluster_ids(std::move(cluster_id));
124 RemoveIfPresent(
"single_cluster_routing");
125 AddPathIfNotPresent(
"multi_cluster_routing_use_any");
129 std::string
const& cluster_id,
bool allow_transactional_writes =
false) {
130 proto_.mutable_app_profile()
131 ->mutable_single_cluster_routing()
132 ->set_cluster_id(cluster_id);
133 proto_.mutable_app_profile()
134 ->mutable_single_cluster_routing()
135 ->set_allow_transactional_writes(allow_transactional_writes);
136 RemoveIfPresent(
"multi_cluster_routing_use_any");
137 AddPathIfNotPresent(
"single_cluster_routing");
141 google::bigtable::admin::v2::UpdateAppProfileRequest
const&
as_proto()
146 google::bigtable::admin::v2::UpdateAppProfileRequest&&
as_proto() && {
147 return std::move(proto_);
151 void AddPathIfNotPresent(std::string field_name);
152 void RemoveIfPresent(std::string
const& field_name);
154 google::bigtable::admin::v2::UpdateAppProfileRequest proto_;
157GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Specify the initial configuration for an application profile.
Definition: app_profile_config.h:27
google::bigtable::admin::v2::CreateAppProfileRequest const & as_proto() const &
Definition: app_profile_config.h:83
AppProfileConfig & set_description(std::string description)
Definition: app_profile_config.h:73
AppProfileConfig & set_etag(std::string etag)
Definition: app_profile_config.h:78
AppProfileConfig & set_ignore_warnings(bool value)
Definition: app_profile_config.h:68
static AppProfileConfig SingleClusterRouting(std::string profile_id, std::string cluster_id, bool allow_transactional_writes=false)
Create an AppProfile that uses single cluster routing.
AppProfileConfig(google::bigtable::admin::v2::CreateAppProfileRequest proto)
Definition: app_profile_config.h:29
google::bigtable::admin::v2::CreateAppProfileRequest && as_proto() &&
Definition: app_profile_config.h:88
static AppProfileConfig MultiClusterUseAny(std::string profile_id, std::vector< std::string > cluster_ids={})
Create an AppProfile that uses multi-cluster routing.
Build a proto to update an Application Profile configuration.
Definition: app_profile_config.h:99
AppProfileUpdateConfig & set_single_cluster_routing(std::string const &cluster_id, bool allow_transactional_writes=false)
Definition: app_profile_config.h:128
AppProfileUpdateConfig & set_description(std::string description)
Definition: app_profile_config.h:107
google::bigtable::admin::v2::UpdateAppProfileRequest const & as_proto() const &
Definition: app_profile_config.h:141
AppProfileUpdateConfig & set_etag(std::string etag)
Definition: app_profile_config.h:112
AppProfileUpdateConfig & set_multi_cluster_use_any(std::vector< std::string > cluster_ids={})
Definition: app_profile_config.h:117
AppProfileUpdateConfig & set_ignore_warnings(bool value)
Definition: app_profile_config.h:103
google::bigtable::admin::v2::UpdateAppProfileRequest && as_proto() &&
Definition: app_profile_config.h:146
AppProfileUpdateConfig()=default
Contains all the Cloud Bigtable C++ client APIs.
Definition: admin_client.h:28