Skip to content

Commit 0f94b9e

Browse files
authored
fix: regenerate pb2 files with protoc v25.3 (#14663)
Similar to #14569 This PR - adds *.proto files to `packages/grpc-google-iam-v1` for consistency with what we have in `googleapis-common-protos`: https://github.com/googleapis/google-cloud-python/tree/main/packages/googleapis-common-protos/google/api - uses `protoc v25.3` for consistency with what we have in `googleapis-common-protos`: https://github.com/googleapis/google-cloud-python/tree/main/packages/googleapis-common-protos/google/api - Adds `*.pyi` files for consistency with what we have in `googleapis-common-protos`: https://github.com/googleapis/google-cloud-python/tree/main/packages/googleapis-common-protos/google/api Towards googleapis/librarian#1061 BEGIN_COMMIT_OVERRIDE fix: regenerate pb2 files with protoc v25.3 feat: add support for Python 3.14 END_COMMIT_OVERRIDE
1 parent 5cc35a8 commit 0f94b9e

16 files changed

+1045
-42
lines changed

packages/grpc-google-iam-v1/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Code-Based Examples
162162
163163
import logging
164164
165-
from google.cloud.translate_v3 import translate
165+
from google.cloud import library_v1
166166
167167
base_logger = logging.getLogger("google")
168168
base_logger.addHandler(logging.StreamHandler())
@@ -174,7 +174,7 @@ Code-Based Examples
174174
175175
import logging
176176
177-
from google.cloud.translate_v3 import translate
177+
from google.cloud import library_v1
178178
179179
base_logger = logging.getLogger("google.cloud.library_v1")
180180
base_logger.addHandler(logging.StreamHandler())
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.iam.v1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
import "google/iam/v1/options.proto";
24+
import "google/iam/v1/policy.proto";
25+
import "google/protobuf/field_mask.proto";
26+
27+
option csharp_namespace = "Google.Cloud.Iam.V1";
28+
option go_package = "cloud.google.com/go/iam/apiv1/iampb;iampb";
29+
option java_multiple_files = true;
30+
option java_outer_classname = "IamPolicyProto";
31+
option java_package = "com.google.iam.v1";
32+
option php_namespace = "Google\\Cloud\\Iam\\V1";
33+
34+
// API Overview
35+
//
36+
// Manages Identity and Access Management (IAM) policies.
37+
//
38+
// Any implementation of an API that offers access control features
39+
// implements the google.iam.v1.IAMPolicy interface.
40+
//
41+
// ## Data model
42+
//
43+
// Access control is applied when a principal (user or service account), takes
44+
// some action on a resource exposed by a service. Resources, identified by
45+
// URI-like names, are the unit of access control specification. Service
46+
// implementations can choose the granularity of access control and the
47+
// supported permissions for their resources.
48+
// For example one database service may allow access control to be
49+
// specified only at the Table level, whereas another might allow access control
50+
// to also be specified at the Column level.
51+
//
52+
// ## Policy Structure
53+
//
54+
// See google.iam.v1.Policy
55+
//
56+
// This is intentionally not a CRUD style API because access control policies
57+
// are created and deleted implicitly with the resources to which they are
58+
// attached.
59+
service IAMPolicy {
60+
option (google.api.default_host) = "iam-meta-api.googleapis.com";
61+
62+
// Sets the access control policy on the specified resource. Replaces any
63+
// existing policy.
64+
//
65+
// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
66+
rpc SetIamPolicy(SetIamPolicyRequest) returns (Policy) {
67+
option (google.api.http) = {
68+
post: "/v1/{resource=**}:setIamPolicy"
69+
body: "*"
70+
};
71+
}
72+
73+
// Gets the access control policy for a resource.
74+
// Returns an empty policy if the resource exists and does not have a policy
75+
// set.
76+
rpc GetIamPolicy(GetIamPolicyRequest) returns (Policy) {
77+
option (google.api.http) = {
78+
post: "/v1/{resource=**}:getIamPolicy"
79+
body: "*"
80+
};
81+
}
82+
83+
// Returns permissions that a caller has on the specified resource.
84+
// If the resource does not exist, this will return an empty set of
85+
// permissions, not a `NOT_FOUND` error.
86+
//
87+
// Note: This operation is designed to be used for building permission-aware
88+
// UIs and command-line tools, not for authorization checking. This operation
89+
// may "fail open" without warning.
90+
rpc TestIamPermissions(TestIamPermissionsRequest)
91+
returns (TestIamPermissionsResponse) {
92+
option (google.api.http) = {
93+
post: "/v1/{resource=**}:testIamPermissions"
94+
body: "*"
95+
};
96+
}
97+
}
98+
99+
// Request message for `SetIamPolicy` method.
100+
message SetIamPolicyRequest {
101+
// REQUIRED: The resource for which the policy is being specified.
102+
// See the operation documentation for the appropriate value for this field.
103+
string resource = 1 [
104+
(google.api.field_behavior) = REQUIRED,
105+
(google.api.resource_reference).type = "*"
106+
];
107+
108+
// REQUIRED: The complete policy to be applied to the `resource`. The size of
109+
// the policy is limited to a few 10s of KB. An empty policy is a
110+
// valid policy but certain Cloud Platform services (such as Projects)
111+
// might reject them.
112+
Policy policy = 2 [(google.api.field_behavior) = REQUIRED];
113+
114+
// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
115+
// the fields in the mask will be modified. If no mask is provided, the
116+
// following default mask is used:
117+
//
118+
// `paths: "bindings, etag"`
119+
google.protobuf.FieldMask update_mask = 3;
120+
}
121+
122+
// Request message for `GetIamPolicy` method.
123+
message GetIamPolicyRequest {
124+
// REQUIRED: The resource for which the policy is being requested.
125+
// See the operation documentation for the appropriate value for this field.
126+
string resource = 1 [
127+
(google.api.field_behavior) = REQUIRED,
128+
(google.api.resource_reference).type = "*"
129+
];
130+
131+
// OPTIONAL: A `GetPolicyOptions` object for specifying options to
132+
// `GetIamPolicy`.
133+
GetPolicyOptions options = 2;
134+
}
135+
136+
// Request message for `TestIamPermissions` method.
137+
message TestIamPermissionsRequest {
138+
// REQUIRED: The resource for which the policy detail is being requested.
139+
// See the operation documentation for the appropriate value for this field.
140+
string resource = 1 [
141+
(google.api.field_behavior) = REQUIRED,
142+
(google.api.resource_reference).type = "*"
143+
];
144+
145+
// The set of permissions to check for the `resource`. Permissions with
146+
// wildcards (such as '*' or 'storage.*') are not allowed. For more
147+
// information see
148+
// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
149+
repeated string permissions = 2 [(google.api.field_behavior) = REQUIRED];
150+
}
151+
152+
// Response message for `TestIamPermissions` method.
153+
message TestIamPermissionsResponse {
154+
// A subset of `TestPermissionsRequest.permissions` that the caller is
155+
// allowed.
156+
repeated string permissions = 1;
157+
}

packages/grpc-google-iam-v1/google/iam/v1/iam_policy_pb2.py

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Copyright 2024 Google LLC
3+
# Copyright 2025 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
# Generated by the protocol buffer compiler. DO NOT EDIT!
1818
# source: google/iam/v1/iam_policy.proto
19+
# Protobuf Python Version: 4.25.3
1920
"""Generated protocol buffer code."""
2021
from google.protobuf import descriptor as _descriptor
2122
from google.protobuf import descriptor_pool as _descriptor_pool
@@ -27,14 +28,13 @@
2728
_sym_db = _symbol_database.Default()
2829

2930

30-
from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
3131
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
3232
from google.api import client_pb2 as google_dot_api_dot_client__pb2
33+
from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
3334
from google.api import resource_pb2 as google_dot_api_dot_resource__pb2
34-
from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2
35-
3635
from google.iam.v1 import options_pb2 as google_dot_iam_dot_v1_dot_options__pb2
3736
from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2
37+
from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2
3838

3939
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
4040
b'\n\x1egoogle/iam/v1/iam_policy.proto\x12\rgoogle.iam.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/iam/v1/options.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto"\x8f\x01\n\x13SetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"d\n\x13GetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x30\n\x07options\x18\x02 \x01(\x0b\x32\x1f.google.iam.v1.GetPolicyOptions"R\n\x19TestIamPermissionsRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x18\n\x0bpermissions\x18\x02 \x03(\tB\x03\xe0\x41\x02"1\n\x1aTestIamPermissionsResponse\x12\x13\n\x0bpermissions\x18\x01 \x03(\t2\xb4\x03\n\tIAMPolicy\x12t\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy")\x82\xd3\xe4\x93\x02#"\x1e/v1/{resource=**}:setIamPolicy:\x01*\x12t\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy")\x82\xd3\xe4\x93\x02#"\x1e/v1/{resource=**}:getIamPolicy:\x01*\x12\x9a\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"/\x82\xd3\xe4\x93\x02)"$/v1/{resource=**}:testIamPermissions:\x01*\x1a\x1e\xca\x41\x1biam-meta-api.googleapis.comB|\n\x11\x63om.google.iam.v1B\x0eIamPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3'
@@ -46,42 +46,46 @@
4646
DESCRIPTOR, "google.iam.v1.iam_policy_pb2", _globals
4747
)
4848
if _descriptor._USE_C_DESCRIPTORS == False:
49-
DESCRIPTOR._options = None
50-
DESCRIPTOR._serialized_options = b"\n\021com.google.iam.v1B\016IamPolicyProtoP\001Z)cloud.google.com/go/iam/apiv1/iampb;iampb\252\002\023Google.Cloud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V1"
51-
_SETIAMPOLICYREQUEST.fields_by_name["resource"]._options = None
52-
_SETIAMPOLICYREQUEST.fields_by_name[
49+
_globals["DESCRIPTOR"]._options = None
50+
_globals[
51+
"DESCRIPTOR"
52+
]._serialized_options = b"\n\021com.google.iam.v1B\016IamPolicyProtoP\001Z)cloud.google.com/go/iam/apiv1/iampb;iampb\252\002\023Google.Cloud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V1"
53+
_globals["_SETIAMPOLICYREQUEST"].fields_by_name["resource"]._options = None
54+
_globals["_SETIAMPOLICYREQUEST"].fields_by_name[
5355
"resource"
5456
]._serialized_options = b"\340A\002\372A\003\n\001*"
55-
_SETIAMPOLICYREQUEST.fields_by_name["policy"]._options = None
56-
_SETIAMPOLICYREQUEST.fields_by_name["policy"]._serialized_options = b"\340A\002"
57-
_GETIAMPOLICYREQUEST.fields_by_name["resource"]._options = None
58-
_GETIAMPOLICYREQUEST.fields_by_name[
57+
_globals["_SETIAMPOLICYREQUEST"].fields_by_name["policy"]._options = None
58+
_globals["_SETIAMPOLICYREQUEST"].fields_by_name[
59+
"policy"
60+
]._serialized_options = b"\340A\002"
61+
_globals["_GETIAMPOLICYREQUEST"].fields_by_name["resource"]._options = None
62+
_globals["_GETIAMPOLICYREQUEST"].fields_by_name[
5963
"resource"
6064
]._serialized_options = b"\340A\002\372A\003\n\001*"
61-
_TESTIAMPERMISSIONSREQUEST.fields_by_name["resource"]._options = None
62-
_TESTIAMPERMISSIONSREQUEST.fields_by_name[
65+
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name["resource"]._options = None
66+
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name[
6367
"resource"
6468
]._serialized_options = b"\340A\002\372A\003\n\001*"
65-
_TESTIAMPERMISSIONSREQUEST.fields_by_name["permissions"]._options = None
66-
_TESTIAMPERMISSIONSREQUEST.fields_by_name[
69+
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name["permissions"]._options = None
70+
_globals["_TESTIAMPERMISSIONSREQUEST"].fields_by_name[
6771
"permissions"
6872
]._serialized_options = b"\340A\002"
69-
_IAMPOLICY._options = None
70-
_IAMPOLICY._serialized_options = b"\312A\033iam-meta-api.googleapis.com"
71-
_IAMPOLICY.methods_by_name["SetIamPolicy"]._options = None
72-
_IAMPOLICY.methods_by_name[
73+
_globals["_IAMPOLICY"]._options = None
74+
_globals["_IAMPOLICY"]._serialized_options = b"\312A\033iam-meta-api.googleapis.com"
75+
_globals["_IAMPOLICY"].methods_by_name["SetIamPolicy"]._options = None
76+
_globals["_IAMPOLICY"].methods_by_name[
7377
"SetIamPolicy"
7478
]._serialized_options = (
7579
b'\202\323\344\223\002#"\036/v1/{resource=**}:setIamPolicy:\001*'
7680
)
77-
_IAMPOLICY.methods_by_name["GetIamPolicy"]._options = None
78-
_IAMPOLICY.methods_by_name[
81+
_globals["_IAMPOLICY"].methods_by_name["GetIamPolicy"]._options = None
82+
_globals["_IAMPOLICY"].methods_by_name[
7983
"GetIamPolicy"
8084
]._serialized_options = (
8185
b'\202\323\344\223\002#"\036/v1/{resource=**}:getIamPolicy:\001*'
8286
)
83-
_IAMPOLICY.methods_by_name["TestIamPermissions"]._options = None
84-
_IAMPOLICY.methods_by_name[
87+
_globals["_IAMPOLICY"].methods_by_name["TestIamPermissions"]._options = None
88+
_globals["_IAMPOLICY"].methods_by_name[
8589
"TestIamPermissions"
8690
]._serialized_options = (
8791
b'\202\323\344\223\002)"$/v1/{resource=**}:testIamPermissions:\001*'
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from typing import ClassVar as _ClassVar
16+
from typing import Iterable as _Iterable
17+
from typing import Mapping as _Mapping
18+
from typing import Optional as _Optional
19+
from typing import Union as _Union
20+
21+
from google.api import annotations_pb2 as _annotations_pb2
22+
from google.api import client_pb2 as _client_pb2
23+
from google.api import field_behavior_pb2 as _field_behavior_pb2
24+
from google.api import resource_pb2 as _resource_pb2
25+
from google.iam.v1 import options_pb2 as _options_pb2
26+
from google.iam.v1 import policy_pb2 as _policy_pb2
27+
from google.protobuf import descriptor as _descriptor
28+
from google.protobuf import field_mask_pb2 as _field_mask_pb2
29+
from google.protobuf import message as _message
30+
from google.protobuf.internal import containers as _containers
31+
32+
DESCRIPTOR: _descriptor.FileDescriptor
33+
34+
class SetIamPolicyRequest(_message.Message):
35+
__slots__ = ("resource", "policy", "update_mask")
36+
RESOURCE_FIELD_NUMBER: _ClassVar[int]
37+
POLICY_FIELD_NUMBER: _ClassVar[int]
38+
UPDATE_MASK_FIELD_NUMBER: _ClassVar[int]
39+
resource: str
40+
policy: _policy_pb2.Policy
41+
update_mask: _field_mask_pb2.FieldMask
42+
def __init__(
43+
self,
44+
resource: _Optional[str] = ...,
45+
policy: _Optional[_Union[_policy_pb2.Policy, _Mapping]] = ...,
46+
update_mask: _Optional[_Union[_field_mask_pb2.FieldMask, _Mapping]] = ...,
47+
) -> None: ...
48+
49+
class GetIamPolicyRequest(_message.Message):
50+
__slots__ = ("resource", "options")
51+
RESOURCE_FIELD_NUMBER: _ClassVar[int]
52+
OPTIONS_FIELD_NUMBER: _ClassVar[int]
53+
resource: str
54+
options: _options_pb2.GetPolicyOptions
55+
def __init__(
56+
self,
57+
resource: _Optional[str] = ...,
58+
options: _Optional[_Union[_options_pb2.GetPolicyOptions, _Mapping]] = ...,
59+
) -> None: ...
60+
61+
class TestIamPermissionsRequest(_message.Message):
62+
__slots__ = ("resource", "permissions")
63+
RESOURCE_FIELD_NUMBER: _ClassVar[int]
64+
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
65+
resource: str
66+
permissions: _containers.RepeatedScalarFieldContainer[str]
67+
def __init__(
68+
self,
69+
resource: _Optional[str] = ...,
70+
permissions: _Optional[_Iterable[str]] = ...,
71+
) -> None: ...
72+
73+
class TestIamPermissionsResponse(_message.Message):
74+
__slots__ = ("permissions",)
75+
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
76+
permissions: _containers.RepeatedScalarFieldContainer[str]
77+
def __init__(self, permissions: _Optional[_Iterable[str]] = ...) -> None: ...

0 commit comments

Comments
 (0)