diff --git a/google/cloud/storage_v2/__init__.py b/google/cloud/_storage_v2/__init__.py similarity index 98% rename from google/cloud/storage_v2/__init__.py rename to google/cloud/_storage_v2/__init__.py index 4d03ee922..de9735f8d 100644 --- a/google/cloud/storage_v2/__init__.py +++ b/google/cloud/_storage_v2/__init__.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from google.cloud.storage_v2 import gapic_version as package_version +from google.cloud._storage_v2 import gapic_version as package_version __version__ = package_version.__version__ diff --git a/google/cloud/storage_v2/gapic_metadata.json b/google/cloud/_storage_v2/gapic_metadata.json similarity index 100% rename from google/cloud/storage_v2/gapic_metadata.json rename to google/cloud/_storage_v2/gapic_metadata.json diff --git a/google/cloud/storage_v2/gapic_version.py b/google/cloud/_storage_v2/gapic_version.py similarity index 100% rename from google/cloud/storage_v2/gapic_version.py rename to google/cloud/_storage_v2/gapic_version.py diff --git a/google/cloud/storage_v2/py.typed b/google/cloud/_storage_v2/py.typed similarity index 100% rename from google/cloud/storage_v2/py.typed rename to google/cloud/_storage_v2/py.typed diff --git a/google/cloud/storage_v2/services/__init__.py b/google/cloud/_storage_v2/services/__init__.py similarity index 100% rename from google/cloud/storage_v2/services/__init__.py rename to google/cloud/_storage_v2/services/__init__.py diff --git a/google/cloud/storage_v2/services/storage/__init__.py b/google/cloud/_storage_v2/services/storage/__init__.py similarity index 100% rename from google/cloud/storage_v2/services/storage/__init__.py rename to google/cloud/_storage_v2/services/storage/__init__.py diff --git a/google/cloud/storage_v2/services/storage/async_client.py b/google/cloud/_storage_v2/services/storage/async_client.py similarity index 97% rename from google/cloud/storage_v2/services/storage/async_client.py rename to google/cloud/_storage_v2/services/storage/async_client.py index 81290e8aa..55234cd28 100644 --- a/google/cloud/storage_v2/services/storage/async_client.py +++ b/google/cloud/_storage_v2/services/storage/async_client.py @@ -32,7 +32,7 @@ Union, ) -from google.cloud.storage_v2 import gapic_version as package_version +from google.cloud._storage_v2 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -48,8 +48,8 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.cloud.storage_v2.services.storage import pagers -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.services.storage import pagers +from google.cloud._storage_v2.types import storage from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -350,7 +350,7 @@ async def sample_delete_bucket(): await client.delete_bucket(request=request) Args: - request (Optional[Union[google.cloud.storage_v2.types.DeleteBucketRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.DeleteBucketRequest, dict]]): The request object. Request message for DeleteBucket. name (:class:`str`): Required. Name of a bucket to delete. @@ -455,7 +455,7 @@ async def sample_get_bucket(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.GetBucketRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.GetBucketRequest, dict]]): The request object. Request message for GetBucket. name (:class:`str`): Required. Name of a bucket. @@ -471,7 +471,7 @@ async def sample_get_bucket(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -570,7 +570,7 @@ async def sample_create_bucket(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.CreateBucketRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.CreateBucketRequest, dict]]): The request object. Request message for CreateBucket. parent (:class:`str`): Required. The project to which this bucket will belong. @@ -581,7 +581,7 @@ async def sample_create_bucket(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - bucket (:class:`google.cloud.storage_v2.types.Bucket`): + bucket (:class:`google.cloud._storage_v2.types.Bucket`): Optional. Properties of the new bucket being inserted. The name of the bucket is specified in the ``bucket_id`` field. Populating ``bucket.name`` field will result in @@ -613,7 +613,7 @@ async def sample_create_bucket(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -719,7 +719,7 @@ async def sample_list_buckets(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.ListBucketsRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.ListBucketsRequest, dict]]): The request object. Request message for ListBuckets. parent (:class:`str`): Required. The project whose buckets @@ -737,7 +737,7 @@ async def sample_list_buckets(): be of type `bytes`. Returns: - google.cloud.storage_v2.services.storage.pagers.ListBucketsAsyncPager: + google.cloud._storage_v2.services.storage.pagers.ListBucketsAsyncPager: The result of a call to Buckets.ListBuckets Iterating over this object will yield @@ -850,7 +850,7 @@ async def sample_lock_bucket_retention_policy(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.LockBucketRetentionPolicyRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.LockBucketRetentionPolicyRequest, dict]]): The request object. Request message for LockBucketRetentionPolicyRequest. bucket (:class:`str`): @@ -867,7 +867,7 @@ async def sample_lock_bucket_retention_policy(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -1422,9 +1422,9 @@ async def sample_update_bucket(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.UpdateBucketRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.UpdateBucketRequest, dict]]): The request object. Request for UpdateBucket method. - bucket (:class:`google.cloud.storage_v2.types.Bucket`): + bucket (:class:`google.cloud._storage_v2.types.Bucket`): Required. The bucket to update. The bucket's ``name`` field will be used to identify the bucket. @@ -1455,7 +1455,7 @@ async def sample_update_bucket(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -1552,7 +1552,7 @@ async def sample_compose_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.ComposeObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.ComposeObjectRequest, dict]]): The request object. Request message for ComposeObject. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. @@ -1563,7 +1563,7 @@ async def sample_compose_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -1663,7 +1663,7 @@ async def sample_delete_object(): await client.delete_object(request=request) Args: - request (Optional[Union[google.cloud.storage_v2.types.DeleteObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.DeleteObjectRequest, dict]]): The request object. Message for deleting an object. ``bucket`` and ``object`` **must** be set. bucket (:class:`str`): @@ -1796,7 +1796,7 @@ async def sample_restore_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.RestoreObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.RestoreObjectRequest, dict]]): The request object. Message for restoring an object. ``bucket``, ``object``, and ``generation`` **must** be set. bucket (:class:`str`): @@ -1829,7 +1829,7 @@ async def sample_restore_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -1937,7 +1937,7 @@ async def sample_cancel_resumable_write(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.CancelResumableWriteRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.CancelResumableWriteRequest, dict]]): The request object. Message for canceling an in-progress resumable upload. ``upload_id`` **must** be set. upload_id (:class:`str`): @@ -1957,7 +1957,7 @@ async def sample_cancel_resumable_write(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.CancelResumableWriteResponse: + google.cloud._storage_v2.types.CancelResumableWriteResponse: Empty response message for canceling an in-progress resumable upload, will be extended as needed. @@ -2068,7 +2068,7 @@ async def sample_get_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.GetObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.GetObjectRequest, dict]]): The request object. Request message for GetObject. bucket (:class:`str`): Required. Name of the bucket in which @@ -2100,7 +2100,7 @@ async def sample_get_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -2210,7 +2210,7 @@ async def sample_read_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.ReadObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.ReadObjectRequest, dict]]): The request object. Request message for ReadObject. bucket (:class:`str`): Required. The name of the bucket @@ -2244,7 +2244,7 @@ async def sample_read_object(): be of type `bytes`. Returns: - AsyncIterable[google.cloud.storage_v2.types.ReadObjectResponse]: + AsyncIterable[google.cloud._storage_v2.types.ReadObjectResponse]: Response message for ReadObject. """ # Create or coerce a protobuf request object. @@ -2373,7 +2373,7 @@ def request_generator(): print(response) Args: - requests (AsyncIterator[`google.cloud.storage_v2.types.BidiReadObjectRequest`]): + requests (AsyncIterator[`google.cloud._storage_v2.types.BidiReadObjectRequest`]): The request object AsyncIterator. Request message for BidiReadObject. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. @@ -2384,7 +2384,7 @@ def request_generator(): be of type `bytes`. Returns: - AsyncIterable[google.cloud.storage_v2.types.BidiReadObjectResponse]: + AsyncIterable[google.cloud._storage_v2.types.BidiReadObjectResponse]: Response message for BidiReadObject. """ @@ -2454,9 +2454,9 @@ async def sample_update_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.UpdateObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.UpdateObjectRequest, dict]]): The request object. Request message for UpdateObject. - object_ (:class:`google.cloud.storage_v2.types.Object`): + object_ (:class:`google.cloud._storage_v2.types.Object`): Required. The object to update. The object's bucket and name fields are used to identify the object to update. @@ -2493,7 +2493,7 @@ async def sample_update_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -2674,7 +2674,7 @@ def request_generator(): print(response) Args: - requests (AsyncIterator[`google.cloud.storage_v2.types.WriteObjectRequest`]): + requests (AsyncIterator[`google.cloud._storage_v2.types.WriteObjectRequest`]): The request object AsyncIterator. Request message for WriteObject. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. @@ -2685,7 +2685,7 @@ def request_generator(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.WriteObjectResponse: + google.cloud._storage_v2.types.WriteObjectResponse: Response message for WriteObject. """ @@ -2774,7 +2774,7 @@ def request_generator(): print(response) Args: - requests (AsyncIterator[`google.cloud.storage_v2.types.BidiWriteObjectRequest`]): + requests (AsyncIterator[`google.cloud._storage_v2.types.BidiWriteObjectRequest`]): The request object AsyncIterator. Request message for BidiWriteObject. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. @@ -2785,7 +2785,7 @@ def request_generator(): be of type `bytes`. Returns: - AsyncIterable[google.cloud.storage_v2.types.BidiWriteObjectResponse]: + AsyncIterable[google.cloud._storage_v2.types.BidiWriteObjectResponse]: Response message for BidiWriteObject. """ @@ -2856,7 +2856,7 @@ async def sample_list_objects(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.ListObjectsRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.ListObjectsRequest, dict]]): The request object. Request message for ListObjects. parent (:class:`str`): Required. Name of the bucket in which @@ -2874,7 +2874,7 @@ async def sample_list_objects(): be of type `bytes`. Returns: - google.cloud.storage_v2.services.storage.pagers.ListObjectsAsyncPager: + google.cloud._storage_v2.services.storage.pagers.ListObjectsAsyncPager: The result of a call to Objects.ListObjects Iterating over this object will yield @@ -2989,7 +2989,7 @@ async def sample_rewrite_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.RewriteObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.RewriteObjectRequest, dict]]): The request object. Request message for RewriteObject. If the source object is encrypted using a Customer-Supplied Encryption Key the key information must be provided in the @@ -3010,7 +3010,7 @@ async def sample_rewrite_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.RewriteResponse: + google.cloud._storage_v2.types.RewriteResponse: A rewrite response. """ # Create or coerce a protobuf request object. @@ -3102,7 +3102,7 @@ async def sample_start_resumable_write(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.StartResumableWriteRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.StartResumableWriteRequest, dict]]): The request object. Request message StartResumableWrite. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. @@ -3113,7 +3113,7 @@ async def sample_start_resumable_write(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.StartResumableWriteResponse: + google.cloud._storage_v2.types.StartResumableWriteResponse: Response object for StartResumableWrite. """ # Create or coerce a protobuf request object. @@ -3211,7 +3211,7 @@ async def sample_query_write_status(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.QueryWriteStatusRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.QueryWriteStatusRequest, dict]]): The request object. Request object for ``QueryWriteStatus``. upload_id (:class:`str`): Required. The name of the resume @@ -3230,7 +3230,7 @@ async def sample_query_write_status(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.QueryWriteStatusResponse: + google.cloud._storage_v2.types.QueryWriteStatusResponse: Response object for QueryWriteStatus. """ # Create or coerce a protobuf request object. @@ -3333,7 +3333,7 @@ async def sample_move_object(): print(response) Args: - request (Optional[Union[google.cloud.storage_v2.types.MoveObjectRequest, dict]]): + request (Optional[Union[google.cloud._storage_v2.types.MoveObjectRequest, dict]]): The request object. Request message for MoveObject. bucket (:class:`str`): Required. Name of the bucket in which @@ -3363,7 +3363,7 @@ async def sample_move_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. diff --git a/google/cloud/storage_v2/services/storage/client.py b/google/cloud/_storage_v2/services/storage/client.py similarity index 97% rename from google/cloud/storage_v2/services/storage/client.py rename to google/cloud/_storage_v2/services/storage/client.py index 2026a8918..ae1087cf6 100644 --- a/google/cloud/storage_v2/services/storage/client.py +++ b/google/cloud/_storage_v2/services/storage/client.py @@ -36,7 +36,7 @@ ) import warnings -from google.cloud.storage_v2 import gapic_version as package_version +from google.cloud._storage_v2 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,8 +63,8 @@ _LOGGER = std_logging.getLogger(__name__) -from google.cloud.storage_v2.services.storage import pagers -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.services.storage import pagers +from google.cloud._storage_v2.types import storage from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -789,7 +789,7 @@ def sample_delete_bucket(): client.delete_bucket(request=request) Args: - request (Union[google.cloud.storage_v2.types.DeleteBucketRequest, dict]): + request (Union[google.cloud._storage_v2.types.DeleteBucketRequest, dict]): The request object. Request message for DeleteBucket. name (str): Required. Name of a bucket to delete. @@ -891,7 +891,7 @@ def sample_get_bucket(): print(response) Args: - request (Union[google.cloud.storage_v2.types.GetBucketRequest, dict]): + request (Union[google.cloud._storage_v2.types.GetBucketRequest, dict]): The request object. Request message for GetBucket. name (str): Required. Name of a bucket. @@ -907,7 +907,7 @@ def sample_get_bucket(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -1003,7 +1003,7 @@ def sample_create_bucket(): print(response) Args: - request (Union[google.cloud.storage_v2.types.CreateBucketRequest, dict]): + request (Union[google.cloud._storage_v2.types.CreateBucketRequest, dict]): The request object. Request message for CreateBucket. parent (str): Required. The project to which this bucket will belong. @@ -1014,7 +1014,7 @@ def sample_create_bucket(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - bucket (google.cloud.storage_v2.types.Bucket): + bucket (google.cloud._storage_v2.types.Bucket): Optional. Properties of the new bucket being inserted. The name of the bucket is specified in the ``bucket_id`` field. Populating ``bucket.name`` field will result in @@ -1046,7 +1046,7 @@ def sample_create_bucket(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -1149,7 +1149,7 @@ def sample_list_buckets(): print(response) Args: - request (Union[google.cloud.storage_v2.types.ListBucketsRequest, dict]): + request (Union[google.cloud._storage_v2.types.ListBucketsRequest, dict]): The request object. Request message for ListBuckets. parent (str): Required. The project whose buckets @@ -1167,7 +1167,7 @@ def sample_list_buckets(): be of type `bytes`. Returns: - google.cloud.storage_v2.services.storage.pagers.ListBucketsPager: + google.cloud._storage_v2.services.storage.pagers.ListBucketsPager: The result of a call to Buckets.ListBuckets Iterating over this object will yield @@ -1277,7 +1277,7 @@ def sample_lock_bucket_retention_policy(): print(response) Args: - request (Union[google.cloud.storage_v2.types.LockBucketRetentionPolicyRequest, dict]): + request (Union[google.cloud._storage_v2.types.LockBucketRetentionPolicyRequest, dict]): The request object. Request message for LockBucketRetentionPolicyRequest. bucket (str): @@ -1294,7 +1294,7 @@ def sample_lock_bucket_retention_policy(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -1851,9 +1851,9 @@ def sample_update_bucket(): print(response) Args: - request (Union[google.cloud.storage_v2.types.UpdateBucketRequest, dict]): + request (Union[google.cloud._storage_v2.types.UpdateBucketRequest, dict]): The request object. Request for UpdateBucket method. - bucket (google.cloud.storage_v2.types.Bucket): + bucket (google.cloud._storage_v2.types.Bucket): Required. The bucket to update. The bucket's ``name`` field will be used to identify the bucket. @@ -1884,7 +1884,7 @@ def sample_update_bucket(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Bucket: + google.cloud._storage_v2.types.Bucket: A bucket. """ # Create or coerce a protobuf request object. @@ -1978,7 +1978,7 @@ def sample_compose_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.ComposeObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.ComposeObjectRequest, dict]): The request object. Request message for ComposeObject. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -1989,7 +1989,7 @@ def sample_compose_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -2087,7 +2087,7 @@ def sample_delete_object(): client.delete_object(request=request) Args: - request (Union[google.cloud.storage_v2.types.DeleteObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.DeleteObjectRequest, dict]): The request object. Message for deleting an object. ``bucket`` and ``object`` **must** be set. bucket (str): @@ -2217,7 +2217,7 @@ def sample_restore_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.RestoreObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.RestoreObjectRequest, dict]): The request object. Message for restoring an object. ``bucket``, ``object``, and ``generation`` **must** be set. bucket (str): @@ -2250,7 +2250,7 @@ def sample_restore_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -2355,7 +2355,7 @@ def sample_cancel_resumable_write(): print(response) Args: - request (Union[google.cloud.storage_v2.types.CancelResumableWriteRequest, dict]): + request (Union[google.cloud._storage_v2.types.CancelResumableWriteRequest, dict]): The request object. Message for canceling an in-progress resumable upload. ``upload_id`` **must** be set. upload_id (str): @@ -2375,7 +2375,7 @@ def sample_cancel_resumable_write(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.CancelResumableWriteResponse: + google.cloud._storage_v2.types.CancelResumableWriteResponse: Empty response message for canceling an in-progress resumable upload, will be extended as needed. @@ -2483,7 +2483,7 @@ def sample_get_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.GetObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.GetObjectRequest, dict]): The request object. Request message for GetObject. bucket (str): Required. Name of the bucket in which @@ -2515,7 +2515,7 @@ def sample_get_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -2622,7 +2622,7 @@ def sample_read_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.ReadObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.ReadObjectRequest, dict]): The request object. Request message for ReadObject. bucket (str): Required. The name of the bucket @@ -2656,7 +2656,7 @@ def sample_read_object(): be of type `bytes`. Returns: - Iterable[google.cloud.storage_v2.types.ReadObjectResponse]: + Iterable[google.cloud._storage_v2.types.ReadObjectResponse]: Response message for ReadObject. """ # Create or coerce a protobuf request object. @@ -2782,7 +2782,7 @@ def request_generator(): print(response) Args: - requests (Iterator[google.cloud.storage_v2.types.BidiReadObjectRequest]): + requests (Iterator[google.cloud._storage_v2.types.BidiReadObjectRequest]): The request object iterator. Request message for BidiReadObject. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -2793,7 +2793,7 @@ def request_generator(): be of type `bytes`. Returns: - Iterable[google.cloud.storage_v2.types.BidiReadObjectResponse]: + Iterable[google.cloud._storage_v2.types.BidiReadObjectResponse]: Response message for BidiReadObject. """ @@ -2861,9 +2861,9 @@ def sample_update_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.UpdateObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.UpdateObjectRequest, dict]): The request object. Request message for UpdateObject. - object_ (google.cloud.storage_v2.types.Object): + object_ (google.cloud._storage_v2.types.Object): Required. The object to update. The object's bucket and name fields are used to identify the object to update. @@ -2900,7 +2900,7 @@ def sample_update_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. @@ -3078,7 +3078,7 @@ def request_generator(): print(response) Args: - requests (Iterator[google.cloud.storage_v2.types.WriteObjectRequest]): + requests (Iterator[google.cloud._storage_v2.types.WriteObjectRequest]): The request object iterator. Request message for WriteObject. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3089,7 +3089,7 @@ def request_generator(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.WriteObjectResponse: + google.cloud._storage_v2.types.WriteObjectResponse: Response message for WriteObject. """ @@ -3176,7 +3176,7 @@ def request_generator(): print(response) Args: - requests (Iterator[google.cloud.storage_v2.types.BidiWriteObjectRequest]): + requests (Iterator[google.cloud._storage_v2.types.BidiWriteObjectRequest]): The request object iterator. Request message for BidiWriteObject. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3187,7 +3187,7 @@ def request_generator(): be of type `bytes`. Returns: - Iterable[google.cloud.storage_v2.types.BidiWriteObjectResponse]: + Iterable[google.cloud._storage_v2.types.BidiWriteObjectResponse]: Response message for BidiWriteObject. """ @@ -3256,7 +3256,7 @@ def sample_list_objects(): print(response) Args: - request (Union[google.cloud.storage_v2.types.ListObjectsRequest, dict]): + request (Union[google.cloud._storage_v2.types.ListObjectsRequest, dict]): The request object. Request message for ListObjects. parent (str): Required. Name of the bucket in which @@ -3274,7 +3274,7 @@ def sample_list_objects(): be of type `bytes`. Returns: - google.cloud.storage_v2.services.storage.pagers.ListObjectsPager: + google.cloud._storage_v2.services.storage.pagers.ListObjectsPager: The result of a call to Objects.ListObjects Iterating over this object will yield @@ -3386,7 +3386,7 @@ def sample_rewrite_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.RewriteObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.RewriteObjectRequest, dict]): The request object. Request message for RewriteObject. If the source object is encrypted using a Customer-Supplied Encryption Key the key information must be provided in the @@ -3407,7 +3407,7 @@ def sample_rewrite_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.RewriteResponse: + google.cloud._storage_v2.types.RewriteResponse: A rewrite response. """ # Create or coerce a protobuf request object. @@ -3497,7 +3497,7 @@ def sample_start_resumable_write(): print(response) Args: - request (Union[google.cloud.storage_v2.types.StartResumableWriteRequest, dict]): + request (Union[google.cloud._storage_v2.types.StartResumableWriteRequest, dict]): The request object. Request message StartResumableWrite. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -3508,7 +3508,7 @@ def sample_start_resumable_write(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.StartResumableWriteResponse: + google.cloud._storage_v2.types.StartResumableWriteResponse: Response object for StartResumableWrite. """ # Create or coerce a protobuf request object. @@ -3604,7 +3604,7 @@ def sample_query_write_status(): print(response) Args: - request (Union[google.cloud.storage_v2.types.QueryWriteStatusRequest, dict]): + request (Union[google.cloud._storage_v2.types.QueryWriteStatusRequest, dict]): The request object. Request object for ``QueryWriteStatus``. upload_id (str): Required. The name of the resume @@ -3623,7 +3623,7 @@ def sample_query_write_status(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.QueryWriteStatusResponse: + google.cloud._storage_v2.types.QueryWriteStatusResponse: Response object for QueryWriteStatus. """ # Create or coerce a protobuf request object. @@ -3723,7 +3723,7 @@ def sample_move_object(): print(response) Args: - request (Union[google.cloud.storage_v2.types.MoveObjectRequest, dict]): + request (Union[google.cloud._storage_v2.types.MoveObjectRequest, dict]): The request object. Request message for MoveObject. bucket (str): Required. Name of the bucket in which @@ -3753,7 +3753,7 @@ def sample_move_object(): be of type `bytes`. Returns: - google.cloud.storage_v2.types.Object: + google.cloud._storage_v2.types.Object: An object. """ # Create or coerce a protobuf request object. diff --git a/google/cloud/storage_v2/services/storage/pagers.py b/google/cloud/_storage_v2/services/storage/pagers.py similarity index 90% rename from google/cloud/storage_v2/services/storage/pagers.py rename to google/cloud/_storage_v2/services/storage/pagers.py index 79aa18984..d0076080e 100644 --- a/google/cloud/storage_v2/services/storage/pagers.py +++ b/google/cloud/_storage_v2/services/storage/pagers.py @@ -37,14 +37,14 @@ OptionalRetry = Union[retries.Retry, object, None] # type: ignore OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.types import storage class ListBucketsPager: """A pager for iterating through ``list_buckets`` requests. This class thinly wraps an initial - :class:`google.cloud.storage_v2.types.ListBucketsResponse` object, and + :class:`google.cloud._storage_v2.types.ListBucketsResponse` object, and provides an ``__iter__`` method to iterate through its ``buckets`` field. @@ -53,7 +53,7 @@ class ListBucketsPager: through the ``buckets`` field on the corresponding responses. - All the usual :class:`google.cloud.storage_v2.types.ListBucketsResponse` + All the usual :class:`google.cloud._storage_v2.types.ListBucketsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -73,9 +73,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.storage_v2.types.ListBucketsRequest): + request (google.cloud._storage_v2.types.ListBucketsRequest): The initial request object. - response (google.cloud.storage_v2.types.ListBucketsResponse): + response (google.cloud._storage_v2.types.ListBucketsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -120,7 +120,7 @@ class ListBucketsAsyncPager: """A pager for iterating through ``list_buckets`` requests. This class thinly wraps an initial - :class:`google.cloud.storage_v2.types.ListBucketsResponse` object, and + :class:`google.cloud._storage_v2.types.ListBucketsResponse` object, and provides an ``__aiter__`` method to iterate through its ``buckets`` field. @@ -129,7 +129,7 @@ class ListBucketsAsyncPager: through the ``buckets`` field on the corresponding responses. - All the usual :class:`google.cloud.storage_v2.types.ListBucketsResponse` + All the usual :class:`google.cloud._storage_v2.types.ListBucketsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -149,9 +149,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.storage_v2.types.ListBucketsRequest): + request (google.cloud._storage_v2.types.ListBucketsRequest): The initial request object. - response (google.cloud.storage_v2.types.ListBucketsResponse): + response (google.cloud._storage_v2.types.ListBucketsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -200,7 +200,7 @@ class ListObjectsPager: """A pager for iterating through ``list_objects`` requests. This class thinly wraps an initial - :class:`google.cloud.storage_v2.types.ListObjectsResponse` object, and + :class:`google.cloud._storage_v2.types.ListObjectsResponse` object, and provides an ``__iter__`` method to iterate through its ``objects`` field. @@ -209,7 +209,7 @@ class ListObjectsPager: through the ``objects`` field on the corresponding responses. - All the usual :class:`google.cloud.storage_v2.types.ListObjectsResponse` + All the usual :class:`google.cloud._storage_v2.types.ListObjectsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -229,9 +229,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.storage_v2.types.ListObjectsRequest): + request (google.cloud._storage_v2.types.ListObjectsRequest): The initial request object. - response (google.cloud.storage_v2.types.ListObjectsResponse): + response (google.cloud._storage_v2.types.ListObjectsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -276,7 +276,7 @@ class ListObjectsAsyncPager: """A pager for iterating through ``list_objects`` requests. This class thinly wraps an initial - :class:`google.cloud.storage_v2.types.ListObjectsResponse` object, and + :class:`google.cloud._storage_v2.types.ListObjectsResponse` object, and provides an ``__aiter__`` method to iterate through its ``objects`` field. @@ -285,7 +285,7 @@ class ListObjectsAsyncPager: through the ``objects`` field on the corresponding responses. - All the usual :class:`google.cloud.storage_v2.types.ListObjectsResponse` + All the usual :class:`google.cloud._storage_v2.types.ListObjectsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -305,9 +305,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.storage_v2.types.ListObjectsRequest): + request (google.cloud._storage_v2.types.ListObjectsRequest): The initial request object. - response (google.cloud.storage_v2.types.ListObjectsResponse): + response (google.cloud._storage_v2.types.ListObjectsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. diff --git a/google/cloud/storage_v2/services/storage/transports/README.rst b/google/cloud/_storage_v2/services/storage/transports/README.rst similarity index 100% rename from google/cloud/storage_v2/services/storage/transports/README.rst rename to google/cloud/_storage_v2/services/storage/transports/README.rst diff --git a/google/cloud/storage_v2/services/storage/transports/__init__.py b/google/cloud/_storage_v2/services/storage/transports/__init__.py similarity index 100% rename from google/cloud/storage_v2/services/storage/transports/__init__.py rename to google/cloud/_storage_v2/services/storage/transports/__init__.py diff --git a/google/cloud/storage_v2/services/storage/transports/base.py b/google/cloud/_storage_v2/services/storage/transports/base.py similarity index 99% rename from google/cloud/storage_v2/services/storage/transports/base.py rename to google/cloud/_storage_v2/services/storage/transports/base.py index ea82adddc..3484b18dd 100644 --- a/google/cloud/storage_v2/services/storage/transports/base.py +++ b/google/cloud/_storage_v2/services/storage/transports/base.py @@ -16,7 +16,7 @@ import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -from google.cloud.storage_v2 import gapic_version as package_version +from google.cloud._storage_v2 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -27,7 +27,7 @@ from google.oauth2 import service_account # type: ignore import google.protobuf -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.types import storage from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/storage_v2/services/storage/transports/grpc.py b/google/cloud/_storage_v2/services/storage/transports/grpc.py similarity index 99% rename from google/cloud/storage_v2/services/storage/transports/grpc.py rename to google/cloud/_storage_v2/services/storage/transports/grpc.py index 6d5bbca85..7ffe8465c 100644 --- a/google/cloud/storage_v2/services/storage/transports/grpc.py +++ b/google/cloud/_storage_v2/services/storage/transports/grpc.py @@ -30,7 +30,7 @@ import grpc # type: ignore import proto # type: ignore -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.types import storage from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/storage_v2/services/storage/transports/grpc_asyncio.py b/google/cloud/_storage_v2/services/storage/transports/grpc_asyncio.py similarity index 99% rename from google/cloud/storage_v2/services/storage/transports/grpc_asyncio.py rename to google/cloud/_storage_v2/services/storage/transports/grpc_asyncio.py index d2ff8dc05..fa2fa0e9d 100644 --- a/google/cloud/storage_v2/services/storage/transports/grpc_asyncio.py +++ b/google/cloud/_storage_v2/services/storage/transports/grpc_asyncio.py @@ -33,7 +33,7 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.types import storage from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/storage_v2/types/__init__.py b/google/cloud/_storage_v2/types/__init__.py similarity index 100% rename from google/cloud/storage_v2/types/__init__.py rename to google/cloud/_storage_v2/types/__init__.py diff --git a/google/cloud/storage_v2/types/storage.py b/google/cloud/_storage_v2/types/storage.py similarity index 96% rename from google/cloud/storage_v2/types/storage.py rename to google/cloud/_storage_v2/types/storage.py index 9dc7d6262..bee559a2f 100644 --- a/google/cloud/storage_v2/types/storage.py +++ b/google/cloud/_storage_v2/types/storage.py @@ -184,7 +184,7 @@ class CreateBucketRequest(proto.Message): field must either be empty or ``projects/_``. The project ID that owns this bucket should be specified in the ``bucket.project`` field. - bucket (google.cloud.storage_v2.types.Bucket): + bucket (google.cloud._storage_v2.types.Bucket): Optional. Properties of the new bucket being inserted. The name of the bucket is specified in the ``bucket_id`` field. Populating ``bucket.name`` field will result in an error. @@ -302,7 +302,7 @@ class ListBucketsResponse(proto.Message): r"""The result of a call to Buckets.ListBuckets Attributes: - buckets (MutableSequence[google.cloud.storage_v2.types.Bucket]): + buckets (MutableSequence[google.cloud._storage_v2.types.Bucket]): The list of items. next_page_token (str): The continuation token, used to page through @@ -354,7 +354,7 @@ class UpdateBucketRequest(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - bucket (google.cloud.storage_v2.types.Bucket): + bucket (google.cloud._storage_v2.types.Bucket): Required. The bucket to update. The bucket's ``name`` field will be used to identify the bucket. if_metageneration_match (int): @@ -427,9 +427,9 @@ class ComposeObjectRequest(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - destination (google.cloud.storage_v2.types.Object): + destination (google.cloud._storage_v2.types.Object): Required. Properties of the resulting object. - source_objects (MutableSequence[google.cloud.storage_v2.types.ComposeObjectRequest.SourceObject]): + source_objects (MutableSequence[google.cloud._storage_v2.types.ComposeObjectRequest.SourceObject]): Optional. The list of source objects that will be concatenated into a single object. destination_predefined_acl (str): @@ -457,10 +457,10 @@ class ComposeObjectRequest(proto.Message): ``projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key``, that will be used to encrypt the object. Overrides the object metadata's ``kms_key_name`` value, if any. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. - object_checksums (google.cloud.storage_v2.types.ObjectChecksums): + object_checksums (google.cloud._storage_v2.types.ObjectChecksums): Optional. The checksums of the complete object. This will be validated against the combined checksums of the component objects. @@ -476,7 +476,7 @@ class SourceObject(proto.Message): generation (int): Optional. The generation of this object to use as the source. - object_preconditions (google.cloud.storage_v2.types.ComposeObjectRequest.SourceObject.ObjectPreconditions): + object_preconditions (google.cloud._storage_v2.types.ComposeObjectRequest.SourceObject.ObjectPreconditions): Optional. Conditions that must be met for this operation to execute. """ @@ -605,7 +605,7 @@ class DeleteObjectRequest(proto.Message): match the given value. This field is a member of `oneof`_ ``_if_metageneration_not_match``. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. """ @@ -709,7 +709,7 @@ class RestoreObjectRequest(proto.Message): if bucket has UBLA enabled. This field is a member of `oneof`_ ``_copy_source_acl``. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. """ @@ -851,7 +851,7 @@ class ReadObjectRequest(proto.Message): match the given value. This field is a member of `oneof`_ ``_if_metageneration_not_match``. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. read_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -967,7 +967,7 @@ class GetObjectRequest(proto.Message): match the given value. This field is a member of `oneof`_ ``_if_metageneration_not_match``. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. read_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -1045,23 +1045,23 @@ class ReadObjectResponse(proto.Message): r"""Response message for ReadObject. Attributes: - checksummed_data (google.cloud.storage_v2.types.ChecksummedData): + checksummed_data (google.cloud._storage_v2.types.ChecksummedData): A portion of the data for the object. The service **may** leave ``data`` empty for any given ``ReadResponse``. This enables the service to inform the client that the request is still live while it is running an operation to generate more data. - object_checksums (google.cloud.storage_v2.types.ObjectChecksums): + object_checksums (google.cloud._storage_v2.types.ObjectChecksums): The checksums of the complete object. If the object is downloaded in full, the client should compute one of these checksums over the downloaded object and compare it against the value provided here. - content_range (google.cloud.storage_v2.types.ContentRange): + content_range (google.cloud._storage_v2.types.ContentRange): If read_offset and or read_limit was specified on the ReadObjectRequest, ContentRange will be populated on the first ReadObjectResponse message of the read stream. - metadata (google.cloud.storage_v2.types.Object): + metadata (google.cloud._storage_v2.types.Object): Metadata of the object whose media is being returned. Only populated in the first response in the stream. @@ -1133,7 +1133,7 @@ class BidiReadObjectSpec(proto.Message): match the given value. This field is a member of `oneof`_ ``_if_metageneration_not_match``. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. read_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -1148,7 +1148,7 @@ class BidiReadObjectSpec(proto.Message): https://cloud.google.com/apis/docs/system-parameters#definitions This field is a member of `oneof`_ ``_read_mask``. - read_handle (google.cloud.storage_v2.types.BidiReadHandle): + read_handle (google.cloud._storage_v2.types.BidiReadHandle): The client can optionally set this field. The read handle is an optimized way of creating new streams. Read handles are generated and @@ -1223,12 +1223,12 @@ class BidiReadObjectRequest(proto.Message): r"""Request message for BidiReadObject. Attributes: - read_object_spec (google.cloud.storage_v2.types.BidiReadObjectSpec): + read_object_spec (google.cloud._storage_v2.types.BidiReadObjectSpec): Optional. The first message of each stream should set this field. If this is not the first message, an error will be returned. Describes the object to read. - read_ranges (MutableSequence[google.cloud.storage_v2.types.ReadRange]): + read_ranges (MutableSequence[google.cloud._storage_v2.types.ReadRange]): Optional. Provides a list of 0 or more (up to 100) ranges to read. If a single range is large enough to require multiple responses, they are @@ -1256,7 +1256,7 @@ class BidiReadObjectResponse(proto.Message): r"""Response message for BidiReadObject. Attributes: - object_data_ranges (MutableSequence[google.cloud.storage_v2.types.ObjectRangeData]): + object_data_ranges (MutableSequence[google.cloud._storage_v2.types.ObjectRangeData]): A portion of the object's data. The service **may** leave data empty for any given ReadResponse. This enables the service to inform the client that the request is still live @@ -1265,12 +1265,12 @@ class BidiReadObjectResponse(proto.Message): different read requests. Each ObjectRangeData entry will have a read_id set to the same value as the corresponding source read request. - metadata (google.cloud.storage_v2.types.Object): + metadata (google.cloud._storage_v2.types.Object): Metadata of the object whose media is being returned. Only populated in the first response in the stream and not populated when the stream is opened with a read handle. - read_handle (google.cloud.storage_v2.types.BidiReadHandle): + read_handle (google.cloud._storage_v2.types.BidiReadHandle): This field will be periodically refreshed, however it may not be set in every response. It allows the client to more efficiently open @@ -1304,7 +1304,7 @@ class BidiReadObjectRedirectedError(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - read_handle (google.cloud.storage_v2.types.BidiReadHandle): + read_handle (google.cloud._storage_v2.types.BidiReadHandle): The read handle for the redirected read. If set, the client may use this in the BidiReadObjectSpec when retrying the read @@ -1346,7 +1346,7 @@ class BidiWriteObjectRedirectedError(proto.Message): this string verbatim as the value. This field is a member of `oneof`_ ``_routing_token``. - write_handle (google.cloud.storage_v2.types.BidiWriteHandle): + write_handle (google.cloud._storage_v2.types.BidiWriteHandle): Opaque value describing a previous write. If set, the client must use this in an AppendObjectSpec first_message when retrying the write stream. If not set, clients may retry the @@ -1385,7 +1385,7 @@ class BidiReadObjectError(proto.Message): reads on the failed stream Attributes: - read_range_errors (MutableSequence[google.cloud.storage_v2.types.ReadRangeError]): + read_range_errors (MutableSequence[google.cloud._storage_v2.types.ReadRangeError]): The error code for each outstanding read_range """ @@ -1473,9 +1473,9 @@ class ObjectRangeData(proto.Message): r"""Contains data and metadata for a range of an object. Attributes: - checksummed_data (google.cloud.storage_v2.types.ChecksummedData): + checksummed_data (google.cloud._storage_v2.types.ChecksummedData): A portion of the data for the object. - read_range (google.cloud.storage_v2.types.ReadRange): + read_range (google.cloud._storage_v2.types.ReadRange): The ReadRange describes the content being returned with read_id set to the corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData messages may have the same @@ -1547,7 +1547,7 @@ class WriteObjectSpec(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - resource (google.cloud.storage_v2.types.Object): + resource (google.cloud._storage_v2.types.Object): Required. Destination object, including its name and its metadata. predefined_acl (str): @@ -1660,7 +1660,7 @@ class WriteObjectRequest(proto.Message): returned from a call to ``StartResumableWriteResponse``. This field is a member of `oneof`_ ``first_message``. - write_object_spec (google.cloud.storage_v2.types.WriteObjectSpec): + write_object_spec (google.cloud._storage_v2.types.WriteObjectSpec): For non-resumable uploads. Describes the overall upload, including the destination bucket and object name, preconditions, etc. @@ -1681,13 +1681,13 @@ class WriteObjectRequest(proto.Message): ``data`` chunks sent previously on this stream. An incorrect value will cause an error. - checksummed_data (google.cloud.storage_v2.types.ChecksummedData): + checksummed_data (google.cloud._storage_v2.types.ChecksummedData): The data to insert. If a crc32c checksum is provided that doesn't match the checksum computed by the service, the request will fail. This field is a member of `oneof`_ ``data``. - object_checksums (google.cloud.storage_v2.types.ObjectChecksums): + object_checksums (google.cloud._storage_v2.types.ObjectChecksums): Optional. Checksums for the complete object. If the checksums computed by the service don't match the specified checksums the call will fail. May only be provided in the @@ -1700,7 +1700,7 @@ class WriteObjectRequest(proto.Message): error. For a non-resumable write (where the upload_id was not set in the first message), it is an error not to set this field in the final message of the stream. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. """ @@ -1759,7 +1759,7 @@ class WriteObjectResponse(proto.Message): upload has not finalized. This field is a member of `oneof`_ ``write_status``. - resource (google.cloud.storage_v2.types.Object): + resource (google.cloud._storage_v2.types.Object): A resource containing the metadata for the uploaded object. Only set if the upload has finalized. @@ -1819,7 +1819,7 @@ class AppendObjectSpec(proto.Message): if a BidiWriteObjectRedirectedError is returned. This field is a member of `oneof`_ ``_routing_token``. - write_handle (google.cloud.storage_v2.types.BidiWriteHandle): + write_handle (google.cloud._storage_v2.types.BidiWriteHandle): An optional write handle returned from a previous BidiWriteObjectResponse message or a BidiWriteObjectRedirectedError error. @@ -1881,13 +1881,13 @@ class BidiWriteObjectRequest(proto.Message): returned from a call to ``StartResumableWriteResponse``. This field is a member of `oneof`_ ``first_message``. - write_object_spec (google.cloud.storage_v2.types.WriteObjectSpec): + write_object_spec (google.cloud._storage_v2.types.WriteObjectSpec): For non-resumable uploads. Describes the overall upload, including the destination bucket and object name, preconditions, etc. This field is a member of `oneof`_ ``first_message``. - append_object_spec (google.cloud.storage_v2.types.AppendObjectSpec): + append_object_spec (google.cloud._storage_v2.types.AppendObjectSpec): For appendable uploads. Describes the object to append to. @@ -1907,13 +1907,13 @@ class BidiWriteObjectRequest(proto.Message): ``data`` chunks sent previously on this stream. An invalid value will cause an error. - checksummed_data (google.cloud.storage_v2.types.ChecksummedData): + checksummed_data (google.cloud._storage_v2.types.ChecksummedData): The data to insert. If a crc32c checksum is provided that doesn't match the checksum computed by the service, the request will fail. This field is a member of `oneof`_ ``data``. - object_checksums (google.cloud.storage_v2.types.ObjectChecksums): + object_checksums (google.cloud._storage_v2.types.ObjectChecksums): Optional. Checksums for the complete object. If the checksums computed by the service don't match the specified checksums the call will fail. May only be provided in the @@ -1945,7 +1945,7 @@ class BidiWriteObjectRequest(proto.Message): error. For a non-resumable write (where the upload_id was not set in the first message), it is an error not to set this field in the final message of the stream. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. """ @@ -2018,13 +2018,13 @@ class BidiWriteObjectResponse(proto.Message): upload has not finalized. This field is a member of `oneof`_ ``write_status``. - resource (google.cloud.storage_v2.types.Object): + resource (google.cloud._storage_v2.types.Object): A resource containing the metadata for the uploaded object. Only set if the upload has finalized. This field is a member of `oneof`_ ``write_status``. - write_handle (google.cloud.storage_v2.types.BidiWriteHandle): + write_handle (google.cloud._storage_v2.types.BidiWriteHandle): An optional write handle that will periodically be present in response messages. Clients should save it for later use in @@ -2197,7 +2197,7 @@ class QueryWriteStatusRequest(proto.Message): Required. The name of the resume token for the object whose write status is being requested. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. """ @@ -2232,7 +2232,7 @@ class QueryWriteStatusResponse(proto.Message): upload has not finalized. This field is a member of `oneof`_ ``write_status``. - resource (google.cloud.storage_v2.types.Object): + resource (google.cloud._storage_v2.types.Object): A resource containing the metadata for the uploaded object. Only set if the upload has finalized. @@ -2287,7 +2287,7 @@ class RewriteObjectRequest(proto.Message): specified, the request uses the destination bucket's default encryption key, if any, or else the Google-managed encryption key. - destination (google.cloud.storage_v2.types.Object): + destination (google.cloud._storage_v2.types.Object): Optional. Properties of the destination, post-rewrite object. The ``name``, ``bucket`` and ``kms_key`` fields must not be populated (these values are specified in the @@ -2398,10 +2398,10 @@ class RewriteObjectRequest(proto.Message): SHA256 hash of the encryption key used to encrypt the source object, if it was encrypted with a Customer-Supplied Encryption Key. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. - object_checksums (google.cloud.storage_v2.types.ObjectChecksums): + object_checksums (google.cloud._storage_v2.types.ObjectChecksums): Optional. The checksums of the complete object. This will be used to validate the destination object after rewriting. @@ -2534,7 +2534,7 @@ class RewriteResponse(proto.Message): continue copying data. This token is present in the response only when there is more data to copy. - resource (google.cloud.storage_v2.types.Object): + resource (google.cloud._storage_v2.types.Object): A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes. @@ -2711,13 +2711,13 @@ class StartResumableWriteRequest(proto.Message): r"""Request message StartResumableWrite. Attributes: - write_object_spec (google.cloud.storage_v2.types.WriteObjectSpec): + write_object_spec (google.cloud._storage_v2.types.WriteObjectSpec): Required. Contains the information necessary to start a resumable write. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests related to an object. - object_checksums (google.cloud.storage_v2.types.ObjectChecksums): + object_checksums (google.cloud._storage_v2.types.ObjectChecksums): Optional. The checksums of the complete object. This is used to validate the uploaded object. For each upload, ``object_checksums`` can be provided when initiating a @@ -2768,7 +2768,7 @@ class UpdateObjectRequest(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - object_ (google.cloud.storage_v2.types.Object): + object_ (google.cloud._storage_v2.types.Object): Required. The object to update. The object's bucket and name fields are used to identify the object to update. If present, the @@ -2821,7 +2821,7 @@ class UpdateObjectRequest(proto.Message): accidentally reset the new field's value. Not specifying any fields is an error. - common_object_request_params (google.cloud.storage_v2.types.CommonObjectRequestParams): + common_object_request_params (google.cloud._storage_v2.types.CommonObjectRequestParams): Optional. A set of parameters common to Storage API requests concerning an object. override_unlocked_retention (bool): @@ -3051,22 +3051,22 @@ class Bucket(proto.Message): bucket is created, it defaults to "DEFAULT". For more information, see https://cloud.google.com/storage/docs/availability-durability#turbo-replication. - acl (MutableSequence[google.cloud.storage_v2.types.BucketAccessControl]): + acl (MutableSequence[google.cloud._storage_v2.types.BucketAccessControl]): Optional. Access controls on the bucket. If iam_config.uniform_bucket_level_access is enabled on this bucket, requests to set, read, or modify acl is an error. - default_object_acl (MutableSequence[google.cloud.storage_v2.types.ObjectAccessControl]): + default_object_acl (MutableSequence[google.cloud._storage_v2.types.ObjectAccessControl]): Optional. Default access controls to apply to new objects when no ACL is provided. If iam_config.uniform_bucket_level_access is enabled on this bucket, requests to set, read, or modify acl is an error. - lifecycle (google.cloud.storage_v2.types.Bucket.Lifecycle): + lifecycle (google.cloud._storage_v2.types.Bucket.Lifecycle): Optional. The bucket's lifecycle config. See [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management] for more information. create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The creation time of the bucket. - cors (MutableSequence[google.cloud.storage_v2.types.Bucket.Cors]): + cors (MutableSequence[google.cloud._storage_v2.types.Bucket.Cors]): Optional. The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing] (CORS) config. @@ -3097,26 +3097,26 @@ class Bucket(proto.Message): labels (MutableMapping[str, str]): Optional. User-provided labels, in key/value pairs. - website (google.cloud.storage_v2.types.Bucket.Website): + website (google.cloud._storage_v2.types.Bucket.Website): Optional. The bucket's website config, controlling how the service behaves when accessing bucket contents as a web site. See the [https://cloud.google.com/storage/docs/static-website][Static Website Examples] for more information. - versioning (google.cloud.storage_v2.types.Bucket.Versioning): + versioning (google.cloud._storage_v2.types.Bucket.Versioning): Optional. The bucket's versioning config. - logging (google.cloud.storage_v2.types.Bucket.Logging): + logging (google.cloud._storage_v2.types.Bucket.Logging): Optional. The bucket's logging config, which defines the destination bucket and name prefix (if any) for the current bucket's logs. - owner (google.cloud.storage_v2.types.Owner): + owner (google.cloud._storage_v2.types.Owner): Output only. The owner of the bucket. This is always the project team's owner group. - encryption (google.cloud.storage_v2.types.Bucket.Encryption): + encryption (google.cloud._storage_v2.types.Bucket.Encryption): Optional. Encryption config for a bucket. - billing (google.cloud.storage_v2.types.Bucket.Billing): + billing (google.cloud._storage_v2.types.Bucket.Billing): Optional. The bucket's billing config. - retention_policy (google.cloud.storage_v2.types.Bucket.RetentionPolicy): + retention_policy (google.cloud._storage_v2.types.Bucket.RetentionPolicy): Optional. The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any @@ -3128,34 +3128,34 @@ class Bucket(proto.Message): for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error. - iam_config (google.cloud.storage_v2.types.Bucket.IamConfig): + iam_config (google.cloud._storage_v2.types.Bucket.IamConfig): Optional. The bucket's IAM config. satisfies_pzs (bool): Optional. Reserved for future use. - custom_placement_config (google.cloud.storage_v2.types.Bucket.CustomPlacementConfig): + custom_placement_config (google.cloud._storage_v2.types.Bucket.CustomPlacementConfig): Optional. Configuration that, if present, specifies the data placement for a [https://cloud.google.com/storage/docs/locations#location-dr][configurable dual-region]. - autoclass (google.cloud.storage_v2.types.Bucket.Autoclass): + autoclass (google.cloud._storage_v2.types.Bucket.Autoclass): Optional. The bucket's Autoclass configuration. If there is no configuration, the Autoclass feature will be disabled and have no effect on the bucket. - hierarchical_namespace (google.cloud.storage_v2.types.Bucket.HierarchicalNamespace): + hierarchical_namespace (google.cloud._storage_v2.types.Bucket.HierarchicalNamespace): Optional. The bucket's hierarchical namespace configuration. If there is no configuration, the hierarchical namespace feature will be disabled and have no effect on the bucket. - soft_delete_policy (google.cloud.storage_v2.types.Bucket.SoftDeletePolicy): + soft_delete_policy (google.cloud._storage_v2.types.Bucket.SoftDeletePolicy): Optional. The bucket's soft delete policy. The soft delete policy prevents soft-deleted objects from being permanently deleted. - object_retention (google.cloud.storage_v2.types.Bucket.ObjectRetention): + object_retention (google.cloud._storage_v2.types.Bucket.ObjectRetention): Optional. The bucket's object retention configuration. Must be enabled before objects in the bucket may have retention configured. - ip_filter (google.cloud.storage_v2.types.Bucket.IpFilter): + ip_filter (google.cloud._storage_v2.types.Bucket.IpFilter): Optional. The bucket's IP filter configuration. @@ -3233,7 +3233,7 @@ class Encryption(proto.Message): will be used to encrypt objects inserted into this bucket, if no encryption method is specified. - google_managed_encryption_enforcement_config (google.cloud.storage_v2.types.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig): + google_managed_encryption_enforcement_config (google.cloud._storage_v2.types.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig): Optional. If omitted, then new objects with GMEK encryption-type is allowed. If set, then new objects created in this bucket must comply @@ -3242,7 +3242,7 @@ class Encryption(proto.Message): objects only. This field is a member of `oneof`_ ``_google_managed_encryption_enforcement_config``. - customer_managed_encryption_enforcement_config (google.cloud.storage_v2.types.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig): + customer_managed_encryption_enforcement_config (google.cloud._storage_v2.types.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig): Optional. If omitted, then new objects with CMEK encryption-type is allowed. If set, then new objects created in this bucket must comply @@ -3251,7 +3251,7 @@ class Encryption(proto.Message): objects only. This field is a member of `oneof`_ ``_customer_managed_encryption_enforcement_config``. - customer_supplied_encryption_enforcement_config (google.cloud.storage_v2.types.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig): + customer_supplied_encryption_enforcement_config (google.cloud._storage_v2.types.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig): Optional. If omitted, then new objects with CSEK encryption-type is allowed. If set, then new objects created in this bucket must comply @@ -3397,7 +3397,7 @@ class IamConfig(proto.Message): r"""Bucket restriction options. Attributes: - uniform_bucket_level_access (google.cloud.storage_v2.types.Bucket.IamConfig.UniformBucketLevelAccess): + uniform_bucket_level_access (google.cloud._storage_v2.types.Bucket.IamConfig.UniformBucketLevelAccess): Optional. Bucket restriction options currently enforced on the bucket. public_access_prevention (str): @@ -3450,7 +3450,7 @@ class Lifecycle(proto.Message): https://cloud.google.com/storage/docs/lifecycle. Attributes: - rule (MutableSequence[google.cloud.storage_v2.types.Bucket.Lifecycle.Rule]): + rule (MutableSequence[google.cloud._storage_v2.types.Bucket.Lifecycle.Rule]): Optional. A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be @@ -3462,9 +3462,9 @@ class Rule(proto.Message): and a condition which will trigger that action. Attributes: - action (google.cloud.storage_v2.types.Bucket.Lifecycle.Rule.Action): + action (google.cloud._storage_v2.types.Bucket.Lifecycle.Rule.Action): Optional. The action to take. - condition (google.cloud.storage_v2.types.Bucket.Lifecycle.Rule.Condition): + condition (google.cloud._storage_v2.types.Bucket.Lifecycle.Rule.Condition): Optional. The condition(s) under which the action will be taken. """ @@ -3871,12 +3871,12 @@ class IpFilter(proto.Message): to a bucket.". This field is a member of `oneof`_ ``_mode``. - public_network_source (google.cloud.storage_v2.types.Bucket.IpFilter.PublicNetworkSource): + public_network_source (google.cloud._storage_v2.types.Bucket.IpFilter.PublicNetworkSource): Public IPs allowed to operate or access the bucket. This field is a member of `oneof`_ ``_public_network_source``. - vpc_network_sources (MutableSequence[google.cloud.storage_v2.types.Bucket.IpFilter.VpcNetworkSource]): + vpc_network_sources (MutableSequence[google.cloud._storage_v2.types.Bucket.IpFilter.VpcNetworkSource]): Optional. The list of network sources that are allowed to access operations on the bucket or the underlying objects. @@ -4188,7 +4188,7 @@ class BucketAccessControl(proto.Message): domain (str): Optional. The domain associated with the entity, if any. - project_team (google.cloud.storage_v2.types.ProjectTeam): + project_team (google.cloud._storage_v2.types.ProjectTeam): Optional. The project team associated with the entity, if any. """ @@ -4331,7 +4331,7 @@ class ObjectContexts(proto.Message): r"""All contexts of an object grouped by type. Attributes: - custom (MutableMapping[str, google.cloud.storage_v2.types.ObjectCustomContextPayload]): + custom (MutableMapping[str, google.cloud._storage_v2.types.ObjectCustomContextPayload]): Optional. User-defined object contexts. """ @@ -4426,7 +4426,7 @@ class Object(proto.Message): ยง5.2]. If omitted, and the object is accessible to all anonymous users, the default will be ``public, max-age=3600``. - acl (MutableSequence[google.cloud.storage_v2.types.ObjectAccessControl]): + acl (MutableSequence[google.cloud._storage_v2.types.ObjectAccessControl]): Optional. Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an @@ -4453,7 +4453,7 @@ class Object(proto.Message): Output only. Number of underlying components that make up this object. Components are accumulated by compose operations. - checksums (google.cloud.storage_v2.types.ObjectChecksums): + checksums (google.cloud._storage_v2.types.ObjectChecksums): Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in @@ -4505,7 +4505,7 @@ class Object(proto.Message): metadata (MutableMapping[str, str]): Optional. User-provided metadata, in key/value pairs. - contexts (google.cloud.storage_v2.types.ObjectContexts): + contexts (google.cloud._storage_v2.types.ObjectContexts): Optional. User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the @@ -4527,10 +4527,10 @@ class Object(proto.Message): will always be set to true or false. This field is a member of `oneof`_ ``_event_based_hold``. - owner (google.cloud.storage_v2.types.Owner): + owner (google.cloud._storage_v2.types.Owner): Output only. The owner of the object. This will always be the uploader of the object. - customer_encryption (google.cloud.storage_v2.types.CustomerEncryption): + customer_encryption (google.cloud._storage_v2.types.CustomerEncryption): Optional. Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key. @@ -4554,7 +4554,7 @@ class Object(proto.Message): accessible. This field is a member of `oneof`_ ``_hard_delete_time``. - retention (google.cloud.storage_v2.types.Object.Retention): + retention (google.cloud._storage_v2.types.Object.Retention): Optional. Retention configuration of this object. May only be configured if the bucket has object retention enabled. @@ -4566,7 +4566,7 @@ class Retention(proto.Message): expires. Attributes: - mode (google.cloud.storage_v2.types.Object.Retention.Mode): + mode (google.cloud._storage_v2.types.Object.Retention.Mode): Optional. The mode of the Retention. retain_until_time (google.protobuf.timestamp_pb2.Timestamp): Optional. The timestamp that the object needs @@ -4812,7 +4812,7 @@ class ObjectAccessControl(proto.Message): domain (str): Optional. The domain associated with the entity, if any. - project_team (google.cloud.storage_v2.types.ProjectTeam): + project_team (google.cloud._storage_v2.types.ProjectTeam): Optional. The project team associated with the entity, if any. """ @@ -4860,7 +4860,7 @@ class ListObjectsResponse(proto.Message): r"""The result of a call to Objects.ListObjects Attributes: - objects (MutableSequence[google.cloud.storage_v2.types.Object]): + objects (MutableSequence[google.cloud._storage_v2.types.Object]): The list of items. prefixes (MutableSequence[str]): The list of prefixes of objects diff --git a/tests/unit/gapic/storage_v2/test_storage.py b/tests/unit/gapic/storage_v2/test_storage.py index 4869eba7f..e6344192b 100644 --- a/tests/unit/gapic/storage_v2/test_storage.py +++ b/tests/unit/gapic/storage_v2/test_storage.py @@ -47,11 +47,11 @@ from google.api_core import retry as retries from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.storage_v2.services.storage import StorageAsyncClient -from google.cloud.storage_v2.services.storage import StorageClient -from google.cloud.storage_v2.services.storage import pagers -from google.cloud.storage_v2.services.storage import transports -from google.cloud.storage_v2.types import storage +from google.cloud._storage_v2.services.storage import StorageAsyncClient +from google.cloud._storage_v2.services.storage import StorageClient +from google.cloud._storage_v2.services.storage import pagers +from google.cloud._storage_v2.services.storage import transports +from google.cloud._storage_v2.types import storage from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -950,7 +950,7 @@ def test_storage_client_client_options_credentials_file( def test_storage_client_client_options_from_dict(): with mock.patch( - "google.cloud.storage_v2.services.storage.transports.StorageGrpcTransport.__init__" + "google.cloud._storage_v2.services.storage.transports.StorageGrpcTransport.__init__" ) as grpc_transport: grpc_transport.return_value = None client = StorageClient(client_options={"api_endpoint": "squid.clam.whelk"}) @@ -10868,7 +10868,7 @@ def test_storage_base_transport_error(): def test_storage_base_transport(): # Instantiate the base transport. with mock.patch( - "google.cloud.storage_v2.services.storage.transports.StorageTransport.__init__" + "google.cloud._storage_v2.services.storage.transports.StorageTransport.__init__" ) as Transport: Transport.return_value = None transport = transports.StorageTransport( @@ -10924,7 +10924,7 @@ def test_storage_base_transport_with_credentials_file(): with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True ) as load_creds, mock.patch( - "google.cloud.storage_v2.services.storage.transports.StorageTransport._prep_wrapped_messages" + "google.cloud._storage_v2.services.storage.transports.StorageTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) @@ -10949,7 +10949,7 @@ def test_storage_base_transport_with_credentials_file(): def test_storage_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( - "google.cloud.storage_v2.services.storage.transports.StorageTransport._prep_wrapped_messages" + "google.cloud._storage_v2.services.storage.transports.StorageTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None adc.return_value = (ga_credentials.AnonymousCredentials(), None)