15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CREATE_INSTANCE_REQUEST_BUILDER_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_CREATE_INSTANCE_REQUEST_BUILDER_H
18 #include "google/cloud/spanner/instance.h"
19 #include "google/cloud/spanner/version.h"
20 #include <google/spanner/admin/instance/v1/spanner_instance_admin.pb.h>
56 request_.mutable_instance()->set_name(in
.FullName());
58 request_.mutable_instance()->set_config(std::move(config));
62 request_.mutable_instance()->set_display_name(std::move(display_name));
67 request_.mutable_instance()->set_display_name(std::move(display_name));
68 return std::move(*
this);
72 request_.mutable_instance()->set_node_count(node_count);
77 request_.mutable_instance()->set_node_count(node_count);
78 return std::move(*
this);
82 request_.mutable_instance()->set_processing_units(processing_units);
87 request_.mutable_instance()->set_processing_units(processing_units);
88 return std::move(*
this);
92 std::map<std::string, std::string>
const& labels) & {
93 for (
auto const& pair : labels) {
94 request_.mutable_instance()->mutable_labels()->insert(
95 {pair.first, pair.second});
101 std::map<std::string, std::string>
const& labels) && {
102 for (
auto const& pair : labels) {
103 request_.mutable_instance()->mutable_labels()->insert(
104 {pair.first, pair.second});
106 return std::move(*
this);
109 google::spanner::admin::instance::v1::CreateInstanceRequest&
Build() & {
111 if (request_.instance().processing_units() == 0) {
112 if (request_.instance().node_count() == 0) {
113 request_.mutable_instance()->set_node_count(1);
118 google::spanner::admin::instance::v1::CreateInstanceRequest&&
Build() && {
120 if (request_.instance().processing_units() == 0) {
121 if (request_.instance().node_count() == 0) {
122 request_.mutable_instance()->set_node_count(1);
125 return std::move(request_);
129 google::spanner::admin::instance::v1::CreateInstanceRequest request_;