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): backwards compat using declarations are deprecated #10466

Merged
merged 2 commits into from
Dec 20, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::GoldenKitchenSinkClient directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkClient;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::MakeGoldenKitchenSinkConnection directly.
using ::google::cloud::golden_v1::MakeGoldenKitchenSinkConnection;

/// @deprecated Use golden_v1::GoldenKitchenSinkConnection directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkConnection;

/// @deprecated Use golden_v1::GoldenKitchenSinkLimitedErrorCountRetryPolicy directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkLimitedErrorCountRetryPolicy;

/// @deprecated Use golden_v1::GoldenKitchenSinkLimitedTimeRetryPolicy directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkLimitedTimeRetryPolicy;

/// @deprecated Use golden_v1::GoldenKitchenSinkRetryPolicy directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkRetryPolicy;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::MakeDefaultGoldenKitchenSinkConnectionIdempotencyPolicy directly.
using ::google::cloud::golden_v1::MakeDefaultGoldenKitchenSinkConnectionIdempotencyPolicy;

/// @deprecated Use golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicy directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicy;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::GoldenKitchenSinkBackoffPolicyOption directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkBackoffPolicyOption;

/// @deprecated Use golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicyOption directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkConnectionIdempotencyPolicyOption;

/// @deprecated Use golden_v1::GoldenKitchenSinkPolicyOptionList directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkPolicyOptionList;

/// @deprecated Use golden_v1::GoldenKitchenSinkRetryPolicyOption directly.
using ::google::cloud::golden_v1::GoldenKitchenSinkRetryPolicyOption;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::GoldenThingAdminClient directly.
using ::google::cloud::golden_v1::GoldenThingAdminClient;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::MakeGoldenThingAdminConnection directly.
using ::google::cloud::golden_v1::MakeGoldenThingAdminConnection;

/// @deprecated Use golden_v1::GoldenThingAdminConnection directly.
using ::google::cloud::golden_v1::GoldenThingAdminConnection;

/// @deprecated Use golden_v1::GoldenThingAdminLimitedErrorCountRetryPolicy directly.
using ::google::cloud::golden_v1::GoldenThingAdminLimitedErrorCountRetryPolicy;

/// @deprecated Use golden_v1::GoldenThingAdminLimitedTimeRetryPolicy directly.
using ::google::cloud::golden_v1::GoldenThingAdminLimitedTimeRetryPolicy;

/// @deprecated Use golden_v1::GoldenThingAdminRetryPolicy directly.
using ::google::cloud::golden_v1::GoldenThingAdminRetryPolicy;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::MakeDefaultGoldenThingAdminConnectionIdempotencyPolicy directly.
using ::google::cloud::golden_v1::MakeDefaultGoldenThingAdminConnectionIdempotencyPolicy;

/// @deprecated Use golden_v1::GoldenThingAdminConnectionIdempotencyPolicy directly.
using ::google::cloud::golden_v1::GoldenThingAdminConnectionIdempotencyPolicy;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ namespace cloud {
namespace golden {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1::GoldenThingAdminPollingPolicyOption directly.
using ::google::cloud::golden_v1::GoldenThingAdminPollingPolicyOption;

/// @deprecated Use golden_v1::GoldenThingAdminBackoffPolicyOption directly.
using ::google::cloud::golden_v1::GoldenThingAdminBackoffPolicyOption;

/// @deprecated Use golden_v1::GoldenThingAdminConnectionIdempotencyPolicyOption directly.
using ::google::cloud::golden_v1::GoldenThingAdminConnectionIdempotencyPolicyOption;

/// @deprecated Use golden_v1::GoldenThingAdminPolicyOptionList directly.
using ::google::cloud::golden_v1::GoldenThingAdminPolicyOptionList;

/// @deprecated Use golden_v1::GoldenThingAdminRetryPolicyOption directly.
using ::google::cloud::golden_v1::GoldenThingAdminRetryPolicyOption;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace cloud {
namespace golden_mocks {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1_mocks::MockGoldenKitchenSinkConnection directly.
using ::google::cloud::golden_v1_mocks::MockGoldenKitchenSinkConnection;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace cloud {
namespace golden_mocks {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

/// @deprecated Use golden_v1_mocks::MockGoldenThingAdminConnection directly.
using ::google::cloud::golden_v1_mocks::MockGoldenThingAdminConnection;

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
1 change: 1 addition & 0 deletions generator/internal/forwarding_client_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Status ForwardingClientGenerator::GenerateHeader() {
// forwards
HeaderPrint(
R"""(
/// @deprecated Use $product_namespace$::$client_class_name$ directly.
using ::google::cloud::$product_namespace$::$client_class_name$;
)""");

Expand Down
9 changes: 9 additions & 0 deletions generator/internal/forwarding_connection_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,19 @@ Status ForwardingConnectionGenerator::GenerateHeader() {

HeaderPrint(
R"""(
/// @deprecated Use $product_namespace$::Make$connection_class_name$ directly.
using ::google::cloud::$product_namespace$::Make$connection_class_name$;

/// @deprecated Use $product_namespace$::$connection_class_name$ directly.
using ::google::cloud::$product_namespace$::$connection_class_name$;

/// @deprecated Use $product_namespace$::$limited_error_count_retry_policy_name$ directly.
using ::google::cloud::$product_namespace$::$limited_error_count_retry_policy_name$;

/// @deprecated Use $product_namespace$::$limited_time_retry_policy_name$ directly.
using ::google::cloud::$product_namespace$::$limited_time_retry_policy_name$;

/// @deprecated Use $product_namespace$::$retry_policy_name$ directly.
using ::google::cloud::$product_namespace$::$retry_policy_name$;
)""");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ Status ForwardingIdempotencyPolicyGenerator::GenerateHeader() {
// forwards
HeaderPrint(
R"""(
/// @deprecated Use $product_namespace$::MakeDefault$idempotency_class_name$ directly.
using ::google::cloud::$product_namespace$::MakeDefault$idempotency_class_name$;

/// @deprecated Use $product_namespace$::$idempotency_class_name$ directly.
using ::google::cloud::$product_namespace$::$idempotency_class_name$;
)""");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Status ForwardingMockConnectionGenerator::GenerateHeader() {

HeaderPrint(
R"""(
/// @deprecated Use $product_namespace$_mocks::$mock_connection_class_name$ directly.
using ::google::cloud::$product_namespace$_mocks::$mock_connection_class_name$;
)""");

Expand Down
11 changes: 10 additions & 1 deletion generator/internal/forwarding_options_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,21 @@ Status ForwardingOptionsGenerator::GenerateHeader() {
// forwards
if (HasLongrunningMethod()) {
HeaderPrint(R"""(
using ::google::cloud::$product_namespace$::$service_name$PollingPolicyOption;)""");
/// @deprecated Use $product_namespace$::$service_name$PollingPolicyOption directly.
using ::google::cloud::$product_namespace$::$service_name$PollingPolicyOption;
)""");
}
HeaderPrint(R"""(
/// @deprecated Use $product_namespace$::$service_name$BackoffPolicyOption directly.
using ::google::cloud::$product_namespace$::$service_name$BackoffPolicyOption;

/// @deprecated Use $product_namespace$::$service_name$ConnectionIdempotencyPolicyOption directly.
using ::google::cloud::$product_namespace$::$service_name$ConnectionIdempotencyPolicyOption;

/// @deprecated Use $product_namespace$::$service_name$PolicyOptionList directly.
using ::google::cloud::$product_namespace$::$service_name$PolicyOptionList;

/// @deprecated Use $product_namespace$::$service_name$RetryPolicyOption directly.
using ::google::cloud::$product_namespace$::$service_name$RetryPolicyOption;
)""");

Expand Down