google-cloud-memorystore 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_cloud_memorystore-0.3.0/google_cloud_memorystore.egg-info → google_cloud_memorystore-0.4.0}/PKG-INFO +6 -8
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/README.rst +2 -2
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore/gapic_version.py +1 -1
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/__init__.py +1 -0
- {google_cloud_memorystore-0.3.0/google/cloud/memorystore_v1beta → google_cloud_memorystore-0.4.0/google/cloud/memorystore_v1}/gapic_version.py +1 -1
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/client.py +76 -51
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/pagers.py +3 -3
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/transports/base.py +23 -8
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/transports/rest.py +23 -23
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/types/memorystore.py +35 -17
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/__init__.py +1 -0
- {google_cloud_memorystore-0.3.0/google/cloud/memorystore_v1 → google_cloud_memorystore-0.4.0/google/cloud/memorystore_v1beta}/gapic_version.py +1 -1
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/client.py +76 -51
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/pagers.py +1 -1
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/base.py +23 -8
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/rest.py +16 -10
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/types/memorystore.py +13 -2
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0/google_cloud_memorystore.egg-info}/PKG-INFO +6 -8
- google_cloud_memorystore-0.4.0/google_cloud_memorystore.egg-info/requires.txt +11 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/setup.py +3 -5
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/unit/gapic/memorystore_v1/test_memorystore.py +298 -250
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/unit/gapic/memorystore_v1beta/test_memorystore.py +154 -126
- google_cloud_memorystore-0.3.0/google_cloud_memorystore.egg-info/requires.txt +0 -11
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/LICENSE +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/MANIFEST.in +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore/py.typed +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/gapic_metadata.json +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/py.typed +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/transports/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/services/memorystore/transports/rest_base.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1/types/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/gapic_metadata.json +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/py.typed +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/rest_base.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google/cloud/memorystore_v1beta/types/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google_cloud_memorystore.egg-info/SOURCES.txt +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google_cloud_memorystore.egg-info/dependency_links.txt +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google_cloud_memorystore.egg-info/not-zip-safe +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/google_cloud_memorystore.egg-info/top_level.txt +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/setup.cfg +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/unit/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/unit/gapic/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/unit/gapic/memorystore_v1/__init__.py +0 -0
- {google_cloud_memorystore-0.3.0 → google_cloud_memorystore-0.4.0}/tests/unit/gapic/memorystore_v1beta/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-memorystore
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Google Cloud Memorystore API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-memorystore
|
|
6
6
|
Author: Google LLC
|
|
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Programming Language :: Python
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -22,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
21
|
Classifier: Operating System :: OS Independent
|
|
24
22
|
Classifier: Topic :: Internet
|
|
25
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
26
24
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist: google-api-core[grpc]
|
|
25
|
+
Requires-Dist: google-api-core[grpc]<3.0.0,>=2.11.0
|
|
28
26
|
Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
|
|
29
27
|
Requires-Dist: grpcio<2.0.0,>=1.33.2
|
|
30
28
|
Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
|
|
31
29
|
Requires-Dist: proto-plus<2.0.0,>=1.22.3
|
|
32
30
|
Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
|
|
33
|
-
Requires-Dist: protobuf
|
|
31
|
+
Requires-Dist: protobuf<8.0.0,>=4.25.8
|
|
34
32
|
Dynamic: author
|
|
35
33
|
Dynamic: author-email
|
|
36
34
|
Dynamic: classifier
|
|
@@ -106,14 +104,14 @@ Supported Python Versions
|
|
|
106
104
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
107
105
|
Python.
|
|
108
106
|
|
|
109
|
-
Python >= 3.
|
|
107
|
+
Python >= 3.9, including 3.14
|
|
110
108
|
|
|
111
109
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
112
110
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
113
111
|
|
|
114
112
|
Unsupported Python Versions
|
|
115
113
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
116
|
-
Python <= 3.
|
|
114
|
+
Python <= 3.8
|
|
117
115
|
|
|
118
116
|
If you are using an `end-of-life`_
|
|
119
117
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
|
@@ -61,14 +61,14 @@ Supported Python Versions
|
|
|
61
61
|
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
|
|
62
62
|
Python.
|
|
63
63
|
|
|
64
|
-
Python >= 3.
|
|
64
|
+
Python >= 3.9, including 3.14
|
|
65
65
|
|
|
66
66
|
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
|
|
67
67
|
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
|
|
68
68
|
|
|
69
69
|
Unsupported Python Versions
|
|
70
70
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
71
|
-
Python <= 3.
|
|
71
|
+
Python <= 3.8
|
|
72
72
|
|
|
73
73
|
If you are using an `end-of-life`_
|
|
74
74
|
version of Python, we recommend that you update as soon as possible to an actively supported version.
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
|
-
from collections import OrderedDict
|
|
17
|
-
from http import HTTPStatus
|
|
18
16
|
import json
|
|
19
17
|
import logging as std_logging
|
|
20
18
|
import os
|
|
21
19
|
import re
|
|
20
|
+
import warnings
|
|
21
|
+
from collections import OrderedDict
|
|
22
|
+
from http import HTTPStatus
|
|
22
23
|
from typing import (
|
|
23
24
|
Callable,
|
|
24
25
|
Dict,
|
|
@@ -32,8 +33,8 @@ from typing import (
|
|
|
32
33
|
Union,
|
|
33
34
|
cast,
|
|
34
35
|
)
|
|
35
|
-
import warnings
|
|
36
36
|
|
|
37
|
+
import google.protobuf
|
|
37
38
|
from google.api_core import client_options as client_options_lib
|
|
38
39
|
from google.api_core import exceptions as core_exceptions
|
|
39
40
|
from google.api_core import gapic_v1
|
|
@@ -43,7 +44,6 @@ from google.auth.exceptions import MutualTLSChannelError # type: ignore
|
|
|
43
44
|
from google.auth.transport import mtls # type: ignore
|
|
44
45
|
from google.auth.transport.grpc import SslCredentials # type: ignore
|
|
45
46
|
from google.oauth2 import service_account # type: ignore
|
|
46
|
-
import google.protobuf
|
|
47
47
|
|
|
48
48
|
from google.cloud.memorystore_v1 import gapic_version as package_version
|
|
49
49
|
|
|
@@ -61,13 +61,13 @@ except ImportError: # pragma: NO COVER
|
|
|
61
61
|
|
|
62
62
|
_LOGGER = std_logging.getLogger(__name__)
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
import google.api_core.operation as operation # type: ignore
|
|
65
|
+
import google.api_core.operation_async as operation_async # type: ignore
|
|
66
|
+
import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
|
|
67
|
+
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
|
|
68
|
+
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
|
|
66
69
|
from google.cloud.location import locations_pb2 # type: ignore
|
|
67
70
|
from google.longrunning import operations_pb2 # type: ignore
|
|
68
|
-
from google.protobuf import empty_pb2 # type: ignore
|
|
69
|
-
from google.protobuf import field_mask_pb2 # type: ignore
|
|
70
|
-
from google.protobuf import timestamp_pb2 # type: ignore
|
|
71
71
|
|
|
72
72
|
from google.cloud.memorystore_v1.services.memorystore import pagers
|
|
73
73
|
from google.cloud.memorystore_v1.types import memorystore
|
|
@@ -113,7 +113,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
113
113
|
"""Service describing handlers for resources"""
|
|
114
114
|
|
|
115
115
|
@staticmethod
|
|
116
|
-
def _get_default_mtls_endpoint(api_endpoint):
|
|
116
|
+
def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
|
|
117
117
|
"""Converts api endpoint to mTLS endpoint.
|
|
118
118
|
|
|
119
119
|
Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
|
|
@@ -121,7 +121,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
121
121
|
Args:
|
|
122
122
|
api_endpoint (Optional[str]): the api endpoint to convert.
|
|
123
123
|
Returns:
|
|
124
|
-
str: converted mTLS api endpoint.
|
|
124
|
+
Optional[str]: converted mTLS api endpoint.
|
|
125
125
|
"""
|
|
126
126
|
if not api_endpoint:
|
|
127
127
|
return api_endpoint
|
|
@@ -131,6 +131,10 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
m = mtls_endpoint_re.match(api_endpoint)
|
|
134
|
+
if m is None:
|
|
135
|
+
# Could not parse api_endpoint; return as-is.
|
|
136
|
+
return api_endpoint
|
|
137
|
+
|
|
134
138
|
name, mtls, sandbox, googledomain = m.groups()
|
|
135
139
|
if mtls or not googledomain:
|
|
136
140
|
return api_endpoint
|
|
@@ -619,7 +623,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
619
623
|
@staticmethod
|
|
620
624
|
def _get_api_endpoint(
|
|
621
625
|
api_override, client_cert_source, universe_domain, use_mtls_endpoint
|
|
622
|
-
):
|
|
626
|
+
) -> str:
|
|
623
627
|
"""Return the API endpoint used by the client.
|
|
624
628
|
|
|
625
629
|
Args:
|
|
@@ -716,7 +720,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
716
720
|
error._details.append(json.dumps(cred_info))
|
|
717
721
|
|
|
718
722
|
@property
|
|
719
|
-
def api_endpoint(self):
|
|
723
|
+
def api_endpoint(self) -> str:
|
|
720
724
|
"""Return the API endpoint used by the client instance.
|
|
721
725
|
|
|
722
726
|
Returns:
|
|
@@ -803,18 +807,16 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
803
807
|
|
|
804
808
|
universe_domain_opt = getattr(self._client_options, "universe_domain", None)
|
|
805
809
|
|
|
806
|
-
(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
self._universe_domain_env,
|
|
810
|
-
) = MemorystoreClient._read_environment_variables()
|
|
810
|
+
self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
|
|
811
|
+
MemorystoreClient._read_environment_variables()
|
|
812
|
+
)
|
|
811
813
|
self._client_cert_source = MemorystoreClient._get_client_cert_source(
|
|
812
814
|
self._client_options.client_cert_source, self._use_client_cert
|
|
813
815
|
)
|
|
814
816
|
self._universe_domain = MemorystoreClient._get_universe_domain(
|
|
815
817
|
universe_domain_opt, self._universe_domain_env
|
|
816
818
|
)
|
|
817
|
-
self._api_endpoint =
|
|
819
|
+
self._api_endpoint: str = "" # updated below, depending on `transport`
|
|
818
820
|
|
|
819
821
|
# Initialize the universe domain validation.
|
|
820
822
|
self._is_universe_domain_valid = False
|
|
@@ -842,8 +844,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
842
844
|
)
|
|
843
845
|
if self._client_options.scopes:
|
|
844
846
|
raise ValueError(
|
|
845
|
-
"When providing a transport instance, provide its scopes "
|
|
846
|
-
"directly."
|
|
847
|
+
"When providing a transport instance, provide its scopes directly."
|
|
847
848
|
)
|
|
848
849
|
self._transport = cast(MemorystoreTransport, transport)
|
|
849
850
|
self._api_endpoint = self._transport.host
|
|
@@ -2657,7 +2658,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2657
2658
|
|
|
2658
2659
|
def list_operations(
|
|
2659
2660
|
self,
|
|
2660
|
-
request: Optional[operations_pb2.ListOperationsRequest] = None,
|
|
2661
|
+
request: Optional[Union[operations_pb2.ListOperationsRequest, dict]] = None,
|
|
2661
2662
|
*,
|
|
2662
2663
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2663
2664
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2683,8 +2684,12 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2683
2684
|
# Create or coerce a protobuf request object.
|
|
2684
2685
|
# The request isn't a proto-plus wrapped type,
|
|
2685
2686
|
# so it must be constructed via keyword expansion.
|
|
2686
|
-
if
|
|
2687
|
-
|
|
2687
|
+
if request is None:
|
|
2688
|
+
request_pb = operations_pb2.ListOperationsRequest()
|
|
2689
|
+
elif isinstance(request, dict):
|
|
2690
|
+
request_pb = operations_pb2.ListOperationsRequest(**request)
|
|
2691
|
+
else:
|
|
2692
|
+
request_pb = request
|
|
2688
2693
|
|
|
2689
2694
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2690
2695
|
# and friendly error handling.
|
|
@@ -2693,7 +2698,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2693
2698
|
# Certain fields should be provided within the metadata header;
|
|
2694
2699
|
# add these here.
|
|
2695
2700
|
metadata = tuple(metadata) + (
|
|
2696
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2701
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2697
2702
|
)
|
|
2698
2703
|
|
|
2699
2704
|
# Validate the universe domain.
|
|
@@ -2702,7 +2707,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2702
2707
|
try:
|
|
2703
2708
|
# Send the request.
|
|
2704
2709
|
response = rpc(
|
|
2705
|
-
|
|
2710
|
+
request_pb,
|
|
2706
2711
|
retry=retry,
|
|
2707
2712
|
timeout=timeout,
|
|
2708
2713
|
metadata=metadata,
|
|
@@ -2716,7 +2721,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2716
2721
|
|
|
2717
2722
|
def get_operation(
|
|
2718
2723
|
self,
|
|
2719
|
-
request: Optional[operations_pb2.GetOperationRequest] = None,
|
|
2724
|
+
request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
|
|
2720
2725
|
*,
|
|
2721
2726
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2722
2727
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2742,8 +2747,12 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2742
2747
|
# Create or coerce a protobuf request object.
|
|
2743
2748
|
# The request isn't a proto-plus wrapped type,
|
|
2744
2749
|
# so it must be constructed via keyword expansion.
|
|
2745
|
-
if
|
|
2746
|
-
|
|
2750
|
+
if request is None:
|
|
2751
|
+
request_pb = operations_pb2.GetOperationRequest()
|
|
2752
|
+
elif isinstance(request, dict):
|
|
2753
|
+
request_pb = operations_pb2.GetOperationRequest(**request)
|
|
2754
|
+
else:
|
|
2755
|
+
request_pb = request
|
|
2747
2756
|
|
|
2748
2757
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2749
2758
|
# and friendly error handling.
|
|
@@ -2752,7 +2761,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2752
2761
|
# Certain fields should be provided within the metadata header;
|
|
2753
2762
|
# add these here.
|
|
2754
2763
|
metadata = tuple(metadata) + (
|
|
2755
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2764
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2756
2765
|
)
|
|
2757
2766
|
|
|
2758
2767
|
# Validate the universe domain.
|
|
@@ -2761,7 +2770,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2761
2770
|
try:
|
|
2762
2771
|
# Send the request.
|
|
2763
2772
|
response = rpc(
|
|
2764
|
-
|
|
2773
|
+
request_pb,
|
|
2765
2774
|
retry=retry,
|
|
2766
2775
|
timeout=timeout,
|
|
2767
2776
|
metadata=metadata,
|
|
@@ -2775,7 +2784,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2775
2784
|
|
|
2776
2785
|
def delete_operation(
|
|
2777
2786
|
self,
|
|
2778
|
-
request: Optional[operations_pb2.DeleteOperationRequest] = None,
|
|
2787
|
+
request: Optional[Union[operations_pb2.DeleteOperationRequest, dict]] = None,
|
|
2779
2788
|
*,
|
|
2780
2789
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2781
2790
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2805,8 +2814,12 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2805
2814
|
# Create or coerce a protobuf request object.
|
|
2806
2815
|
# The request isn't a proto-plus wrapped type,
|
|
2807
2816
|
# so it must be constructed via keyword expansion.
|
|
2808
|
-
if
|
|
2809
|
-
|
|
2817
|
+
if request is None:
|
|
2818
|
+
request_pb = operations_pb2.DeleteOperationRequest()
|
|
2819
|
+
elif isinstance(request, dict):
|
|
2820
|
+
request_pb = operations_pb2.DeleteOperationRequest(**request)
|
|
2821
|
+
else:
|
|
2822
|
+
request_pb = request
|
|
2810
2823
|
|
|
2811
2824
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2812
2825
|
# and friendly error handling.
|
|
@@ -2815,7 +2828,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2815
2828
|
# Certain fields should be provided within the metadata header;
|
|
2816
2829
|
# add these here.
|
|
2817
2830
|
metadata = tuple(metadata) + (
|
|
2818
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2831
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2819
2832
|
)
|
|
2820
2833
|
|
|
2821
2834
|
# Validate the universe domain.
|
|
@@ -2823,7 +2836,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2823
2836
|
|
|
2824
2837
|
# Send the request.
|
|
2825
2838
|
rpc(
|
|
2826
|
-
|
|
2839
|
+
request_pb,
|
|
2827
2840
|
retry=retry,
|
|
2828
2841
|
timeout=timeout,
|
|
2829
2842
|
metadata=metadata,
|
|
@@ -2831,7 +2844,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2831
2844
|
|
|
2832
2845
|
def cancel_operation(
|
|
2833
2846
|
self,
|
|
2834
|
-
request: Optional[operations_pb2.CancelOperationRequest] = None,
|
|
2847
|
+
request: Optional[Union[operations_pb2.CancelOperationRequest, dict]] = None,
|
|
2835
2848
|
*,
|
|
2836
2849
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2837
2850
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2860,8 +2873,12 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2860
2873
|
# Create or coerce a protobuf request object.
|
|
2861
2874
|
# The request isn't a proto-plus wrapped type,
|
|
2862
2875
|
# so it must be constructed via keyword expansion.
|
|
2863
|
-
if
|
|
2864
|
-
|
|
2876
|
+
if request is None:
|
|
2877
|
+
request_pb = operations_pb2.CancelOperationRequest()
|
|
2878
|
+
elif isinstance(request, dict):
|
|
2879
|
+
request_pb = operations_pb2.CancelOperationRequest(**request)
|
|
2880
|
+
else:
|
|
2881
|
+
request_pb = request
|
|
2865
2882
|
|
|
2866
2883
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2867
2884
|
# and friendly error handling.
|
|
@@ -2870,7 +2887,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2870
2887
|
# Certain fields should be provided within the metadata header;
|
|
2871
2888
|
# add these here.
|
|
2872
2889
|
metadata = tuple(metadata) + (
|
|
2873
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2890
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2874
2891
|
)
|
|
2875
2892
|
|
|
2876
2893
|
# Validate the universe domain.
|
|
@@ -2878,7 +2895,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2878
2895
|
|
|
2879
2896
|
# Send the request.
|
|
2880
2897
|
rpc(
|
|
2881
|
-
|
|
2898
|
+
request_pb,
|
|
2882
2899
|
retry=retry,
|
|
2883
2900
|
timeout=timeout,
|
|
2884
2901
|
metadata=metadata,
|
|
@@ -2886,7 +2903,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2886
2903
|
|
|
2887
2904
|
def get_location(
|
|
2888
2905
|
self,
|
|
2889
|
-
request: Optional[locations_pb2.GetLocationRequest] = None,
|
|
2906
|
+
request: Optional[Union[locations_pb2.GetLocationRequest, dict]] = None,
|
|
2890
2907
|
*,
|
|
2891
2908
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2892
2909
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2912,8 +2929,12 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2912
2929
|
# Create or coerce a protobuf request object.
|
|
2913
2930
|
# The request isn't a proto-plus wrapped type,
|
|
2914
2931
|
# so it must be constructed via keyword expansion.
|
|
2915
|
-
if
|
|
2916
|
-
|
|
2932
|
+
if request is None:
|
|
2933
|
+
request_pb = locations_pb2.GetLocationRequest()
|
|
2934
|
+
elif isinstance(request, dict):
|
|
2935
|
+
request_pb = locations_pb2.GetLocationRequest(**request)
|
|
2936
|
+
else:
|
|
2937
|
+
request_pb = request
|
|
2917
2938
|
|
|
2918
2939
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2919
2940
|
# and friendly error handling.
|
|
@@ -2922,7 +2943,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2922
2943
|
# Certain fields should be provided within the metadata header;
|
|
2923
2944
|
# add these here.
|
|
2924
2945
|
metadata = tuple(metadata) + (
|
|
2925
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
2946
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2926
2947
|
)
|
|
2927
2948
|
|
|
2928
2949
|
# Validate the universe domain.
|
|
@@ -2931,7 +2952,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2931
2952
|
try:
|
|
2932
2953
|
# Send the request.
|
|
2933
2954
|
response = rpc(
|
|
2934
|
-
|
|
2955
|
+
request_pb,
|
|
2935
2956
|
retry=retry,
|
|
2936
2957
|
timeout=timeout,
|
|
2937
2958
|
metadata=metadata,
|
|
@@ -2945,7 +2966,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2945
2966
|
|
|
2946
2967
|
def list_locations(
|
|
2947
2968
|
self,
|
|
2948
|
-
request: Optional[locations_pb2.ListLocationsRequest] = None,
|
|
2969
|
+
request: Optional[Union[locations_pb2.ListLocationsRequest, dict]] = None,
|
|
2949
2970
|
*,
|
|
2950
2971
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2951
2972
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
@@ -2971,8 +2992,12 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2971
2992
|
# Create or coerce a protobuf request object.
|
|
2972
2993
|
# The request isn't a proto-plus wrapped type,
|
|
2973
2994
|
# so it must be constructed via keyword expansion.
|
|
2974
|
-
if
|
|
2975
|
-
|
|
2995
|
+
if request is None:
|
|
2996
|
+
request_pb = locations_pb2.ListLocationsRequest()
|
|
2997
|
+
elif isinstance(request, dict):
|
|
2998
|
+
request_pb = locations_pb2.ListLocationsRequest(**request)
|
|
2999
|
+
else:
|
|
3000
|
+
request_pb = request
|
|
2976
3001
|
|
|
2977
3002
|
# Wrap the RPC method; this adds retry and timeout information,
|
|
2978
3003
|
# and friendly error handling.
|
|
@@ -2981,7 +3006,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2981
3006
|
# Certain fields should be provided within the metadata header;
|
|
2982
3007
|
# add these here.
|
|
2983
3008
|
metadata = tuple(metadata) + (
|
|
2984
|
-
gapic_v1.routing_header.to_grpc_metadata((("name",
|
|
3009
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
|
|
2985
3010
|
)
|
|
2986
3011
|
|
|
2987
3012
|
# Validate the universe domain.
|
|
@@ -2990,7 +3015,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
2990
3015
|
try:
|
|
2991
3016
|
# Send the request.
|
|
2992
3017
|
response = rpc(
|
|
2993
|
-
|
|
3018
|
+
request_pb,
|
|
2994
3019
|
retry=retry,
|
|
2995
3020
|
timeout=timeout,
|
|
2996
3021
|
metadata=metadata,
|
|
@@ -67,7 +67,7 @@ class ListInstancesPager:
|
|
|
67
67
|
*,
|
|
68
68
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
69
69
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
70
|
-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
|
|
70
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
71
71
|
):
|
|
72
72
|
"""Instantiate the pager.
|
|
73
73
|
|
|
@@ -143,7 +143,7 @@ class ListBackupCollectionsPager:
|
|
|
143
143
|
*,
|
|
144
144
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
145
145
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
146
|
-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
|
|
146
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
147
147
|
):
|
|
148
148
|
"""Instantiate the pager.
|
|
149
149
|
|
|
@@ -219,7 +219,7 @@ class ListBackupsPager:
|
|
|
219
219
|
*,
|
|
220
220
|
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
221
221
|
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
222
|
-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
|
|
222
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
223
223
|
):
|
|
224
224
|
"""Instantiate the pager.
|
|
225
225
|
|
|
@@ -17,15 +17,15 @@ import abc
|
|
|
17
17
|
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
|
|
18
18
|
|
|
19
19
|
import google.api_core
|
|
20
|
+
import google.auth # type: ignore
|
|
21
|
+
import google.protobuf
|
|
20
22
|
from google.api_core import exceptions as core_exceptions
|
|
21
23
|
from google.api_core import gapic_v1, operations_v1
|
|
22
24
|
from google.api_core import retry as retries
|
|
23
|
-
import google.auth # type: ignore
|
|
24
25
|
from google.auth import credentials as ga_credentials # type: ignore
|
|
25
26
|
from google.cloud.location import locations_pb2 # type: ignore
|
|
26
27
|
from google.longrunning import operations_pb2 # type: ignore
|
|
27
28
|
from google.oauth2 import service_account # type: ignore
|
|
28
|
-
import google.protobuf
|
|
29
29
|
|
|
30
30
|
from google.cloud.memorystore_v1 import gapic_version as package_version
|
|
31
31
|
from google.cloud.memorystore_v1.types import memorystore
|
|
@@ -82,10 +82,12 @@ class MemorystoreTransport(abc.ABC):
|
|
|
82
82
|
your own client library.
|
|
83
83
|
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
|
|
84
84
|
be used for service account credentials.
|
|
85
|
+
api_audience (Optional[str]): The intended audience for the API calls
|
|
86
|
+
to the service that will be set when using certain 3rd party
|
|
87
|
+
authentication flows. Audience is typically a resource identifier.
|
|
88
|
+
If not set, the host value will be used as a default.
|
|
85
89
|
"""
|
|
86
90
|
|
|
87
|
-
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
|
|
88
|
-
|
|
89
91
|
# Save the scopes.
|
|
90
92
|
self._scopes = scopes
|
|
91
93
|
if not hasattr(self, "_ignore_credentials"):
|
|
@@ -100,11 +102,16 @@ class MemorystoreTransport(abc.ABC):
|
|
|
100
102
|
|
|
101
103
|
if credentials_file is not None:
|
|
102
104
|
credentials, _ = google.auth.load_credentials_from_file(
|
|
103
|
-
credentials_file,
|
|
105
|
+
credentials_file,
|
|
106
|
+
scopes=scopes,
|
|
107
|
+
quota_project_id=quota_project_id,
|
|
108
|
+
default_scopes=self.AUTH_SCOPES,
|
|
104
109
|
)
|
|
105
110
|
elif credentials is None and not self._ignore_credentials:
|
|
106
111
|
credentials, _ = google.auth.default(
|
|
107
|
-
|
|
112
|
+
scopes=scopes,
|
|
113
|
+
quota_project_id=quota_project_id,
|
|
114
|
+
default_scopes=self.AUTH_SCOPES,
|
|
108
115
|
)
|
|
109
116
|
# Don't apply audience if the credentials file passed from user.
|
|
110
117
|
if hasattr(credentials, "with_gdch_audience"):
|
|
@@ -128,6 +135,8 @@ class MemorystoreTransport(abc.ABC):
|
|
|
128
135
|
host += ":443"
|
|
129
136
|
self._host = host
|
|
130
137
|
|
|
138
|
+
self._wrapped_methods: Dict[Callable, Callable] = {}
|
|
139
|
+
|
|
131
140
|
@property
|
|
132
141
|
def host(self):
|
|
133
142
|
return self._host
|
|
@@ -439,13 +448,19 @@ class MemorystoreTransport(abc.ABC):
|
|
|
439
448
|
@property
|
|
440
449
|
def cancel_operation(
|
|
441
450
|
self,
|
|
442
|
-
) -> Callable[
|
|
451
|
+
) -> Callable[
|
|
452
|
+
[operations_pb2.CancelOperationRequest],
|
|
453
|
+
None,
|
|
454
|
+
]:
|
|
443
455
|
raise NotImplementedError()
|
|
444
456
|
|
|
445
457
|
@property
|
|
446
458
|
def delete_operation(
|
|
447
459
|
self,
|
|
448
|
-
) -> Callable[
|
|
460
|
+
) -> Callable[
|
|
461
|
+
[operations_pb2.DeleteOperationRequest],
|
|
462
|
+
None,
|
|
463
|
+
]:
|
|
449
464
|
raise NotImplementedError()
|
|
450
465
|
|
|
451
466
|
@property
|