Skip to content

Commit 33b1d93

Browse files
feat: [google-cloud-artifact-registry] add the GoModule and KfpArtifact resources (googleapis#13725)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: add the GoModule and KfpArtifact resources docs: remove the restriction of the maximum numbers of versions that can be deleted in one BatchDeleteVersions call END_COMMIT_OVERRIDE docs: remove the restriction of the maximum numbers of versions that can be deleted in one BatchDeleteVersions call PiperOrigin-RevId: 742735969 Source-Link: googleapis/googleapis@fec747a Source-Link: https://github.com/googleapis/googleapis-gen/commit/82b6718201ce7df6bd308931c383eef0b54beee7 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFydGlmYWN0LXJlZ2lzdHJ5Ly5Pd2xCb3QueWFtbCIsImgiOiI4MmI2NzE4MjAxY2U3ZGY2YmQzMDg5MzFjMzgzZWVmMGI1NGJlZWU3In0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 4da3cf3 commit 33b1d93

File tree

10 files changed

+173
-6
lines changed

10 files changed

+173
-6
lines changed

packages/google-cloud-artifact-registry/google/cloud/artifactregistry/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
UpdateFileRequest,
6969
)
7070
from google.cloud.artifactregistry_v1.types.generic import GenericArtifact
71+
from google.cloud.artifactregistry_v1.types.go import GoModule
72+
from google.cloud.artifactregistry_v1.types.kfp_artifact import KfpArtifact
7173
from google.cloud.artifactregistry_v1.types.package import (
7274
DeletePackageRequest,
7375
GetPackageRequest,
@@ -179,6 +181,8 @@
179181
"ListFilesResponse",
180182
"UpdateFileRequest",
181183
"GenericArtifact",
184+
"GoModule",
185+
"KfpArtifact",
182186
"DeletePackageRequest",
183187
"GetPackageRequest",
184188
"ListPackagesRequest",

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
UpdateFileRequest,
6767
)
6868
from .types.generic import GenericArtifact
69+
from .types.go import GoModule
70+
from .types.kfp_artifact import KfpArtifact
6971
from .types.package import (
7072
DeletePackageRequest,
7173
GetPackageRequest,
@@ -175,6 +177,7 @@
175177
"GetTagRequest",
176178
"GetVPCSCConfigRequest",
177179
"GetVersionRequest",
180+
"GoModule",
178181
"Hash",
179182
"ImportAptArtifactsErrorInfo",
180183
"ImportAptArtifactsGcsSource",
@@ -186,6 +189,7 @@
186189
"ImportYumArtifactsMetadata",
187190
"ImportYumArtifactsRequest",
188191
"ImportYumArtifactsResponse",
192+
"KfpArtifact",
189193
"ListAttachmentsRequest",
190194
"ListAttachmentsResponse",
191195
"ListDockerImagesRequest",

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,8 +2967,10 @@ async def sample_batch_delete_versions():
29672967
should not be set.
29682968
names (:class:`MutableSequence[str]`):
29692969
Required. The names of the versions
2970-
to delete. A maximum of 10000 versions
2971-
can be deleted in a batch.
2970+
to delete. The maximum number of
2971+
versions deleted per batch is determined
2972+
by the service and is dependent on the
2973+
available resources in the region.
29722974
29732975
This corresponds to the ``names`` field
29742976
on the ``request`` instance; if ``request`` is provided, this

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/services/artifact_registry/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,8 +3634,10 @@ def sample_batch_delete_versions():
36343634
should not be set.
36353635
names (MutableSequence[str]):
36363636
Required. The names of the versions
3637-
to delete. A maximum of 10000 versions
3638-
can be deleted in a batch.
3637+
to delete. The maximum number of
3638+
versions deleted per batch is determined
3639+
by the service and is dependent on the
3640+
available resources in the region.
36393641
36403642
This corresponds to the ``names`` field
36413643
on the ``request`` instance; if ``request`` is provided, this

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
UpdateFileRequest,
5858
)
5959
from .generic import GenericArtifact
60+
from .go import GoModule
61+
from .kfp_artifact import KfpArtifact
6062
from .package import (
6163
DeletePackageRequest,
6264
GetPackageRequest,
@@ -162,6 +164,8 @@
162164
"ListFilesResponse",
163165
"UpdateFileRequest",
164166
"GenericArtifact",
167+
"GoModule",
168+
"KfpArtifact",
165169
"DeletePackageRequest",
166170
"GetPackageRequest",
167171
"ListPackagesRequest",
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from __future__ import annotations
17+
18+
from typing import MutableMapping, MutableSequence
19+
20+
from google.protobuf import timestamp_pb2 # type: ignore
21+
import proto # type: ignore
22+
23+
__protobuf__ = proto.module(
24+
package="google.devtools.artifactregistry.v1",
25+
manifest={
26+
"GoModule",
27+
},
28+
)
29+
30+
31+
class GoModule(proto.Message):
32+
r"""GoModule represents a Go module.
33+
34+
Attributes:
35+
name (str):
36+
The resource name of a Go module.
37+
version (str):
38+
The version of the Go module. Must be a valid
39+
canonical version as defined in
40+
https://go.dev/ref/mod#glos-canonical-version.
41+
create_time (google.protobuf.timestamp_pb2.Timestamp):
42+
Output only. The time when the Go module is
43+
created.
44+
update_time (google.protobuf.timestamp_pb2.Timestamp):
45+
Output only. The time when the Go module is
46+
updated.
47+
"""
48+
49+
name: str = proto.Field(
50+
proto.STRING,
51+
number=1,
52+
)
53+
version: str = proto.Field(
54+
proto.STRING,
55+
number=2,
56+
)
57+
create_time: timestamp_pb2.Timestamp = proto.Field(
58+
proto.MESSAGE,
59+
number=3,
60+
message=timestamp_pb2.Timestamp,
61+
)
62+
update_time: timestamp_pb2.Timestamp = proto.Field(
63+
proto.MESSAGE,
64+
number=4,
65+
message=timestamp_pb2.Timestamp,
66+
)
67+
68+
69+
__all__ = tuple(sorted(__protobuf__.manifest))
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from __future__ import annotations
17+
18+
from typing import MutableMapping, MutableSequence
19+
20+
import proto # type: ignore
21+
22+
__protobuf__ = proto.module(
23+
package="google.devtools.artifactregistry.v1",
24+
manifest={
25+
"KfpArtifact",
26+
},
27+
)
28+
29+
30+
class KfpArtifact(proto.Message):
31+
r"""A detailed representation of a KFP artifact.
32+
33+
Attributes:
34+
name (str):
35+
Output only. Resource name of the KFP
36+
artifact. Since users don't directly interact
37+
with this resource, the name will be derived
38+
from the associated version. For example, when
39+
version = ".../versions/sha256:abcdef...", the
40+
name will be
41+
".../kfpArtifacts/sha256:abcdef...".
42+
version (str):
43+
The version associated with the KFP artifact.
44+
Must follow the Semantic Versioning standard.
45+
"""
46+
47+
name: str = proto.Field(
48+
proto.STRING,
49+
number=1,
50+
)
51+
version: str = proto.Field(
52+
proto.STRING,
53+
number=2,
54+
)
55+
56+
57+
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/types/repository.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,9 @@ class Repository(proto.Message):
992992
satisfies_pzi (bool):
993993
Output only. If set, the repository satisfies
994994
physical zone isolation.
995+
registry_uri (str):
996+
Output only. The repository endpoint, for example:
997+
``us-docker.pkg.dev/my-proj/my-repo``.
995998
"""
996999

9971000
class Format(proto.Enum):
@@ -1289,6 +1292,10 @@ class EnablementState(proto.Enum):
12891292
proto.BOOL,
12901293
number=22,
12911294
)
1295+
registry_uri: str = proto.Field(
1296+
proto.STRING,
1297+
number=26,
1298+
)
12921299

12931300

12941301
class ListRepositoriesRequest(proto.Message):

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/types/version.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,10 @@ class BatchDeleteVersionsRequest(proto.Message):
304304
requested versions.
305305
names (MutableSequence[str]):
306306
Required. The names of the versions to
307-
delete. A maximum of 10000 versions can be
308-
deleted in a batch.
307+
delete. The maximum number of versions deleted
308+
per batch is determined by the service and is
309+
dependent on the available resources in the
310+
region.
309311
validate_only (bool):
310312
If true, the request is performed without
311313
deleting data, following AIP-163.

packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5839,6 +5839,7 @@ def test_get_repository(request_type, transport: str = "grpc"):
58395839
cleanup_policy_dry_run=True,
58405840
disallow_unspecified_mode=True,
58415841
satisfies_pzi=True,
5842+
registry_uri="registry_uri_value",
58425843
)
58435844
response = client.get_repository(request)
58445845

@@ -5860,6 +5861,7 @@ def test_get_repository(request_type, transport: str = "grpc"):
58605861
assert response.cleanup_policy_dry_run is True
58615862
assert response.disallow_unspecified_mode is True
58625863
assert response.satisfies_pzi is True
5864+
assert response.registry_uri == "registry_uri_value"
58635865

58645866

58655867
def test_get_repository_non_empty_request_with_auto_populated_field():
@@ -5995,6 +5997,7 @@ async def test_get_repository_async(
59955997
cleanup_policy_dry_run=True,
59965998
disallow_unspecified_mode=True,
59975999
satisfies_pzi=True,
6000+
registry_uri="registry_uri_value",
59986001
)
59996002
)
60006003
response = await client.get_repository(request)
@@ -6017,6 +6020,7 @@ async def test_get_repository_async(
60176020
assert response.cleanup_policy_dry_run is True
60186021
assert response.disallow_unspecified_mode is True
60196022
assert response.satisfies_pzi is True
6023+
assert response.registry_uri == "registry_uri_value"
60206024

60216025

60226026
@pytest.mark.asyncio
@@ -6589,6 +6593,7 @@ def test_update_repository(request_type, transport: str = "grpc"):
65896593
cleanup_policy_dry_run=True,
65906594
disallow_unspecified_mode=True,
65916595
satisfies_pzi=True,
6596+
registry_uri="registry_uri_value",
65926597
)
65936598
response = client.update_repository(request)
65946599

@@ -6610,6 +6615,7 @@ def test_update_repository(request_type, transport: str = "grpc"):
66106615
assert response.cleanup_policy_dry_run is True
66116616
assert response.disallow_unspecified_mode is True
66126617
assert response.satisfies_pzi is True
6618+
assert response.registry_uri == "registry_uri_value"
66136619

66146620

66156621
def test_update_repository_non_empty_request_with_auto_populated_field():
@@ -6747,6 +6753,7 @@ async def test_update_repository_async(
67476753
cleanup_policy_dry_run=True,
67486754
disallow_unspecified_mode=True,
67496755
satisfies_pzi=True,
6756+
registry_uri="registry_uri_value",
67506757
)
67516758
)
67526759
response = await client.update_repository(request)
@@ -6769,6 +6776,7 @@ async def test_update_repository_async(
67696776
assert response.cleanup_policy_dry_run is True
67706777
assert response.disallow_unspecified_mode is True
67716778
assert response.satisfies_pzi is True
6779+
assert response.registry_uri == "registry_uri_value"
67726780

67736781

67746782
@pytest.mark.asyncio
@@ -29421,6 +29429,7 @@ async def test_get_repository_empty_call_grpc_asyncio():
2942129429
cleanup_policy_dry_run=True,
2942229430
disallow_unspecified_mode=True,
2942329431
satisfies_pzi=True,
29432+
registry_uri="registry_uri_value",
2942429433
)
2942529434
)
2942629435
await client.get_repository(request=None)
@@ -29486,6 +29495,7 @@ async def test_update_repository_empty_call_grpc_asyncio():
2948629495
cleanup_policy_dry_run=True,
2948729496
disallow_unspecified_mode=True,
2948829497
satisfies_pzi=True,
29498+
registry_uri="registry_uri_value",
2948929499
)
2949029500
)
2949129501
await client.update_repository(request=None)
@@ -31984,6 +31994,7 @@ def test_get_repository_rest_call_success(request_type):
3198431994
cleanup_policy_dry_run=True,
3198531995
disallow_unspecified_mode=True,
3198631996
satisfies_pzi=True,
31997+
registry_uri="registry_uri_value",
3198731998
)
3198831999

3198932000
# Wrap the value into a proper Response obj
@@ -32010,6 +32021,7 @@ def test_get_repository_rest_call_success(request_type):
3201032021
assert response.cleanup_policy_dry_run is True
3201132022
assert response.disallow_unspecified_mode is True
3201232023
assert response.satisfies_pzi is True
32024+
assert response.registry_uri == "registry_uri_value"
3201332025

3201432026

3201532027
@pytest.mark.parametrize("null_interceptor", [True, False])
@@ -32182,6 +32194,7 @@ def test_create_repository_rest_call_success(request_type):
3218232194
},
3218332195
"disallow_unspecified_mode": True,
3218432196
"satisfies_pzi": True,
32197+
"registry_uri": "registry_uri_value",
3218532198
}
3218632199
# The version of a generated dependency at test runtime may differ from the version used during generation.
3218732200
# Delete any fields which are not present in the current runtime dependency
@@ -32451,6 +32464,7 @@ def test_update_repository_rest_call_success(request_type):
3245132464
},
3245232465
"disallow_unspecified_mode": True,
3245332466
"satisfies_pzi": True,
32467+
"registry_uri": "registry_uri_value",
3245432468
}
3245532469
# The version of a generated dependency at test runtime may differ from the version used during generation.
3245632470
# Delete any fields which are not present in the current runtime dependency
@@ -32535,6 +32549,7 @@ def get_message_fields(field):
3253532549
cleanup_policy_dry_run=True,
3253632550
disallow_unspecified_mode=True,
3253732551
satisfies_pzi=True,
32552+
registry_uri="registry_uri_value",
3253832553
)
3253932554

3254032555
# Wrap the value into a proper Response obj
@@ -32561,6 +32576,7 @@ def get_message_fields(field):
3256132576
assert response.cleanup_policy_dry_run is True
3256232577
assert response.disallow_unspecified_mode is True
3256332578
assert response.satisfies_pzi is True
32579+
assert response.registry_uri == "registry_uri_value"
3256432580

3256532581

3256632582
@pytest.mark.parametrize("null_interceptor", [True, False])

0 commit comments

Comments
 (0)