Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
"get_folder_intelligence_config"
]
},
"GetIamPolicy": {
"methods": [
"get_iam_policy"
]
},
"GetManagedFolder": {
"methods": [
"get_managed_folder"
Expand Down Expand Up @@ -105,6 +110,16 @@
"resume_anywhere_cache"
]
},
"SetIamPolicy": {
"methods": [
"set_iam_policy"
]
},
"TestIamPermissions": {
"methods": [
"test_iam_permissions"
]
},
"UpdateAnywhereCache": {
"methods": [
"update_anywhere_cache"
Expand Down Expand Up @@ -175,6 +190,11 @@
"get_folder_intelligence_config"
]
},
"GetIamPolicy": {
"methods": [
"get_iam_policy"
]
},
"GetManagedFolder": {
"methods": [
"get_managed_folder"
Expand Down Expand Up @@ -225,6 +245,16 @@
"resume_anywhere_cache"
]
},
"SetIamPolicy": {
"methods": [
"set_iam_policy"
]
},
"TestIamPermissions": {
"methods": [
"test_iam_permissions"
]
},
"UpdateAnywhereCache": {
"methods": [
"update_anywhere_cache"
Expand Down Expand Up @@ -295,6 +325,11 @@
"get_folder_intelligence_config"
]
},
"GetIamPolicy": {
"methods": [
"get_iam_policy"
]
},
"GetManagedFolder": {
"methods": [
"get_managed_folder"
Expand Down Expand Up @@ -345,6 +380,16 @@
"resume_anywhere_cache"
]
},
"SetIamPolicy": {
"methods": [
"set_iam_policy"
]
},
"TestIamPermissions": {
"methods": [
"test_iam_permissions"
]
},
"UpdateAnywhereCache": {
"methods": [
"update_anywhere_cache"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from google.api_core import retry as retries
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
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
from google.oauth2 import service_account # type: ignore
import google.protobuf
Expand Down Expand Up @@ -515,6 +517,21 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=60.0,
client_info=client_info,
),
self.get_iam_policy: gapic_v1.method.wrap_method(
self.get_iam_policy,
default_timeout=None,
client_info=client_info,
),
self.set_iam_policy: gapic_v1.method.wrap_method(
self.set_iam_policy,
default_timeout=None,
client_info=client_info,
),
self.test_iam_permissions: gapic_v1.method.wrap_method(
self.test_iam_permissions,
default_timeout=None,
client_info=client_info,
),
}

def close(self):
Expand Down Expand Up @@ -765,6 +782,36 @@ def update_organization_intelligence_config(
]:
raise NotImplementedError()

@property
def get_iam_policy(
self,
) -> Callable[
[iam_policy_pb2.GetIamPolicyRequest],
Union[policy_pb2.Policy, Awaitable[policy_pb2.Policy]],
]:
raise NotImplementedError()

@property
def set_iam_policy(
self,
) -> Callable[
[iam_policy_pb2.SetIamPolicyRequest],
Union[policy_pb2.Policy, Awaitable[policy_pb2.Policy]],
]:
raise NotImplementedError()

@property
def test_iam_permissions(
self,
) -> Callable[
[iam_policy_pb2.TestIamPermissionsRequest],
Union[
iam_policy_pb2.TestIamPermissionsResponse,
Awaitable[iam_policy_pb2.TestIamPermissionsResponse],
],
]:
raise NotImplementedError()

@property
def kind(self) -> str:
raise NotImplementedError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
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
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf.json_format import MessageToJson
Expand Down Expand Up @@ -1021,6 +1023,102 @@ def update_organization_intelligence_config(
)
return self._stubs["update_organization_intelligence_config"]

@property
def get_iam_policy(
self,
) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]:
r"""Return a callable for the get iam policy method over gRPC.

Gets the IAM policy for a specified bucket. The ``resource``
field in the request should be ``projects/_/buckets/{bucket}``
for a bucket, or
``projects/_/buckets/{bucket}/managedFolders/{managedFolder}``
for a managed folder.

Returns:
Callable[[~.GetIamPolicyRequest],
~.Policy]:
A function that, when called, will call the underlying RPC
on the server.
"""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "get_iam_policy" not in self._stubs:
self._stubs["get_iam_policy"] = self._logged_channel.unary_unary(
"/google.storage.control.v2.StorageControl/GetIamPolicy",
request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString,
response_deserializer=policy_pb2.Policy.FromString,
)
return self._stubs["get_iam_policy"]

@property
def set_iam_policy(
self,
) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]:
r"""Return a callable for the set iam policy method over gRPC.

Updates an IAM policy for the specified bucket. The ``resource``
field in the request should be ``projects/_/buckets/{bucket}``
for a bucket, or
``projects/_/buckets/{bucket}/managedFolders/{managedFolder}``
for a managed folder.

Returns:
Callable[[~.SetIamPolicyRequest],
~.Policy]:
A function that, when called, will call the underlying RPC
on the server.
"""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "set_iam_policy" not in self._stubs:
self._stubs["set_iam_policy"] = self._logged_channel.unary_unary(
"/google.storage.control.v2.StorageControl/SetIamPolicy",
request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString,
response_deserializer=policy_pb2.Policy.FromString,
)
return self._stubs["set_iam_policy"]

@property
def test_iam_permissions(
self,
) -> Callable[
[iam_policy_pb2.TestIamPermissionsRequest],
iam_policy_pb2.TestIamPermissionsResponse,
]:
r"""Return a callable for the test iam permissions method over gRPC.

Tests a set of permissions on the given bucket, object, or
managed folder to see which, if any, are held by the caller. The
``resource`` field in the request should be
``projects/_/buckets/{bucket}`` for a bucket,
``projects/_/buckets/{bucket}/objects/{object}`` for an object,
or
``projects/_/buckets/{bucket}/managedFolders/{managedFolder}``
for a managed folder.

Returns:
Callable[[~.TestIamPermissionsRequest],
~.TestIamPermissionsResponse]:
A function that, when called, will call the underlying RPC
on the server.
"""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "test_iam_permissions" not in self._stubs:
self._stubs["test_iam_permissions"] = self._logged_channel.unary_unary(
"/google.storage.control.v2.StorageControl/TestIamPermissions",
request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString,
response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString,
)
return self._stubs["test_iam_permissions"]

def close(self):
self._logged_channel.close()

Expand Down
Loading
Loading