Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

chore: upgrade gapic-generator-python to 0.43.2 #12

Closed
wants to merge 4 commits into from
Closed
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 @@ -40,7 +40,7 @@
from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag
from google.cloud.artifactregistry_v1beta2.types import version
from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore
from google.iam.v1 import policy_pb2 as policy # type: ignore
from google.iam.v1 import policy_pb2 as giv_policy # type: ignore
from google.protobuf import empty_pb2 as empty # type: ignore
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
from google.protobuf import timestamp_pb2 as timestamp # type: ignore
Expand Down Expand Up @@ -1771,7 +1771,7 @@ async def set_iam_policy(
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy.Policy:
) -> giv_policy.Policy:
r"""Updates the IAM policy for a given resource.

Args:
Expand Down Expand Up @@ -1878,7 +1878,7 @@ async def get_iam_policy(
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy.Policy:
) -> giv_policy.Policy:
r"""Gets the IAM policy for a given resource.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag
from google.cloud.artifactregistry_v1beta2.types import version
from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore
from google.iam.v1 import policy_pb2 as policy # type: ignore
from google.iam.v1 import policy_pb2 as giv_policy # type: ignore
from google.protobuf import empty_pb2 as empty # type: ignore
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
from google.protobuf import timestamp_pb2 as timestamp # type: ignore
Expand Down Expand Up @@ -1879,7 +1879,7 @@ def set_iam_policy(
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy.Policy:
) -> giv_policy.Policy:
r"""Updates the IAM policy for a given resource.

Args:
Expand Down Expand Up @@ -1985,7 +1985,7 @@ def get_iam_policy(
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy.Policy:
) -> giv_policy.Policy:
r"""Gets the IAM policy for a given resource.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag
from google.cloud.artifactregistry_v1beta2.types import version
from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore
from google.iam.v1 import policy_pb2 as policy # type: ignore
from google.iam.v1 import policy_pb2 as giv_policy # type: ignore
from google.longrunning import operations_pb2 as operations # type: ignore
from google.protobuf import empty_pb2 as empty # type: ignore

Expand Down Expand Up @@ -500,7 +500,7 @@ def set_iam_policy(
self,
) -> typing.Callable[
[iam_policy.SetIamPolicyRequest],
typing.Union[policy.Policy, typing.Awaitable[policy.Policy]],
typing.Union[giv_policy.Policy, typing.Awaitable[giv_policy.Policy]],
]:
raise NotImplementedError()

Expand All @@ -509,7 +509,7 @@ def get_iam_policy(
self,
) -> typing.Callable[
[iam_policy.GetIamPolicyRequest],
typing.Union[policy.Policy, typing.Awaitable[policy.Policy]],
typing.Union[giv_policy.Policy, typing.Awaitable[giv_policy.Policy]],
]:
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag
from google.cloud.artifactregistry_v1beta2.types import version
from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore
from google.iam.v1 import policy_pb2 as policy # type: ignore
from google.iam.v1 import policy_pb2 as giv_policy # type: ignore
from google.longrunning import operations_pb2 as operations # type: ignore
from google.protobuf import empty_pb2 as empty # type: ignore

Expand Down Expand Up @@ -723,7 +723,7 @@ def delete_tag(self) -> Callable[[tag.DeleteTagRequest], empty.Empty]:
@property
def set_iam_policy(
self,
) -> Callable[[iam_policy.SetIamPolicyRequest], policy.Policy]:
) -> Callable[[iam_policy.SetIamPolicyRequest], giv_policy.Policy]:
r"""Return a callable for the set iam policy method over gRPC.

Updates the IAM policy for a given resource.
Expand All @@ -742,14 +742,14 @@ def set_iam_policy(
self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary(
"/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy",
request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString,
response_deserializer=policy.Policy.FromString,
response_deserializer=giv_policy.Policy.FromString,
)
return self._stubs["set_iam_policy"]

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

Gets the IAM policy for a given resource.
Expand All @@ -768,7 +768,7 @@ def get_iam_policy(
self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary(
"/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy",
request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString,
response_deserializer=policy.Policy.FromString,
response_deserializer=giv_policy.Policy.FromString,
)
return self._stubs["get_iam_policy"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag
from google.cloud.artifactregistry_v1beta2.types import version
from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore
from google.iam.v1 import policy_pb2 as policy # type: ignore
from google.iam.v1 import policy_pb2 as giv_policy # type: ignore
from google.longrunning import operations_pb2 as operations # type: ignore
from google.protobuf import empty_pb2 as empty # type: ignore

Expand Down Expand Up @@ -752,7 +752,7 @@ def delete_tag(self) -> Callable[[tag.DeleteTagRequest], Awaitable[empty.Empty]]
@property
def set_iam_policy(
self,
) -> Callable[[iam_policy.SetIamPolicyRequest], Awaitable[policy.Policy]]:
) -> Callable[[iam_policy.SetIamPolicyRequest], Awaitable[giv_policy.Policy]]:
r"""Return a callable for the set iam policy method over gRPC.

Updates the IAM policy for a given resource.
Expand All @@ -771,14 +771,14 @@ def set_iam_policy(
self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary(
"/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy",
request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString,
response_deserializer=policy.Policy.FromString,
response_deserializer=giv_policy.Policy.FromString,
)
return self._stubs["set_iam_policy"]

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

Gets the IAM policy for a given resource.
Expand All @@ -797,7 +797,7 @@ def get_iam_policy(
self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary(
"/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy",
request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString,
response_deserializer=policy.Policy.FromString,
response_deserializer=giv_policy.Policy.FromString,
)
return self._stubs["get_iam_policy"]

Expand Down
4 changes: 2 additions & 2 deletions scripts/fixup_artifactregistry_v1beta2_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class artifactregistryCallTransformer(cst.CSTTransformer):
'delete_tag': ('name', ),
'delete_version': ('name', 'force', ),
'get_file': ('name', ),
'get_iam_policy': ('resource', 'options', ),
'get_iam_policy': ('resource', 'options_', ),
'get_package': ('name', ),
'get_repository': ('name', ),
'get_tag': ('name', ),
Expand All @@ -58,7 +58,7 @@ class artifactregistryCallTransformer(cst.CSTTransformer):
'list_repositories': ('parent', 'page_size', 'page_token', ),
'list_tags': ('parent', 'filter', 'page_size', 'page_token', ),
'list_versions': ('parent', 'page_size', 'page_token', 'view', ),
'set_iam_policy': ('resource', 'policy', ),
'set_iam_policy': ('resource', 'policy_', ),
'test_iam_permissions': ('resource', 'permissions', ),
'update_repository': ('repository', 'update_mask', ),
'update_tag': ('tag', 'update_mask', ),
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "6598bb829c9e9a534be674649ffd1b4671a821f9",
"internalRef": "364449524"
"sha": "2490be32f08cccc870862ea86920f58325795c89",
"internalRef": "366826395"
}
},
{
Expand Down
36 changes: 18 additions & 18 deletions tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag
from google.cloud.artifactregistry_v1beta2.types import version
from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore
from google.iam.v1 import options_pb2 as options # type: ignore
from google.iam.v1 import policy_pb2 as policy # type: ignore
from google.iam.v1 import options_pb2 as giv_options # type: ignore
from google.iam.v1 import policy_pb2 as giv_policy # type: ignore
from google.longrunning import operations_pb2
from google.oauth2 import service_account
from google.protobuf import field_mask_pb2 as field_mask # type: ignore
Expand Down Expand Up @@ -5073,7 +5073,7 @@ def test_set_iam_policy(
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = policy.Policy(version=774, etag=b"etag_blob",)
call.return_value = giv_policy.Policy(version=774, etag=b"etag_blob",)

response = client.set_iam_policy(request)

Expand All @@ -5085,7 +5085,7 @@ def test_set_iam_policy(

# Establish that the response is the type that we expect.

assert isinstance(response, policy.Policy)
assert isinstance(response, giv_policy.Policy)

assert response.version == 774

Expand Down Expand Up @@ -5128,7 +5128,7 @@ async def test_set_iam_policy_async(
with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
policy.Policy(version=774, etag=b"etag_blob",)
giv_policy.Policy(version=774, etag=b"etag_blob",)
)

response = await client.set_iam_policy(request)
Expand All @@ -5140,7 +5140,7 @@ async def test_set_iam_policy_async(
assert args[0] == iam_policy.SetIamPolicyRequest()

# Establish that the response is the type that we expect.
assert isinstance(response, policy.Policy)
assert isinstance(response, giv_policy.Policy)

assert response.version == 774

Expand All @@ -5162,7 +5162,7 @@ def test_set_iam_policy_field_headers():

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call:
call.return_value = policy.Policy()
call.return_value = giv_policy.Policy()

client.set_iam_policy(request)

Expand All @@ -5189,7 +5189,7 @@ async def test_set_iam_policy_field_headers_async():

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call:
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy())
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy())

await client.set_iam_policy(request)

Expand All @@ -5208,12 +5208,12 @@ def test_set_iam_policy_from_dict_foreign():
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = policy.Policy()
call.return_value = giv_policy.Policy()

response = client.set_iam_policy(
request={
"resource": "resource_value",
"policy": policy.Policy(version=774),
"policy_": giv_policy.Policy(version=774),
}
)
call.assert_called()
Expand All @@ -5233,7 +5233,7 @@ def test_get_iam_policy(
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = policy.Policy(version=774, etag=b"etag_blob",)
call.return_value = giv_policy.Policy(version=774, etag=b"etag_blob",)

response = client.get_iam_policy(request)

Expand All @@ -5245,7 +5245,7 @@ def test_get_iam_policy(

# Establish that the response is the type that we expect.

assert isinstance(response, policy.Policy)
assert isinstance(response, giv_policy.Policy)

assert response.version == 774

Expand Down Expand Up @@ -5288,7 +5288,7 @@ async def test_get_iam_policy_async(
with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
policy.Policy(version=774, etag=b"etag_blob",)
giv_policy.Policy(version=774, etag=b"etag_blob",)
)

response = await client.get_iam_policy(request)
Expand All @@ -5300,7 +5300,7 @@ async def test_get_iam_policy_async(
assert args[0] == iam_policy.GetIamPolicyRequest()

# Establish that the response is the type that we expect.
assert isinstance(response, policy.Policy)
assert isinstance(response, giv_policy.Policy)

assert response.version == 774

Expand All @@ -5322,7 +5322,7 @@ def test_get_iam_policy_field_headers():

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call:
call.return_value = policy.Policy()
call.return_value = giv_policy.Policy()

client.get_iam_policy(request)

Expand All @@ -5349,7 +5349,7 @@ async def test_get_iam_policy_field_headers_async():

# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call:
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy())
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy())

await client.get_iam_policy(request)

Expand All @@ -5368,12 +5368,12 @@ def test_get_iam_policy_from_dict_foreign():
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = policy.Policy()
call.return_value = giv_policy.Policy()

response = client.get_iam_policy(
request={
"resource": "resource_value",
"options": options.GetPolicyOptions(requested_policy_version=2598),
"options_": giv_options.GetPolicyOptions(requested_policy_version=2598),
}
)
call.assert_called()
Expand Down