15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_UPDATE_CONFIG_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INSTANCE_UPDATE_CONFIG_H
18#include "google/cloud/bigtable/cluster_config.h"
19#include "google/cloud/bigtable/version.h"
20#include "google/cloud/internal/algorithm.h"
21#include <google/bigtable/admin/v2/bigtable_instance_admin.pb.h>
22#include <google/bigtable/admin/v2/common.pb.h>
29GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
30using Instance = ::
google::bigtable::admin::v2::Instance;
37 proto_.mutable_instance()->Swap(&instance);
42 using InstanceType = ::
google::bigtable::admin::v2::Instance::Type;
45 google::bigtable::admin::v2::Instance::TYPE_UNSPECIFIED;
48 google::bigtable::admin::v2::Instance::PRODUCTION;
51 google::bigtable::admin::v2::Instance::DEVELOPMENT;
56 using StateType = ::
google::bigtable::admin::v2::Instance::State;
59 google::bigtable::admin::v2::Instance::STATE_NOT_KNOWN;
61 constexpr static StateType
READY =
62 google::bigtable::admin::v2::Instance::READY;
64 constexpr static StateType
CREATING =
65 google::bigtable::admin::v2::Instance::CREATING;
69 proto_.mutable_instance()->set_type(std::move(type));
70 AddPathIfNotPresent(
"type");
75 proto_.mutable_instance()->set_state(std::move(state));
76 AddPathIfNotPresent(
"state");
81 proto_.mutable_instance()->set_name(std::move(name));
82 AddPathIfNotPresent(
"name");
87 proto_.mutable_instance()->set_display_name(std::move(display_name));
88 AddPathIfNotPresent(
"display_name");
93 std::string
const& value) {
94 (*proto_.mutable_instance()->mutable_labels())[key] = value;
95 AddPathIfNotPresent(
"labels");
101 (*proto_.mutable_instance()->mutable_labels())[key] = std::move(value);
102 AddPathIfNotPresent(
"labels");
107 google::bigtable::admin::v2::PartialUpdateInstanceRequest
const&
as_proto()
113 google::bigtable::admin::v2::PartialUpdateInstanceRequest&&
as_proto() && {
114 return std::move(proto_);
117 std::string
const&
GetName() {
return proto_.mutable_instance()->name(); }
120 void AddPathIfNotPresent(std::string
const& field_name) {
121 if (!
google::
cloud::internal::Contains(proto_.update_mask().paths(),
123 proto_.mutable_update_mask()->add_paths(field_name);
127 google::bigtable::admin::v2::PartialUpdateInstanceRequest proto_;
130GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Specify the initial configuration for updating an instance.
Definition: instance_update_config.h:33
static constexpr InstanceType DEVELOPMENT
Definition: instance_update_config.h:50
InstanceUpdateConfig & set_state(StateType state)
Definition: instance_update_config.h:74
std::string const & GetName()
Definition: instance_update_config.h:117
google::bigtable::admin::v2::PartialUpdateInstanceRequest && as_proto() &&
Definition: instance_update_config.h:113
InstanceUpdateConfig & set_display_name(std::string display_name)
Definition: instance_update_config.h:86
static constexpr StateType STATE_NOT_KNOWN
Definition: instance_update_config.h:58
InstanceUpdateConfig & set_type(InstanceType type)
Definition: instance_update_config.h:68
static constexpr InstanceType PRODUCTION
Definition: instance_update_config.h:47
InstanceUpdateConfig & set_name(std::string name)
Definition: instance_update_config.h:80
static constexpr StateType CREATING
Definition: instance_update_config.h:64
InstanceUpdateConfig(Instance instance)
Definition: instance_update_config.h:36
static constexpr StateType READY
Definition: instance_update_config.h:61
static constexpr InstanceType TYPE_UNSPECIFIED
Definition: instance_update_config.h:44
google::bigtable::admin::v2::PartialUpdateInstanceRequest const & as_proto() const &
Definition: instance_update_config.h:107
InstanceUpdateConfig & insert_label(std::string const &key, std::string const &value)
Definition: instance_update_config.h:92
InstanceUpdateConfig & emplace_label(std::string const &key, std::string value)
Definition: instance_update_config.h:99
Contains all the Cloud Bigtable C++ client APIs.
Definition: admin_client.h:28