From bf4d39c692bfbd7b94318d8a52e9906d5f71bcea Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Mon, 16 Sep 2019 14:02:05 +0100 Subject: [PATCH] Partial class to introduce properties/methods for backward compatibility --- .../TextToSpeechSettings.cs | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechSettings.cs diff --git a/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechSettings.cs b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechSettings.cs new file mode 100644 index 000000000000..53d23affd4db --- /dev/null +++ b/apis/Google.Cloud.TextToSpeech.V1/Google.Cloud.TextToSpeech.V1/TextToSpeechSettings.cs @@ -0,0 +1,63 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using gaxgrpc = Google.Api.Gax.Grpc; +using grpccore = Grpc.Core; +using sys = System; + +namespace Google.Cloud.TextToSpeech.V1 +{ + // This is a partial class introduced for backward compatibility with earlier versions. + public partial class TextToSpeechSettings + { + /// + /// In previous releases, this property returned a filter used by default for "Idempotent" RPC methods. + /// It is now unused, and may not represent the current default behavior. + /// + [Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")] + public static sys::Predicate IdempotentRetryFilter { get; } = + gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable); + + /// + /// In previous releases, this property returned a filter used by default for "NonIdempotent" RPC methods. + /// It is now unused, and may not represent the current default behavior. + /// + [Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")] + public static sys::Predicate NonIdempotentRetryFilter { get; } = + gaxgrpc::RetrySettings.FilterForStatusCodes(); + + /// + /// In previous releases, this method returned the backoff used by default for "Idempotent" RPC methods. + /// It is now unused, and may not represent the current default behavior. + /// + [Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")] + public static gaxgrpc::BackoffSettings GetDefaultRetryBackoff() => new gaxgrpc::BackoffSettings( + delay: sys::TimeSpan.FromMilliseconds(100), + maxDelay: sys::TimeSpan.FromMilliseconds(60000), + delayMultiplier: 1.3 + ); + + /// + /// In previous releases, this method returned the backoff used by default for "NonIdempotent" RPC methods. + /// It is now unused, and may not represent the current default behavior. + /// + [Obsolete("This member is no longer called by other code in this library. Please use the individual CallSettings properties.")] + public static gaxgrpc::BackoffSettings GetDefaultTimeoutBackoff() => new gaxgrpc::BackoffSettings( + delay: sys::TimeSpan.FromMilliseconds(20000), + maxDelay: sys::TimeSpan.FromMilliseconds(20000), + delayMultiplier: 1.0 + ); + } +}