codekingpro/portable-devtools
114k
1# Copyright 2017 Google LLC2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14 15"""Retry implementation for Google API client libraries."""16 17from .retry_base import exponential_sleep_generator18from .retry_base import if_exception_type19from .retry_base import if_transient_error20from .retry_base import build_retry_error21from .retry_base import RetryFailureReason22from .retry_unary import Retry23from .retry_unary import retry_target24from .retry_unary_async import AsyncRetry25from .retry_unary_async import retry_target as retry_target_async26from .retry_streaming import StreamingRetry27from .retry_streaming import retry_target_stream28from .retry_streaming_async import AsyncStreamingRetry29from .retry_streaming_async import retry_target_stream as retry_target_stream_async30 31# The following imports are for backwards compatibility with https://github.com/googleapis/python-api-core/blob/4d7d2edee2c108d43deb151e6e0fdceb56b73275/google/api_core/retry.py32#33# TODO: Revert these imports on the next major version release (https://github.com/googleapis/python-api-core/issues/576)34from google.api_core import datetime_helpers # noqa: F40135from google.api_core import exceptions # noqa: F40136from google.auth import exceptions as auth_exceptions # noqa: F40137 38__all__ = (39 "exponential_sleep_generator",40 "if_exception_type",41 "if_transient_error",42 "build_retry_error",43 "RetryFailureReason",44 "Retry",45 "AsyncRetry",46 "StreamingRetry",47 "AsyncStreamingRetry",48 "retry_target",49 "retry_target_async",50 "retry_target_stream",51 "retry_target_stream_async",52)53 