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/protobuf/util/message_differencer.h>
21#include <google/spanner/admin/instance/v1/spanner_instance_admin.pb.h>
28GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
31
32
33
34
35
36
37
38
39
52 return google::protobuf::util::MessageDifferencer::Equivalent(a.request_,
61
62
63
67 request_.mutable_instance()->set_name(in
.FullName());
69 request_.mutable_instance()->set_config(std::move(config));
73 request_.mutable_instance()->set_display_name(std::move(display_name));
78 request_.mutable_instance()->set_display_name(std::move(display_name));
79 return std::move(*
this);
83 request_.mutable_instance()->set_node_count(node_count);
88 request_.mutable_instance()->set_node_count(node_count);
89 return std::move(*
this);
93 request_.mutable_instance()->set_processing_units(processing_units);
98 request_.mutable_instance()->set_processing_units(processing_units);
99 return std::move(*
this);
103 std::map<std::string, std::string>
const& labels) & {
104 for (
auto const& pair : labels) {
105 request_.mutable_instance()->mutable_labels()->insert(
106 {pair.first, pair.second});
112 std::map<std::string, std::string>
const& labels) && {
113 for (
auto const& pair : labels) {
114 request_.mutable_instance()->mutable_labels()->insert(
115 {pair.first, pair.second});
117 return std::move(*
this);
120 google::spanner::admin::instance::v1::CreateInstanceRequest&
Build() & {
122 if (request_.instance().processing_units() == 0) {
123 if (request_.instance().node_count() == 0) {
124 request_.mutable_instance()->set_node_count(1);
129 google::spanner::admin::instance::v1::CreateInstanceRequest&&
Build() && {
131 if (request_.instance().processing_units() == 0) {
132 if (request_.instance().node_count() == 0) {
133 request_.mutable_instance()->set_node_count(1);
136 return std::move(request_);
140 google::spanner::admin::instance::v1::CreateInstanceRequest request_;
143GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
std::string FullName() const
CreateInstanceRequestBuilder is a builder class for google::spanner::admin::instance::v1::CreateInsta...
Definition: create_instance_request_builder.h:40
CreateInstanceRequestBuilder && SetNodeCount(int node_count) &&
Definition: create_instance_request_builder.h:87
CreateInstanceRequestBuilder(CreateInstanceRequestBuilder &&)=default
CreateInstanceRequestBuilder(CreateInstanceRequestBuilder const &)=default
CreateInstanceRequestBuilder & SetNodeCount(int node_count) &
Definition: create_instance_request_builder.h:82
CreateInstanceRequestBuilder(Instance const &in, std::string config)
Constructor requires Instance and Cloud Spanner instance config name.
Definition: create_instance_request_builder.h:64
CreateInstanceRequestBuilder & SetLabels(std::map< std::string, std::string > const &labels) &
Definition: create_instance_request_builder.h:102
CreateInstanceRequestBuilder && SetLabels(std::map< std::string, std::string > const &labels) &&
Definition: create_instance_request_builder.h:111
CreateInstanceRequestBuilder & SetProcessingUnits(int processing_units) &
Definition: create_instance_request_builder.h:92
CreateInstanceRequestBuilder && SetProcessingUnits(int processing_units) &&
Definition: create_instance_request_builder.h:97
CreateInstanceRequestBuilder & operator=(CreateInstanceRequestBuilder const &)=default
CreateInstanceRequestBuilder & operator=(CreateInstanceRequestBuilder &&)=default
friend bool operator==(CreateInstanceRequestBuilder const &a, CreateInstanceRequestBuilder const &b) noexcept
Definition: create_instance_request_builder.h:50
google::spanner::admin::instance::v1::CreateInstanceRequest & Build() &
Definition: create_instance_request_builder.h:120
CreateInstanceRequestBuilder && SetDisplayName(std::string display_name) &&
Definition: create_instance_request_builder.h:77
CreateInstanceRequestBuilder & SetDisplayName(std::string display_name) &
Definition: create_instance_request_builder.h:72
friend bool operator!=(CreateInstanceRequestBuilder const &a, CreateInstanceRequestBuilder const &b) noexcept
Definition: create_instance_request_builder.h:55
google::spanner::admin::instance::v1::CreateInstanceRequest && Build() &&
Definition: create_instance_request_builder.h:129
This class identifies a Cloud Spanner Instance.
Definition: instance.h:42
std::string FullName() const
Returns the fully qualified instance name as a string of the form: "projects/<project-id>/instances/<...
Project const & project() const
Returns the Project containing this instance.
Definition: instance.h:68
std::string const & instance_id() const
Returns the Instance ID.
Definition: instance.h:72
Contains all the Cloud Spanner C++ client types and functions.
Definition: backoff_policy.h:23