Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl(generator): add Start and Await overloads to connections #14348

Merged
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@ extend-ignore-identifiers-re = [
# This pattern can be found in long hex strings.
"[0-9]caf[0-9]",
# This is a GCS dual-region name.
"NAM4"
"NAM4",
# Metadata is mispelled in this proto message name found in
# google/cloud/aiplatform/v1/vizier_service.proto
"CheckTrialEarlyStoppingStateMetatdata"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

]
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "generator/integration_tests/golden/v1/golden_kitchen_sink_connection_idempotency_policy.h"
#include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_retry_traits.h"
#include "google/cloud/backoff_policy.h"
#include "google/cloud/experimental_tag.h"
#include "google/cloud/future.h"
#include "google/cloud/internal/async_read_write_stream_impl.h"
#include "google/cloud/internal/retry_policy_impl.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "generator/integration_tests/golden/v1/golden_rest_only_connection_idempotency_policy.h"
#include "generator/integration_tests/golden/v1/internal/golden_rest_only_retry_traits.h"
#include "google/cloud/backoff_policy.h"
#include "google/cloud/experimental_tag.h"
#include "google/cloud/internal/retry_policy_impl.h"
#include "google/cloud/options.h"
#include "google/cloud/status_or.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ GoldenThingAdminConnection::CreateDatabase(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::longrunning::Operation>
GoldenThingAdminConnection::CreateDatabase(
ExperimentalTag, NoAwaitTag,
google::test::admin::database::v1::CreateDatabaseRequest const&) {
return StatusOr<google::longrunning::Operation>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::test::admin::database::v1::Database>>
GoldenThingAdminConnection::CreateDatabase(
ExperimentalTag, google::longrunning::Operation const&) {
return google::cloud::make_ready_future<
StatusOr<google::test::admin::database::v1::Database>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::test::admin::database::v1::Database>
GoldenThingAdminConnection::GetDatabase(
google::test::admin::database::v1::GetDatabaseRequest const&) {
Expand All @@ -66,6 +82,22 @@ GoldenThingAdminConnection::UpdateDatabaseDdl(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::longrunning::Operation>
GoldenThingAdminConnection::UpdateDatabaseDdl(
ExperimentalTag, NoAwaitTag,
google::test::admin::database::v1::UpdateDatabaseDdlRequest const&) {
return StatusOr<google::longrunning::Operation>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::test::admin::database::v1::UpdateDatabaseDdlMetadata>>
GoldenThingAdminConnection::UpdateDatabaseDdl(
ExperimentalTag, google::longrunning::Operation const&) {
return google::cloud::make_ready_future<
StatusOr<google::test::admin::database::v1::UpdateDatabaseDdlMetadata>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

Status
GoldenThingAdminConnection::DropDatabase(
google::test::admin::database::v1::DropDatabaseRequest const&) {
Expand Down Expand Up @@ -104,6 +136,22 @@ GoldenThingAdminConnection::CreateBackup(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::longrunning::Operation>
GoldenThingAdminConnection::CreateBackup(
ExperimentalTag, NoAwaitTag,
google::test::admin::database::v1::CreateBackupRequest const&) {
return StatusOr<google::longrunning::Operation>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::test::admin::database::v1::Backup>>
GoldenThingAdminConnection::CreateBackup(
ExperimentalTag, google::longrunning::Operation const&) {
return google::cloud::make_ready_future<
StatusOr<google::test::admin::database::v1::Backup>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::test::admin::database::v1::Backup>
GoldenThingAdminConnection::GetBackup(
google::test::admin::database::v1::GetBackupRequest const&) {
Expand Down Expand Up @@ -136,6 +184,22 @@ GoldenThingAdminConnection::RestoreDatabase(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::longrunning::Operation>
GoldenThingAdminConnection::RestoreDatabase(
ExperimentalTag, NoAwaitTag,
google::test::admin::database::v1::RestoreDatabaseRequest const&) {
return StatusOr<google::longrunning::Operation>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::test::admin::database::v1::Database>>
GoldenThingAdminConnection::RestoreDatabase(
ExperimentalTag, google::longrunning::Operation const&) {
return google::cloud::make_ready_future<
StatusOr<google::test::admin::database::v1::Database>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StreamRange<google::longrunning::Operation> GoldenThingAdminConnection::ListDatabaseOperations(
google::test::admin::database::v1::ListDatabaseOperationsRequest) { // NOLINT(performance-unnecessary-value-param)
return google::cloud::internal::MakeUnimplementedPaginationRange<
Expand All @@ -156,6 +220,22 @@ GoldenThingAdminConnection::LongRunningWithoutRouting(
Status(StatusCode::kUnimplemented, "not implemented"));
}

StatusOr<google::longrunning::Operation>
GoldenThingAdminConnection::LongRunningWithoutRouting(
ExperimentalTag, NoAwaitTag,
google::test::admin::database::v1::RestoreDatabaseRequest const&) {
return StatusOr<google::longrunning::Operation>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::test::admin::database::v1::Database>>
GoldenThingAdminConnection::LongRunningWithoutRouting(
ExperimentalTag, google::longrunning::Operation const&) {
return google::cloud::make_ready_future<
StatusOr<google::test::admin::database::v1::Database>>(
Status(StatusCode::kUnimplemented, "not implemented"));
}

future<StatusOr<google::test::admin::database::v1::Database>>
GoldenThingAdminConnection::AsyncGetDatabase(
google::test::admin::database::v1::GetDatabaseRequest const&) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
#include "generator/integration_tests/golden/v1/golden_thing_admin_connection_idempotency_policy.h"
#include "generator/integration_tests/golden/v1/internal/golden_thing_admin_retry_traits.h"
#include "google/cloud/backoff_policy.h"
#include "google/cloud/experimental_tag.h"
#include "google/cloud/future.h"
#include "google/cloud/internal/retry_policy_impl.h"
#include "google/cloud/no_await_tag.h"
#include "google/cloud/options.h"
#include "google/cloud/polling_policy.h"
#include "google/cloud/status_or.h"
Expand Down Expand Up @@ -187,12 +189,24 @@ class GoldenThingAdminConnection {
virtual future<StatusOr<google::test::admin::database::v1::Database>>
CreateDatabase(google::test::admin::database::v1::CreateDatabaseRequest const& request);

virtual StatusOr<google::longrunning::Operation>
CreateDatabase(ExperimentalTag, NoAwaitTag, google::test::admin::database::v1::CreateDatabaseRequest const& request);

virtual future<StatusOr<google::test::admin::database::v1::Database>>
CreateDatabase(ExperimentalTag, google::longrunning::Operation const& operation);

virtual StatusOr<google::test::admin::database::v1::Database>
GetDatabase(google::test::admin::database::v1::GetDatabaseRequest const& request);

virtual future<StatusOr<google::test::admin::database::v1::UpdateDatabaseDdlMetadata>>
UpdateDatabaseDdl(google::test::admin::database::v1::UpdateDatabaseDdlRequest const& request);

virtual StatusOr<google::longrunning::Operation>
UpdateDatabaseDdl(ExperimentalTag, NoAwaitTag, google::test::admin::database::v1::UpdateDatabaseDdlRequest const& request);

virtual future<StatusOr<google::test::admin::database::v1::UpdateDatabaseDdlMetadata>>
UpdateDatabaseDdl(ExperimentalTag, google::longrunning::Operation const& operation);

virtual Status
DropDatabase(google::test::admin::database::v1::DropDatabaseRequest const& request);

Expand All @@ -211,6 +225,12 @@ class GoldenThingAdminConnection {
virtual future<StatusOr<google::test::admin::database::v1::Backup>>
CreateBackup(google::test::admin::database::v1::CreateBackupRequest const& request);

virtual StatusOr<google::longrunning::Operation>
CreateBackup(ExperimentalTag, NoAwaitTag, google::test::admin::database::v1::CreateBackupRequest const& request);

virtual future<StatusOr<google::test::admin::database::v1::Backup>>
CreateBackup(ExperimentalTag, google::longrunning::Operation const& operation);

virtual StatusOr<google::test::admin::database::v1::Backup>
GetBackup(google::test::admin::database::v1::GetBackupRequest const& request);

Expand All @@ -226,6 +246,12 @@ class GoldenThingAdminConnection {
virtual future<StatusOr<google::test::admin::database::v1::Database>>
RestoreDatabase(google::test::admin::database::v1::RestoreDatabaseRequest const& request);

virtual StatusOr<google::longrunning::Operation>
RestoreDatabase(ExperimentalTag, NoAwaitTag, google::test::admin::database::v1::RestoreDatabaseRequest const& request);

virtual future<StatusOr<google::test::admin::database::v1::Database>>
RestoreDatabase(ExperimentalTag, google::longrunning::Operation const& operation);

virtual StreamRange<google::longrunning::Operation>
ListDatabaseOperations(google::test::admin::database::v1::ListDatabaseOperationsRequest request);

Expand All @@ -235,6 +261,12 @@ class GoldenThingAdminConnection {
virtual future<StatusOr<google::test::admin::database::v1::Database>>
LongRunningWithoutRouting(google::test::admin::database::v1::RestoreDatabaseRequest const& request);

virtual StatusOr<google::longrunning::Operation>
LongRunningWithoutRouting(ExperimentalTag, NoAwaitTag, google::test::admin::database::v1::RestoreDatabaseRequest const& request);

virtual future<StatusOr<google::test::admin::database::v1::Database>>
LongRunningWithoutRouting(ExperimentalTag, google::longrunning::Operation const& operation);

virtual future<StatusOr<google::test::admin::database::v1::Database>>
AsyncGetDatabase(google::test::admin::database::v1::GetDatabaseRequest const& request);

Expand Down
Loading
Loading