google-cloud-storagebatchoperations 0.3.0__tar.gz → 0.5.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.
Files changed (38) hide show
  1. {google_cloud_storagebatchoperations-0.3.0/google_cloud_storagebatchoperations.egg-info → google_cloud_storagebatchoperations-0.5.0}/PKG-INFO +1 -1
  2. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations/__init__.py +14 -0
  3. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations/gapic_version.py +1 -1
  4. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/__init__.py +15 -0
  5. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/gapic_metadata.json +30 -0
  6. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/gapic_version.py +1 -1
  7. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/async_client.py +268 -8
  8. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/client.py +274 -17
  9. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/pagers.py +164 -2
  10. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/transports/__init__.py +1 -3
  11. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/transports/base.py +52 -9
  12. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/transports/grpc.py +64 -6
  13. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/transports/grpc_asyncio.py +73 -5
  14. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/transports/rest.py +464 -36
  15. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/transports/rest_base.py +97 -1
  16. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/types/__init__.py +14 -0
  17. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/types/storage_batch_operations.py +107 -1
  18. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/types/storage_batch_operations_types.py +297 -2
  19. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0/google_cloud_storagebatchoperations.egg-info}/PKG-INFO +1 -1
  20. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py +2347 -486
  21. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/LICENSE +0 -0
  22. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/MANIFEST.in +0 -0
  23. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/README.rst +0 -0
  24. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations/py.typed +0 -0
  25. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/py.typed +0 -0
  26. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/__init__.py +0 -0
  27. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google/cloud/storagebatchoperations_v1/services/storage_batch_operations/__init__.py +0 -0
  28. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google_cloud_storagebatchoperations.egg-info/SOURCES.txt +0 -0
  29. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google_cloud_storagebatchoperations.egg-info/dependency_links.txt +0 -0
  30. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google_cloud_storagebatchoperations.egg-info/not-zip-safe +0 -0
  31. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google_cloud_storagebatchoperations.egg-info/requires.txt +0 -0
  32. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/google_cloud_storagebatchoperations.egg-info/top_level.txt +0 -0
  33. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/setup.cfg +0 -0
  34. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/setup.py +0 -0
  35. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/tests/__init__.py +0 -0
  36. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/tests/unit/__init__.py +0 -0
  37. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/tests/unit/gapic/__init__.py +0 -0
  38. {google_cloud_storagebatchoperations-0.3.0 → google_cloud_storagebatchoperations-0.5.0}/tests/unit/gapic/storagebatchoperations_v1/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-storagebatchoperations
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Google Cloud Storagebatchoperations API client library
5
5
  Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-storagebatchoperations
6
6
  Author: Google LLC
@@ -29,25 +29,32 @@ from google.cloud.storagebatchoperations_v1.types.storage_batch_operations impor
29
29
  CancelJobResponse,
30
30
  CreateJobRequest,
31
31
  DeleteJobRequest,
32
+ GetBucketOperationRequest,
32
33
  GetJobRequest,
34
+ ListBucketOperationsRequest,
35
+ ListBucketOperationsResponse,
33
36
  ListJobsRequest,
34
37
  ListJobsResponse,
35
38
  OperationMetadata,
36
39
  )
37
40
  from google.cloud.storagebatchoperations_v1.types.storage_batch_operations_types import (
38
41
  BucketList,
42
+ BucketOperation,
39
43
  Counters,
44
+ CustomContextUpdates,
40
45
  DeleteObject,
41
46
  ErrorLogEntry,
42
47
  ErrorSummary,
43
48
  Job,
44
49
  LoggingConfig,
45
50
  Manifest,
51
+ ObjectCustomContextPayload,
46
52
  ObjectRetention,
47
53
  PrefixList,
48
54
  PutMetadata,
49
55
  PutObjectHold,
50
56
  RewriteObject,
57
+ UpdateObjectCustomContext,
51
58
  )
52
59
 
53
60
  __all__ = (
@@ -57,21 +64,28 @@ __all__ = (
57
64
  "CancelJobResponse",
58
65
  "CreateJobRequest",
59
66
  "DeleteJobRequest",
67
+ "GetBucketOperationRequest",
60
68
  "GetJobRequest",
69
+ "ListBucketOperationsRequest",
70
+ "ListBucketOperationsResponse",
61
71
  "ListJobsRequest",
62
72
  "ListJobsResponse",
63
73
  "OperationMetadata",
64
74
  "BucketList",
75
+ "BucketOperation",
65
76
  "Counters",
77
+ "CustomContextUpdates",
66
78
  "DeleteObject",
67
79
  "ErrorLogEntry",
68
80
  "ErrorSummary",
69
81
  "Job",
70
82
  "LoggingConfig",
71
83
  "Manifest",
84
+ "ObjectCustomContextPayload",
72
85
  "ObjectRetention",
73
86
  "PrefixList",
74
87
  "PutMetadata",
75
88
  "PutObjectHold",
76
89
  "RewriteObject",
90
+ "UpdateObjectCustomContext",
77
91
  )
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.3.0" # {x-release-please-version}
16
+ __version__ = "0.5.0" # {x-release-please-version}
@@ -28,6 +28,7 @@ else: # pragma: NO COVER
28
28
  # this code path once we drop support for Python 3.7
29
29
  import importlib_metadata as metadata
30
30
 
31
+
31
32
  from .services.storage_batch_operations import (
32
33
  StorageBatchOperationsAsyncClient,
33
34
  StorageBatchOperationsClient,
@@ -37,25 +38,32 @@ from .types.storage_batch_operations import (
37
38
  CancelJobResponse,
38
39
  CreateJobRequest,
39
40
  DeleteJobRequest,
41
+ GetBucketOperationRequest,
40
42
  GetJobRequest,
43
+ ListBucketOperationsRequest,
44
+ ListBucketOperationsResponse,
41
45
  ListJobsRequest,
42
46
  ListJobsResponse,
43
47
  OperationMetadata,
44
48
  )
45
49
  from .types.storage_batch_operations_types import (
46
50
  BucketList,
51
+ BucketOperation,
47
52
  Counters,
53
+ CustomContextUpdates,
48
54
  DeleteObject,
49
55
  ErrorLogEntry,
50
56
  ErrorSummary,
51
57
  Job,
52
58
  LoggingConfig,
53
59
  Manifest,
60
+ ObjectCustomContextPayload,
54
61
  ObjectRetention,
55
62
  PrefixList,
56
63
  PutMetadata,
57
64
  PutObjectHold,
58
65
  RewriteObject,
66
+ UpdateObjectCustomContext,
59
67
  )
60
68
 
61
69
  if hasattr(api_core, "check_python_version") and hasattr(
@@ -155,20 +163,26 @@ else: # pragma: NO COVER
155
163
  __all__ = (
156
164
  "StorageBatchOperationsAsyncClient",
157
165
  "BucketList",
166
+ "BucketOperation",
158
167
  "CancelJobRequest",
159
168
  "CancelJobResponse",
160
169
  "Counters",
161
170
  "CreateJobRequest",
171
+ "CustomContextUpdates",
162
172
  "DeleteJobRequest",
163
173
  "DeleteObject",
164
174
  "ErrorLogEntry",
165
175
  "ErrorSummary",
176
+ "GetBucketOperationRequest",
166
177
  "GetJobRequest",
167
178
  "Job",
179
+ "ListBucketOperationsRequest",
180
+ "ListBucketOperationsResponse",
168
181
  "ListJobsRequest",
169
182
  "ListJobsResponse",
170
183
  "LoggingConfig",
171
184
  "Manifest",
185
+ "ObjectCustomContextPayload",
172
186
  "ObjectRetention",
173
187
  "OperationMetadata",
174
188
  "PrefixList",
@@ -176,4 +190,5 @@ __all__ = (
176
190
  "PutObjectHold",
177
191
  "RewriteObject",
178
192
  "StorageBatchOperationsClient",
193
+ "UpdateObjectCustomContext",
179
194
  )
@@ -25,11 +25,21 @@
25
25
  "delete_job"
26
26
  ]
27
27
  },
28
+ "GetBucketOperation": {
29
+ "methods": [
30
+ "get_bucket_operation"
31
+ ]
32
+ },
28
33
  "GetJob": {
29
34
  "methods": [
30
35
  "get_job"
31
36
  ]
32
37
  },
38
+ "ListBucketOperations": {
39
+ "methods": [
40
+ "list_bucket_operations"
41
+ ]
42
+ },
33
43
  "ListJobs": {
34
44
  "methods": [
35
45
  "list_jobs"
@@ -55,11 +65,21 @@
55
65
  "delete_job"
56
66
  ]
57
67
  },
68
+ "GetBucketOperation": {
69
+ "methods": [
70
+ "get_bucket_operation"
71
+ ]
72
+ },
58
73
  "GetJob": {
59
74
  "methods": [
60
75
  "get_job"
61
76
  ]
62
77
  },
78
+ "ListBucketOperations": {
79
+ "methods": [
80
+ "list_bucket_operations"
81
+ ]
82
+ },
63
83
  "ListJobs": {
64
84
  "methods": [
65
85
  "list_jobs"
@@ -85,11 +105,21 @@
85
105
  "delete_job"
86
106
  ]
87
107
  },
108
+ "GetBucketOperation": {
109
+ "methods": [
110
+ "get_bucket_operation"
111
+ ]
112
+ },
88
113
  "GetJob": {
89
114
  "methods": [
90
115
  "get_job"
91
116
  ]
92
117
  },
118
+ "ListBucketOperations": {
119
+ "methods": [
120
+ "list_bucket_operations"
121
+ ]
122
+ },
93
123
  "ListJobs": {
94
124
  "methods": [
95
125
  "list_jobs"
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.3.0" # {x-release-please-version}
16
+ __version__ = "0.5.0" # {x-release-please-version}
@@ -13,9 +13,9 @@
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
16
  import logging as std_logging
18
17
  import re
18
+ from collections import OrderedDict
19
19
  from typing import (
20
20
  Callable,
21
21
  Dict,
@@ -29,13 +29,13 @@ from typing import (
29
29
  Union,
30
30
  )
31
31
 
32
+ import google.protobuf
32
33
  from google.api_core import exceptions as core_exceptions
33
34
  from google.api_core import gapic_v1
34
35
  from google.api_core import retry_async as retries
35
36
  from google.api_core.client_options import ClientOptions
36
37
  from google.auth import credentials as ga_credentials # type: ignore
37
38
  from google.oauth2 import service_account # type: ignore
38
- import google.protobuf
39
39
 
40
40
  from google.cloud.storagebatchoperations_v1 import gapic_version as package_version
41
41
 
@@ -44,11 +44,11 @@ try:
44
44
  except AttributeError: # pragma: NO COVER
45
45
  OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
46
46
 
47
- from google.api_core import operation # type: ignore
48
- from google.api_core import operation_async # type: ignore
47
+ import google.api_core.operation as operation # type: ignore
48
+ import google.api_core.operation_async as operation_async # type: ignore
49
+ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
49
50
  from google.cloud.location import locations_pb2 # type: ignore
50
51
  from google.longrunning import operations_pb2 # type: ignore
51
- from google.protobuf import timestamp_pb2 # type: ignore
52
52
 
53
53
  from google.cloud.storagebatchoperations_v1.services.storage_batch_operations import (
54
54
  pagers,
@@ -89,6 +89,12 @@ class StorageBatchOperationsAsyncClient:
89
89
  _DEFAULT_ENDPOINT_TEMPLATE = StorageBatchOperationsClient._DEFAULT_ENDPOINT_TEMPLATE
90
90
  _DEFAULT_UNIVERSE = StorageBatchOperationsClient._DEFAULT_UNIVERSE
91
91
 
92
+ bucket_operation_path = staticmethod(
93
+ StorageBatchOperationsClient.bucket_operation_path
94
+ )
95
+ parse_bucket_operation_path = staticmethod(
96
+ StorageBatchOperationsClient.parse_bucket_operation_path
97
+ )
92
98
  crypto_key_path = staticmethod(StorageBatchOperationsClient.crypto_key_path)
93
99
  parse_crypto_key_path = staticmethod(
94
100
  StorageBatchOperationsClient.parse_crypto_key_path
@@ -135,7 +141,10 @@ class StorageBatchOperationsAsyncClient:
135
141
  Returns:
136
142
  StorageBatchOperationsAsyncClient: The constructed client.
137
143
  """
138
- return StorageBatchOperationsClient.from_service_account_info.__func__(StorageBatchOperationsAsyncClient, info, *args, **kwargs) # type: ignore
144
+ sa_info_func = (
145
+ StorageBatchOperationsClient.from_service_account_info.__func__ # type: ignore
146
+ )
147
+ return sa_info_func(StorageBatchOperationsAsyncClient, info, *args, **kwargs)
139
148
 
140
149
  @classmethod
141
150
  def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -151,7 +160,12 @@ class StorageBatchOperationsAsyncClient:
151
160
  Returns:
152
161
  StorageBatchOperationsAsyncClient: The constructed client.
153
162
  """
154
- return StorageBatchOperationsClient.from_service_account_file.__func__(StorageBatchOperationsAsyncClient, filename, *args, **kwargs) # type: ignore
163
+ sa_file_func = (
164
+ StorageBatchOperationsClient.from_service_account_file.__func__ # type: ignore
165
+ )
166
+ return sa_file_func(
167
+ StorageBatchOperationsAsyncClient, filename, *args, **kwargs
168
+ )
155
169
 
156
170
  from_service_account_json = from_service_account_file
157
171
 
@@ -189,7 +203,9 @@ class StorageBatchOperationsAsyncClient:
189
203
  Raises:
190
204
  google.auth.exceptions.MutualTLSChannelError: If any errors happen.
191
205
  """
192
- return StorageBatchOperationsClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
206
+ return StorageBatchOperationsClient.get_mtls_endpoint_and_cert_source(
207
+ client_options
208
+ ) # type: ignore
193
209
 
194
210
  @property
195
211
  def transport(self) -> StorageBatchOperationsTransport:
@@ -909,6 +925,250 @@ class StorageBatchOperationsAsyncClient:
909
925
  # Done; return the response.
910
926
  return response
911
927
 
928
+ async def list_bucket_operations(
929
+ self,
930
+ request: Optional[
931
+ Union[storage_batch_operations.ListBucketOperationsRequest, dict]
932
+ ] = None,
933
+ *,
934
+ parent: Optional[str] = None,
935
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
936
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
937
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
938
+ ) -> pagers.ListBucketOperationsAsyncPager:
939
+ r"""Lists BucketOperations in a given project and job.
940
+
941
+ .. code-block:: python
942
+
943
+ # This snippet has been automatically generated and should be regarded as a
944
+ # code template only.
945
+ # It will require modifications to work:
946
+ # - It may require correct/in-range values for request initialization.
947
+ # - It may require specifying regional endpoints when creating the service
948
+ # client as shown in:
949
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
950
+ from google.cloud import storagebatchoperations_v1
951
+
952
+ async def sample_list_bucket_operations():
953
+ # Create a client
954
+ client = storagebatchoperations_v1.StorageBatchOperationsAsyncClient()
955
+
956
+ # Initialize request argument(s)
957
+ request = storagebatchoperations_v1.ListBucketOperationsRequest(
958
+ parent="parent_value",
959
+ )
960
+
961
+ # Make the request
962
+ page_result = client.list_bucket_operations(request=request)
963
+
964
+ # Handle the response
965
+ async for response in page_result:
966
+ print(response)
967
+
968
+ Args:
969
+ request (Optional[Union[google.cloud.storagebatchoperations_v1.types.ListBucketOperationsRequest, dict]]):
970
+ The request object. Message for request to list
971
+ BucketOperations
972
+ parent (:class:`str`):
973
+ Required. Format:
974
+ projects/{project_id}/locations/global/jobs/{job_id}.
975
+
976
+ This corresponds to the ``parent`` field
977
+ on the ``request`` instance; if ``request`` is provided, this
978
+ should not be set.
979
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
980
+ should be retried.
981
+ timeout (float): The timeout for this request.
982
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
983
+ sent along with the request as metadata. Normally, each value must be of type `str`,
984
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
985
+ be of type `bytes`.
986
+
987
+ Returns:
988
+ google.cloud.storagebatchoperations_v1.services.storage_batch_operations.pagers.ListBucketOperationsAsyncPager:
989
+ Message for response to listing
990
+ BucketOperations
991
+ Iterating over this object will yield
992
+ results and resolve additional pages
993
+ automatically.
994
+
995
+ """
996
+ # Create or coerce a protobuf request object.
997
+ # - Quick check: If we got a request object, we should *not* have
998
+ # gotten any keyword arguments that map to the request.
999
+ flattened_params = [parent]
1000
+ has_flattened_params = (
1001
+ len([param for param in flattened_params if param is not None]) > 0
1002
+ )
1003
+ if request is not None and has_flattened_params:
1004
+ raise ValueError(
1005
+ "If the `request` argument is set, then none of "
1006
+ "the individual field arguments should be set."
1007
+ )
1008
+
1009
+ # - Use the request object if provided (there's no risk of modifying the input as
1010
+ # there are no flattened fields), or create one.
1011
+ if not isinstance(
1012
+ request, storage_batch_operations.ListBucketOperationsRequest
1013
+ ):
1014
+ request = storage_batch_operations.ListBucketOperationsRequest(request)
1015
+
1016
+ # If we have keyword arguments corresponding to fields on the
1017
+ # request, apply these.
1018
+ if parent is not None:
1019
+ request.parent = parent
1020
+
1021
+ # Wrap the RPC method; this adds retry and timeout information,
1022
+ # and friendly error handling.
1023
+ rpc = self._client._transport._wrapped_methods[
1024
+ self._client._transport.list_bucket_operations
1025
+ ]
1026
+
1027
+ # Certain fields should be provided within the metadata header;
1028
+ # add these here.
1029
+ metadata = tuple(metadata) + (
1030
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1031
+ )
1032
+
1033
+ # Validate the universe domain.
1034
+ self._client._validate_universe_domain()
1035
+
1036
+ # Send the request.
1037
+ response = await rpc(
1038
+ request,
1039
+ retry=retry,
1040
+ timeout=timeout,
1041
+ metadata=metadata,
1042
+ )
1043
+
1044
+ # This method is paged; wrap the response in a pager, which provides
1045
+ # an `__aiter__` convenience method.
1046
+ response = pagers.ListBucketOperationsAsyncPager(
1047
+ method=rpc,
1048
+ request=request,
1049
+ response=response,
1050
+ retry=retry,
1051
+ timeout=timeout,
1052
+ metadata=metadata,
1053
+ )
1054
+
1055
+ # Done; return the response.
1056
+ return response
1057
+
1058
+ async def get_bucket_operation(
1059
+ self,
1060
+ request: Optional[
1061
+ Union[storage_batch_operations.GetBucketOperationRequest, dict]
1062
+ ] = None,
1063
+ *,
1064
+ name: Optional[str] = None,
1065
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1066
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1067
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1068
+ ) -> storage_batch_operations_types.BucketOperation:
1069
+ r"""Gets a BucketOperation.
1070
+
1071
+ .. code-block:: python
1072
+
1073
+ # This snippet has been automatically generated and should be regarded as a
1074
+ # code template only.
1075
+ # It will require modifications to work:
1076
+ # - It may require correct/in-range values for request initialization.
1077
+ # - It may require specifying regional endpoints when creating the service
1078
+ # client as shown in:
1079
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1080
+ from google.cloud import storagebatchoperations_v1
1081
+
1082
+ async def sample_get_bucket_operation():
1083
+ # Create a client
1084
+ client = storagebatchoperations_v1.StorageBatchOperationsAsyncClient()
1085
+
1086
+ # Initialize request argument(s)
1087
+ request = storagebatchoperations_v1.GetBucketOperationRequest(
1088
+ name="name_value",
1089
+ )
1090
+
1091
+ # Make the request
1092
+ response = await client.get_bucket_operation(request=request)
1093
+
1094
+ # Handle the response
1095
+ print(response)
1096
+
1097
+ Args:
1098
+ request (Optional[Union[google.cloud.storagebatchoperations_v1.types.GetBucketOperationRequest, dict]]):
1099
+ The request object. Message for getting a
1100
+ BucketOperation.
1101
+ name (:class:`str`):
1102
+ Required. ``name`` of the bucket operation to retrieve.
1103
+ Format:
1104
+ projects/{project_id}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation_id}.
1105
+
1106
+ This corresponds to the ``name`` field
1107
+ on the ``request`` instance; if ``request`` is provided, this
1108
+ should not be set.
1109
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1110
+ should be retried.
1111
+ timeout (float): The timeout for this request.
1112
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1113
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1114
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1115
+ be of type `bytes`.
1116
+
1117
+ Returns:
1118
+ google.cloud.storagebatchoperations_v1.types.BucketOperation:
1119
+ BucketOperation represents a
1120
+ bucket-level breakdown of a Job.
1121
+
1122
+ """
1123
+ # Create or coerce a protobuf request object.
1124
+ # - Quick check: If we got a request object, we should *not* have
1125
+ # gotten any keyword arguments that map to the request.
1126
+ flattened_params = [name]
1127
+ has_flattened_params = (
1128
+ len([param for param in flattened_params if param is not None]) > 0
1129
+ )
1130
+ if request is not None and has_flattened_params:
1131
+ raise ValueError(
1132
+ "If the `request` argument is set, then none of "
1133
+ "the individual field arguments should be set."
1134
+ )
1135
+
1136
+ # - Use the request object if provided (there's no risk of modifying the input as
1137
+ # there are no flattened fields), or create one.
1138
+ if not isinstance(request, storage_batch_operations.GetBucketOperationRequest):
1139
+ request = storage_batch_operations.GetBucketOperationRequest(request)
1140
+
1141
+ # If we have keyword arguments corresponding to fields on the
1142
+ # request, apply these.
1143
+ if name is not None:
1144
+ request.name = name
1145
+
1146
+ # Wrap the RPC method; this adds retry and timeout information,
1147
+ # and friendly error handling.
1148
+ rpc = self._client._transport._wrapped_methods[
1149
+ self._client._transport.get_bucket_operation
1150
+ ]
1151
+
1152
+ # Certain fields should be provided within the metadata header;
1153
+ # add these here.
1154
+ metadata = tuple(metadata) + (
1155
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1156
+ )
1157
+
1158
+ # Validate the universe domain.
1159
+ self._client._validate_universe_domain()
1160
+
1161
+ # Send the request.
1162
+ response = await rpc(
1163
+ request,
1164
+ retry=retry,
1165
+ timeout=timeout,
1166
+ metadata=metadata,
1167
+ )
1168
+
1169
+ # Done; return the response.
1170
+ return response
1171
+
912
1172
  async def list_operations(
913
1173
  self,
914
1174
  request: Optional[operations_pb2.ListOperationsRequest] = None,