Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ python.toolchain(
bazel_dep(name = "googleapis", version = "0.0.0", repo_name = "com_google_googleapis")
archive_override(
module_name = "googleapis",
integrity = "sha256-nqH6sI2rZfsPg8mmAw2vfv2eyiVJCWGyrnyqx2acWk4=",
integrity = "sha256-GZXEZMbkpRFnuoJjXh4dMXRtMMlLa2BLP0SqZb+YcTw=",
patch_strip = 1,
patches = ["//bazel:googleapis.modules.patch"],
strip_prefix = "googleapis-f4eff5440fd07389f820d22d2a55690c6390dc6d",
strip_prefix = "googleapis-c3556b45dc35a145e04b5692bc72e01a4f58a6b2",
urls = [
"https://github.com/googleapis/googleapis/archive/f4eff5440fd07389f820d22d2a55690c6390dc6d.tar.gz",
"https://github.com/googleapis/googleapis/archive/c3556b45dc35a145e04b5692bc72e01a4f58a6b2.tar.gz",
],
)

Expand Down
6 changes: 3 additions & 3 deletions bazel/workspace0.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ def gl_cpp_workspace0(name = None):
http_archive,
name = "com_google_googleapis",
urls = [
"https://github.com/googleapis/googleapis/archive/f4eff5440fd07389f820d22d2a55690c6390dc6d.tar.gz",
"https://github.com/googleapis/googleapis/archive/c3556b45dc35a145e04b5692bc72e01a4f58a6b2.tar.gz",
],
sha256 = "9ea1fab08dab65fb0f83c9a6030daf7efd9eca25490961b2ae7caac7669c5a4e",
strip_prefix = "googleapis-f4eff5440fd07389f820d22d2a55690c6390dc6d",
sha256 = "1995c464c6e4a51167ba82635e1e1d31746d30c94b6b604b3f44aa65bf98713c",
strip_prefix = "googleapis-c3556b45dc35a145e04b5692bc72e01a4f58a6b2",
build_file = Label("//bazel:googleapis.BUILD"),
# Scaffolding for patching googleapis after download. For example:
# patches = ["googleapis.patch"]
Expand Down
4 changes: 2 additions & 2 deletions cmake/GoogleapisConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256
mark_as_advanced(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256)

set(_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA
"f4eff5440fd07389f820d22d2a55690c6390dc6d")
"c3556b45dc35a145e04b5692bc72e01a4f58a6b2")
set(_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256
"9ea1fab08dab65fb0f83c9a6030daf7efd9eca25490961b2ae7caac7669c5a4e")
"1995c464c6e4a51167ba82635e1e1d31746d30c94b6b604b3f44aa65bf98713c")

set(DOXYGEN_ALIASES
"googleapis_link{2}=\"[\\1](https://github.com/googleapis/googleapis/blob/${_GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}/\\2)\""
Expand Down
1 change: 1 addition & 0 deletions external/googleapis/protodeps/storage.deps
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
@com_google_googleapis//google/iam/v1:options_proto
@com_google_googleapis//google/iam/v1:policy_proto
@com_google_googleapis//google/iam/v1:resource_policy_member_proto
@com_google_googleapis//google/rpc:status_proto
@com_google_googleapis//google/type:date_proto
@com_google_googleapis//google/type:expr_proto
23 changes: 23 additions & 0 deletions google/cloud/backupdr/v1/backup_dr_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,29 @@ BackupDRClient::TriggerBackup(google::longrunning::Operation const& operation,
return connection_->TriggerBackup(operation);
}

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
BackupDRClient::InitializeService(
google::cloud::backupdr::v1::InitializeServiceRequest const& request,
Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->InitializeService(request);
}

StatusOr<google::longrunning::Operation> BackupDRClient::InitializeService(
NoAwaitTag,
google::cloud::backupdr::v1::InitializeServiceRequest const& request,
Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->InitializeService(NoAwaitTag{}, request);
}

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
BackupDRClient::InitializeService(
google::longrunning::Operation const& operation, Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->InitializeService(operation);
}

StreamRange<google::cloud::location::Location> BackupDRClient::ListLocations(
google::cloud::location::ListLocationsRequest request, Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
Expand Down
236 changes: 152 additions & 84 deletions google/cloud/backupdr/v1/backup_dr_client.h

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions google/cloud/backupdr/v1/backup_dr_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,27 @@ BackupDRConnection::TriggerBackup(google::longrunning::Operation const&) {
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
BackupDRConnection::InitializeService(
google::cloud::backupdr::v1::InitializeServiceRequest const&) {
return google::cloud::make_ready_future<
StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::longrunning::Operation> BackupDRConnection::InitializeService(
NoAwaitTag, google::cloud::backupdr::v1::InitializeServiceRequest const&) {
return StatusOr<google::longrunning::Operation>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
BackupDRConnection::InitializeService(google::longrunning::Operation const&) {
return google::cloud::make_ready_future<
StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StreamRange<google::cloud::location::Location>
BackupDRConnection::ListLocations(
google::cloud::location::
Expand Down
13 changes: 13 additions & 0 deletions google/cloud/backupdr/v1/backup_dr_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,19 @@ class BackupDRConnection {
virtual future<StatusOr<google::cloud::backupdr::v1::BackupPlanAssociation>>
TriggerBackup(google::longrunning::Operation const& operation);

virtual future<
StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
InitializeService(
google::cloud::backupdr::v1::InitializeServiceRequest const& request);

virtual StatusOr<google::longrunning::Operation> InitializeService(
NoAwaitTag,
google::cloud::backupdr::v1::InitializeServiceRequest const& request);

virtual future<
StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
InitializeService(google::longrunning::Operation const& operation);

virtual StreamRange<google::cloud::location::Location> ListLocations(
google::cloud::location::ListLocationsRequest request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ Idempotency BackupDRConnectionIdempotencyPolicy::TriggerBackup(
return Idempotency::kNonIdempotent;
}

Idempotency BackupDRConnectionIdempotencyPolicy::InitializeService(
google::cloud::backupdr::v1::InitializeServiceRequest const&) {
return Idempotency::kNonIdempotent;
}

Idempotency BackupDRConnectionIdempotencyPolicy::ListLocations(
google::cloud::location::ListLocationsRequest) { // NOLINT
return Idempotency::kIdempotent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ class BackupDRConnectionIdempotencyPolicy {
virtual google::cloud::Idempotency TriggerBackup(
google::cloud::backupdr::v1::TriggerBackupRequest const& request);

virtual google::cloud::Idempotency InitializeService(
google::cloud::backupdr::v1::InitializeServiceRequest const& request);

virtual google::cloud::Idempotency ListLocations(
google::cloud::location::ListLocationsRequest request);

Expand Down
28 changes: 28 additions & 0 deletions google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,34 @@ StatusOr<google::longrunning::Operation> BackupDRAuth::TriggerBackup(
return child_->TriggerBackup(context, options, request);
}

future<StatusOr<google::longrunning::Operation>>
BackupDRAuth::AsyncInitializeService(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request) {
using ReturnType = StatusOr<google::longrunning::Operation>;
return auth_->AsyncConfigureContext(std::move(context))
.then([cq, child = child_, options = std::move(options),
request](future<StatusOr<std::shared_ptr<grpc::ClientContext>>>
f) mutable {
auto context = f.get();
if (!context) {
return make_ready_future(ReturnType(std::move(context).status()));
}
return child->AsyncInitializeService(cq, *std::move(context),
std::move(options), request);
});
}

StatusOr<google::longrunning::Operation> BackupDRAuth::InitializeService(
grpc::ClientContext& context, Options options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request) {
auto status = auth_->ConfigureContext(context);
if (!status.ok()) return status;
return child_->InitializeService(context, options, request);
}

StatusOr<google::cloud::location::ListLocationsResponse>
BackupDRAuth::ListLocations(
grpc::ClientContext& context, Options const& options,
Expand Down
12 changes: 12 additions & 0 deletions google/cloud/backupdr/v1/internal/backup_dr_auth_decorator.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ class BackupDRAuth : public BackupDRStub {
google::cloud::backupdr::v1::TriggerBackupRequest const& request)
override;

future<StatusOr<google::longrunning::Operation>> AsyncInitializeService(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request)
override;

StatusOr<google::longrunning::Operation> InitializeService(
grpc::ClientContext& context, Options options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request)
override;

StatusOr<google::cloud::location::ListLocationsResponse> ListLocations(
grpc::ClientContext& context, Options const& options,
google::cloud::location::ListLocationsRequest const& request) override;
Expand Down
93 changes: 93 additions & 0 deletions google/cloud/backupdr/v1/internal/backup_dr_connection_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,99 @@ BackupDRConnectionImpl::TriggerBackup(
polling_policy(*current), __func__);
}

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
BackupDRConnectionImpl::InitializeService(
google::cloud::backupdr::v1::InitializeServiceRequest const& request) {
auto current = google::cloud::internal::SaveCurrentOptions();
auto request_copy = request;
auto const idempotent =
idempotency_policy(*current)->InitializeService(request_copy);
return google::cloud::internal::AsyncLongRunningOperation<
google::cloud::backupdr::v1::InitializeServiceResponse>(
background_->cq(), current, std::move(request_copy),
[stub = stub_](
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::cloud::backupdr::v1::InitializeServiceRequest const&
request) {
return stub->AsyncInitializeService(cq, std::move(context),
std::move(options), request);
},
[stub = stub_](google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::longrunning::GetOperationRequest const& request) {
return stub->AsyncGetOperation(cq, std::move(context),
std::move(options), request);
},
[stub = stub_](
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::longrunning::CancelOperationRequest const& request) {
return stub->AsyncCancelOperation(cq, std::move(context),
std::move(options), request);
},
&google::cloud::internal::ExtractLongRunningResultResponse<
google::cloud::backupdr::v1::InitializeServiceResponse>,
retry_policy(*current), backoff_policy(*current), idempotent,
polling_policy(*current), __func__);
}

StatusOr<google::longrunning::Operation>
BackupDRConnectionImpl::InitializeService(
NoAwaitTag,
google::cloud::backupdr::v1::InitializeServiceRequest const& request) {
auto current = google::cloud::internal::SaveCurrentOptions();
return google::cloud::internal::RetryLoop(
retry_policy(*current), backoff_policy(*current),
idempotency_policy(*current)->InitializeService(request),
[this](grpc::ClientContext& context, Options const& options,
google::cloud::backupdr::v1::InitializeServiceRequest const&
request) {
return stub_->InitializeService(context, options, request);
},
*current, request, __func__);
}

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
BackupDRConnectionImpl::InitializeService(
google::longrunning::Operation const& operation) {
auto current = google::cloud::internal::SaveCurrentOptions();
if (!operation.metadata()
.Is<typename google::cloud::backupdr::v1::OperationMetadata>()) {
return make_ready_future<
StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>(
internal::InvalidArgumentError(
"operation does not correspond to InitializeService",
GCP_ERROR_INFO().WithMetadata("operation",
operation.metadata().DebugString())));
}

return google::cloud::internal::AsyncAwaitLongRunningOperation<
google::cloud::backupdr::v1::InitializeServiceResponse>(
background_->cq(), current, operation,
[stub = stub_](google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::longrunning::GetOperationRequest const& request) {
return stub->AsyncGetOperation(cq, std::move(context),
std::move(options), request);
},
[stub = stub_](
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::longrunning::CancelOperationRequest const& request) {
return stub->AsyncCancelOperation(cq, std::move(context),
std::move(options), request);
},
&google::cloud::internal::ExtractLongRunningResultResponse<
google::cloud::backupdr::v1::InitializeServiceResponse>,
polling_policy(*current), __func__);
}

StreamRange<google::cloud::location::Location>
BackupDRConnectionImpl::ListLocations(
google::cloud::location::ListLocationsRequest request) {
Expand Down
12 changes: 12 additions & 0 deletions google/cloud/backupdr/v1/internal/backup_dr_connection_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ class BackupDRConnectionImpl : public backupdr_v1::BackupDRConnection {
future<StatusOr<google::cloud::backupdr::v1::BackupPlanAssociation>>
TriggerBackup(google::longrunning::Operation const& operation) override;

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
InitializeService(google::cloud::backupdr::v1::InitializeServiceRequest const&
request) override;

StatusOr<google::longrunning::Operation> InitializeService(
NoAwaitTag,
google::cloud::backupdr::v1::InitializeServiceRequest const& request)
override;

future<StatusOr<google::cloud::backupdr::v1::InitializeServiceResponse>>
InitializeService(google::longrunning::Operation const& operation) override;

StreamRange<google::cloud::location::Location> ListLocations(
google::cloud::location::ListLocationsRequest request) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,37 @@ StatusOr<google::longrunning::Operation> BackupDRLogging::TriggerBackup(
context, options, request, __func__, tracing_options_);
}

future<StatusOr<google::longrunning::Operation>>
BackupDRLogging::AsyncInitializeService(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request) {
return google::cloud::internal::LogWrapper(
[this](google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::cloud::backupdr::v1::InitializeServiceRequest const&
request) {
return child_->AsyncInitializeService(cq, std::move(context),
std::move(options), request);
},
cq, std::move(context), std::move(options), request, __func__,
tracing_options_);
}

StatusOr<google::longrunning::Operation> BackupDRLogging::InitializeService(
grpc::ClientContext& context, Options options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request) {
return google::cloud::internal::LogWrapper(
[this](grpc::ClientContext& context, Options const& options,
google::cloud::backupdr::v1::InitializeServiceRequest const&
request) {
return child_->InitializeService(context, options, request);
},
context, options, request, __func__, tracing_options_);
}

StatusOr<google::cloud::location::ListLocationsResponse>
BackupDRLogging::ListLocations(
grpc::ClientContext& context, Options const& options,
Expand Down
12 changes: 12 additions & 0 deletions google/cloud/backupdr/v1/internal/backup_dr_logging_decorator.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,18 @@ class BackupDRLogging : public BackupDRStub {
google::cloud::backupdr::v1::TriggerBackupRequest const& request)
override;

future<StatusOr<google::longrunning::Operation>> AsyncInitializeService(
google::cloud::CompletionQueue& cq,
std::shared_ptr<grpc::ClientContext> context,
google::cloud::internal::ImmutableOptions options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request)
override;

StatusOr<google::longrunning::Operation> InitializeService(
grpc::ClientContext& context, Options options,
google::cloud::backupdr::v1::InitializeServiceRequest const& request)
override;

StatusOr<google::cloud::location::ListLocationsResponse> ListLocations(
grpc::ClientContext& context, Options const& options,
google::cloud::location::ListLocationsRequest const& request) override;
Expand Down
Loading
Loading