| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:ce48ed695c727f7e13efd1fd68f466a55a0d772c87b69158720cec39965bc8b2 | ||
| 1 | + image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:eec191fc4904c204cd717c79812cd66997b5559776483ee223f69c8f43e99224 | ||
| 2 | 2 | libraries: | |
| 3 | 3 | - id: google-cloud-firestore | |
| 4 | 4 | version: 2.21.0 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,3 +13,6 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,8 +13,12 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | - from .client import FirestoreAdminClient | ||
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 19 | + | ||
| 17 | 20 | from .async_client import FirestoreAdminAsyncClient | |
| 21 | + from .client import FirestoreAdminClient | ||
| 18 | 22 | ||
| 19 | 23 | __all__ = ( | |
| 20 | 24 | "FirestoreAdminClient", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,12 +13,16 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | - import logging as std_logging | ||
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 19 | + | ||
| 17 | 20 | from collections import OrderedDict | |
| 21 | + import logging as std_logging | ||
| 18 | 22 | import re | |
| 19 | 23 | from typing import ( | |
| 20 | - Dict, | ||
| 21 | 24 | Callable, | |
| 25 | + Dict, | ||
| 22 | 26 | Mapping, | |
| 23 | 27 | MutableMapping, | |
| 24 | 28 | MutableSequence, | |
@@ -29,16 +33,15 @@ | |||
| 29 | 33 | Union, | |
| 30 | 34 | ) | |
| 31 | 35 | ||
| 32 | - from google.cloud.firestore_admin_v1 import gapic_version as package_version | ||
| 33 | - | ||
| 34 | - from google.api_core.client_options import ClientOptions | ||
| 35 | 36 | from google.api_core import exceptions as core_exceptions | |
| 36 | 37 | from google.api_core import gapic_v1 | |
| 37 | 38 | from google.api_core import retry_async as retries | |
| 39 | + from google.api_core.client_options import ClientOptions | ||
| 38 | 40 | from google.auth import credentials as ga_credentials # type: ignore | |
| 39 | 41 | from google.oauth2 import service_account # type: ignore | |
| 40 | 42 | import google.protobuf | |
| 41 | 43 | ||
| 44 | + from google.cloud.firestore_admin_v1 import gapic_version as package_version | ||
| 42 | 45 | ||
| 43 | 46 | try: | |
| 44 | 47 | OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None] | |
@@ -47,6 +50,13 @@ | |||
| 47 | 50 | ||
| 48 | 51 | from google.api_core import operation as gac_operation # type: ignore | |
| 49 | 52 | from google.api_core import operation_async # type: ignore | |
| 53 | + from google.cloud.location import locations_pb2 # type: ignore | ||
| 54 | + from google.longrunning import operations_pb2 # type: ignore | ||
| 55 | + from google.protobuf import duration_pb2 # type: ignore | ||
| 56 | + from google.protobuf import empty_pb2 # type: ignore | ||
| 57 | + from google.protobuf import field_mask_pb2 # type: ignore | ||
| 58 | + from google.protobuf import timestamp_pb2 # type: ignore | ||
| 59 | + | ||
| 50 | 60 | from google.cloud.firestore_admin_v1.services.firestore_admin import pagers | |
| 51 | 61 | from google.cloud.firestore_admin_v1.types import backup | |
| 52 | 62 | from google.cloud.firestore_admin_v1.types import database | |
@@ -60,15 +70,10 @@ | |||
| 60 | 70 | from google.cloud.firestore_admin_v1.types import schedule | |
| 61 | 71 | from google.cloud.firestore_admin_v1.types import user_creds | |
| 62 | 72 | from google.cloud.firestore_admin_v1.types import user_creds as gfa_user_creds | |
| 63 | - from google.cloud.location import locations_pb2 # type: ignore | ||
| 64 | - from google.longrunning import operations_pb2 # type: ignore | ||
| 65 | - from google.protobuf import duration_pb2 # type: ignore | ||
| 66 | - from google.protobuf import empty_pb2 # type: ignore | ||
| 67 | - from google.protobuf import field_mask_pb2 # type: ignore | ||
| 68 | - from google.protobuf import timestamp_pb2 # type: ignore | ||
| 69 | - from .transports.base import FirestoreAdminTransport, DEFAULT_CLIENT_INFO | ||
| 70 | - from .transports.grpc_asyncio import FirestoreAdminGrpcAsyncIOTransport | ||
| 73 | + | ||
| 71 | 74 | from .client import FirestoreAdminClient | |
| 75 | + from .transports.base import DEFAULT_CLIENT_INFO, FirestoreAdminTransport | ||
| 76 | + from .transports.grpc_asyncio import FirestoreAdminGrpcAsyncIOTransport | ||
| 72 | 77 | ||
| 73 | 78 | try: | |
| 74 | 79 | from google.api_core import client_logging # type: ignore | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,15 +13,19 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 19 | + | ||
| 16 | 20 | from collections import OrderedDict | |
| 17 | 21 | from http import HTTPStatus | |
| 18 | 22 | import json | |
| 19 | 23 | import logging as std_logging | |
| 20 | 24 | import os | |
| 21 | 25 | import re | |
| 22 | 26 | from typing import ( | |
| 23 | - Dict, | ||
| 24 | 27 | Callable, | |
| 28 | + Dict, | ||
| 25 | 29 | Mapping, | |
| 26 | 30 | MutableMapping, | |
| 27 | 31 | MutableSequence, | |
@@ -34,19 +38,19 @@ | |||
| 34 | 38 | ) | |
| 35 | 39 | import warnings | |
| 36 | 40 | ||
| 37 | - from google.cloud.firestore_admin_v1 import gapic_version as package_version | ||
| 38 | - | ||
| 39 | 41 | from google.api_core import client_options as client_options_lib | |
| 40 | 42 | from google.api_core import exceptions as core_exceptions | |
| 41 | 43 | from google.api_core import gapic_v1 | |
| 42 | 44 | from google.api_core import retry as retries | |
| 43 | 45 | from google.auth import credentials as ga_credentials # type: ignore | |
| 46 | + from google.auth.exceptions import MutualTLSChannelError # type: ignore | ||
| 44 | 47 | from google.auth.transport import mtls # type: ignore | |
| 45 | 48 | from google.auth.transport.grpc import SslCredentials # type: ignore | |
| 46 | - from google.auth.exceptions import MutualTLSChannelError # type: ignore | ||
| 47 | 49 | from google.oauth2 import service_account # type: ignore | |
| 48 | 50 | import google.protobuf | |
| 49 | 51 | ||
| 52 | + from google.cloud.firestore_admin_v1 import gapic_version as package_version | ||
| 53 | + | ||
| 50 | 54 | try: | |
| 51 | 55 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] | |
| 52 | 56 | except AttributeError: # pragma: NO COVER | |
@@ -63,6 +67,13 @@ | |||
| 63 | 67 | ||
| 64 | 68 | from google.api_core import operation as gac_operation # type: ignore | |
| 65 | 69 | from google.api_core import operation_async # type: ignore | |
| 70 | + from google.cloud.location import locations_pb2 # type: ignore | ||
| 71 | + from google.longrunning import operations_pb2 # type: ignore | ||
| 72 | + from google.protobuf import duration_pb2 # type: ignore | ||
| 73 | + from google.protobuf import empty_pb2 # type: ignore | ||
| 74 | + from google.protobuf import field_mask_pb2 # type: ignore | ||
| 75 | + from google.protobuf import timestamp_pb2 # type: ignore | ||
| 76 | + | ||
| 66 | 77 | from google.cloud.firestore_admin_v1.services.firestore_admin import pagers | |
| 67 | 78 | from google.cloud.firestore_admin_v1.types import backup | |
| 68 | 79 | from google.cloud.firestore_admin_v1.types import database | |
@@ -76,13 +87,8 @@ | |||
| 76 | 87 | from google.cloud.firestore_admin_v1.types import schedule | |
| 77 | 88 | from google.cloud.firestore_admin_v1.types import user_creds | |
| 78 | 89 | from google.cloud.firestore_admin_v1.types import user_creds as gfa_user_creds | |
| 79 | - from google.cloud.location import locations_pb2 # type: ignore | ||
| 80 | - from google.longrunning import operations_pb2 # type: ignore | ||
| 81 | - from google.protobuf import duration_pb2 # type: ignore | ||
| 82 | - from google.protobuf import empty_pb2 # type: ignore | ||
| 83 | - from google.protobuf import field_mask_pb2 # type: ignore | ||
| 84 | - from google.protobuf import timestamp_pb2 # type: ignore | ||
| 85 | - from .transports.base import FirestoreAdminTransport, DEFAULT_CLIENT_INFO | ||
| 90 | + | ||
| 91 | + from .transports.base import DEFAULT_CLIENT_INFO, FirestoreAdminTransport | ||
| 86 | 92 | from .transports.grpc import FirestoreAdminGrpcTransport | |
| 87 | 93 | from .transports.grpc_asyncio import FirestoreAdminGrpcAsyncIOTransport | |
| 88 | 94 | from .transports.rest import FirestoreAdminRestTransport | |
@@ -198,6 +204,34 @@ def _get_default_mtls_endpoint(api_endpoint): | |||
| 198 | 204 | _DEFAULT_ENDPOINT_TEMPLATE = "firestore.{UNIVERSE_DOMAIN}" | |
| 199 | 205 | _DEFAULT_UNIVERSE = "googleapis.com" | |
| 200 | 206 | ||
| 207 | + @staticmethod | ||
| 208 | + def _use_client_cert_effective(): | ||
| 209 | + """Returns whether client certificate should be used for mTLS if the | ||
| 210 | + google-auth version supports should_use_client_cert automatic mTLS enablement. | ||
| 211 | + | ||
| 212 | + Alternatively, read from the GOOGLE_API_USE_CLIENT_CERTIFICATE env var. | ||
| 213 | + | ||
| 214 | + Returns: | ||
| 215 | + bool: whether client certificate should be used for mTLS | ||
| 216 | + Raises: | ||
| 217 | + ValueError: (If using a version of google-auth without should_use_client_cert and | ||
| 218 | + GOOGLE_API_USE_CLIENT_CERTIFICATE is set to an unexpected value.) | ||
| 219 | + """ | ||
| 220 | + # check if google-auth version supports should_use_client_cert for automatic mTLS enablement | ||
| 221 | + if hasattr(mtls, "should_use_client_cert"): # pragma: NO COVER | ||
| 222 | + return mtls.should_use_client_cert() | ||
| 223 | + else: # pragma: NO COVER | ||
| 224 | + # if unsupported, fallback to reading from env var | ||
| 225 | + use_client_cert_str = os.getenv( | ||
| 226 | + "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" | ||
| 227 | + ).lower() | ||
| 228 | + if use_client_cert_str not in ("true", "false"): | ||
| 229 | + raise ValueError( | ||
| 230 | + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be" | ||
| 231 | + " either `true` or `false`" | ||
| 232 | + ) | ||
| 233 | + return use_client_cert_str == "true" | ||
| 234 | + | ||
| 201 | 235 | @classmethod | |
| 202 | 236 | def from_service_account_info(cls, info: dict, *args, **kwargs): | |
| 203 | 237 | """Creates an instance of this client using the provided credentials | |
@@ -555,20 +589,16 @@ def get_mtls_endpoint_and_cert_source( | |||
| 555 | 589 | ) | |
| 556 | 590 | if client_options is None: | |
| 557 | 591 | client_options = client_options_lib.ClientOptions() | |
| 558 | - use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") | ||
| 592 | + use_client_cert = FirestoreAdminClient._use_client_cert_effective() | ||
| 559 | 593 | use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") | |
| 560 | - if use_client_cert not in ("true", "false"): | ||
| 561 | - raise ValueError( | ||
| 562 | - "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" | ||
| 563 | - ) | ||
| 564 | 594 | if use_mtls_endpoint not in ("auto", "never", "always"): | |
| 565 | 595 | raise MutualTLSChannelError( | |
| 566 | 596 | "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" | |
| 567 | 597 | ) | |
| 568 | 598 | ||
| 569 | 599 | # Figure out the client cert source to use. | |
| 570 | 600 | client_cert_source = None | |
| 571 | - if use_client_cert == "true": | ||
| 601 | + if use_client_cert: | ||
| 572 | 602 | if client_options.client_cert_source: | |
| 573 | 603 | client_cert_source = client_options.client_cert_source | |
| 574 | 604 | elif mtls.has_default_client_cert_source(): | |
@@ -600,20 +630,14 @@ def _read_environment_variables(): | |||
| 600 | 630 | google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT | |
| 601 | 631 | is not any of ["auto", "never", "always"]. | |
| 602 | 632 | """ | |
| 603 | - use_client_cert = os.getenv( | ||
| 604 | - "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" | ||
| 605 | - ).lower() | ||
| 633 | + use_client_cert = FirestoreAdminClient._use_client_cert_effective() | ||
| 606 | 634 | use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower() | |
| 607 | 635 | universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN") | |
| 608 | - if use_client_cert not in ("true", "false"): | ||
| 609 | - raise ValueError( | ||
| 610 | - "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" | ||
| 611 | - ) | ||
| 612 | 636 | if use_mtls_endpoint not in ("auto", "never", "always"): | |
| 613 | 637 | raise MutualTLSChannelError( | |
| 614 | 638 | "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" | |
| 615 | 639 | ) | |
| 616 | - return use_client_cert == "true", use_mtls_endpoint, universe_domain_env | ||
| 640 | + return use_client_cert, use_mtls_endpoint, universe_domain_env | ||
| 617 | 641 | ||
| 618 | 642 | @staticmethod | |
| 619 | 643 | def _get_client_cert_source(provided_cert_source, use_cert_flag): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,21 +13,26 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | - from google.api_core import gapic_v1 | ||
| 17 | - from google.api_core import retry as retries | ||
| 18 | - from google.api_core import retry_async as retries_async | ||
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 19 | + | ||
| 19 | 20 | from typing import ( | |
| 20 | 21 | Any, | |
| 21 | 22 | AsyncIterator, | |
| 22 | 23 | Awaitable, | |
| 23 | 24 | Callable, | |
| 25 | + Iterator, | ||
| 26 | + Optional, | ||
| 24 | 27 | Sequence, | |
| 25 | 28 | Tuple, | |
| 26 | - Optional, | ||
| 27 | - Iterator, | ||
| 28 | 29 | Union, | |
| 29 | 30 | ) | |
| 30 | 31 | ||
| 32 | + from google.api_core import gapic_v1 | ||
| 33 | + from google.api_core import retry as retries | ||
| 34 | + from google.api_core import retry_async as retries_async | ||
| 35 | + | ||
| 31 | 36 | try: | |
| 32 | 37 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] | |
| 33 | 38 | OptionalAsyncRetry = Union[ | |
@@ -37,9 +42,7 @@ | |||
| 37 | 42 | OptionalRetry = Union[retries.Retry, object, None] # type: ignore | |
| 38 | 43 | OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore | |
| 39 | 44 | ||
| 40 | - from google.cloud.firestore_admin_v1.types import field | ||
| 41 | - from google.cloud.firestore_admin_v1.types import firestore_admin | ||
| 42 | - from google.cloud.firestore_admin_v1.types import index | ||
| 45 | + from google.cloud.firestore_admin_v1.types import field, firestore_admin, index | ||
| 43 | 46 | ||
| 44 | 47 | ||
| 45 | 48 | class ListIndexesPager: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,6 @@ | |||
| 1 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 2 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 3 | + | ||
| 1 | 4 | ||
| 2 | 5 | transport inheritance structure | |
| 3 | 6 | _______________________________ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,15 +13,17 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 19 | + | ||
| 16 | 20 | from collections import OrderedDict | |
| 17 | 21 | from typing import Dict, Type | |
| 18 | 22 | ||
| 19 | 23 | from .base import FirestoreAdminTransport | |
| 20 | 24 | from .grpc import FirestoreAdminGrpcTransport | |
| 21 | 25 | from .grpc_asyncio import FirestoreAdminGrpcAsyncIOTransport | |
| 22 | - from .rest import FirestoreAdminRestTransport | ||
| 23 | - from .rest import FirestoreAdminRestInterceptor | ||
| 24 | - | ||
| 26 | + from .rest import FirestoreAdminRestInterceptor, FirestoreAdminRestTransport | ||
| 25 | 27 | ||
| 26 | 28 | # Compile a registry of transports. | |
| 27 | 29 | _transport_registry = OrderedDict() # type: Dict[str, Type[FirestoreAdminTransport]] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,32 +13,36 @@ | |||
| 13 | 13 | # See the License for the specific language governing permissions and | |
| 14 | 14 | # limitations under the License. | |
| 15 | 15 | # | |
| 16 | + | ||
| 17 | + # DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input` | ||
| 18 | + # The source of truth for this file is `.librarian/generator-input` | ||
| 19 | + | ||
| 16 | 20 | import abc | |
| 17 | 21 | from typing import Awaitable, Callable, Dict, Optional, Sequence, Union | |
| 18 | 22 | ||
| 19 | - from google.cloud.firestore_admin_v1 import gapic_version as package_version | ||
| 20 | - | ||
| 21 | - import google.auth # type: ignore | ||
| 22 | 23 | import google.api_core | |
| 23 | 24 | from google.api_core import exceptions as core_exceptions | |
| 24 | - from google.api_core import gapic_v1 | ||
| 25 | + from google.api_core import gapic_v1, operations_v1 | ||
| 25 | 26 | from google.api_core import retry as retries | |
| 26 | - from google.api_core import operations_v1 | ||
| 27 | + import google.auth # type: ignore | ||
| 27 | 28 | from google.auth import credentials as ga_credentials # type: ignore | |
| 29 | + from google.cloud.location import locations_pb2 # type: ignore | ||
| 30 | + from google.longrunning import operations_pb2 # type: ignore | ||
| 28 | 31 | from google.oauth2 import service_account # type: ignore | |
| 29 | 32 | import google.protobuf | |
| 33 | + from google.protobuf import empty_pb2 # type: ignore | ||
| 30 | 34 | ||
| 31 | - from google.cloud.firestore_admin_v1.types import backup | ||
| 32 | - from google.cloud.firestore_admin_v1.types import database | ||
| 33 | - from google.cloud.firestore_admin_v1.types import field | ||
| 34 | - from google.cloud.firestore_admin_v1.types import firestore_admin | ||
| 35 | - from google.cloud.firestore_admin_v1.types import index | ||
| 36 | - from google.cloud.firestore_admin_v1.types import schedule | ||
| 35 | + from google.cloud.firestore_admin_v1 import gapic_version as package_version | ||
| 36 | + from google.cloud.firestore_admin_v1.types import ( | ||
| 37 | + backup, | ||
| 38 | + database, | ||
| 39 | + field, | ||
| 40 | + firestore_admin, | ||
| 41 | + index, | ||
| 42 | + schedule, | ||
| 43 | + ) | ||
| 37 | 44 | from google.cloud.firestore_admin_v1.types import user_creds | |
| 38 | 45 | from google.cloud.firestore_admin_v1.types import user_creds as gfa_user_creds | |
| 39 | - from google.cloud.location import locations_pb2 # type: ignore | ||
| 40 | - from google.longrunning import operations_pb2 # type: ignore | ||
| 41 | - from google.protobuf import empty_pb2 # type: ignore | ||
| 42 | 46 | ||
| 43 | 47 | DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( | |
| 44 | 48 | gapic_version=package_version.__version__ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments