Skip to content

Commit b9fa436

Browse files
docs: use code font for resource name references (#11916)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE docs: mark the create_time and update_time in the Repository resource as output only fields docs: mark the repository_id and repository fields in the CreateRepository request as required fields feat: add support for virtual and remote repositories feat: add support for cleanup policies feat: add support for Docker immutable tags feat: add support for Go and KFP repositories feat: add support for Physical Zone Separation feat: expose the size of the Repository resource docs: use code font for resource name references END_COMMIT_OVERRIDE Fixes #11682 PiperOrigin-RevId: 576602679 Source-Link: googleapis/googleapis@8755f15 Source-Link: googleapis/googleapis-gen@3ee7f5e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFydGlmYWN0LXJlZ2lzdHJ5Ly5Pd2xCb3QueWFtbCIsImgiOiIzZWU3ZjVlMWJiOWYyM2YyNzI4NzY3ODA2ZWE1OTU4MjA2Nzg2NDgwIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9cd4ccb commit b9fa436

File tree

19 files changed

+2422
-98
lines changed

19 files changed

+2422
-98
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,19 @@
6565
Package,
6666
)
6767
from google.cloud.artifactregistry_v1.types.repository import (
68+
CleanupPolicy,
69+
CleanupPolicyCondition,
70+
CleanupPolicyMostRecentVersions,
6871
CreateRepositoryRequest,
6972
DeleteRepositoryRequest,
7073
GetRepositoryRequest,
7174
ListRepositoriesRequest,
7275
ListRepositoriesResponse,
76+
RemoteRepositoryConfig,
7377
Repository,
7478
UpdateRepositoryRequest,
79+
UpstreamPolicy,
80+
VirtualRepositoryConfig,
7581
)
7682
from google.cloud.artifactregistry_v1.types.service import OperationMetadata
7783
from google.cloud.artifactregistry_v1.types.settings import (
@@ -90,6 +96,7 @@
9096
)
9197
from google.cloud.artifactregistry_v1.types.version import (
9298
BatchDeleteVersionsMetadata,
99+
BatchDeleteVersionsRequest,
93100
DeleteVersionRequest,
94101
GetVersionRequest,
95102
ListVersionsRequest,
@@ -146,13 +153,19 @@
146153
"ListPackagesRequest",
147154
"ListPackagesResponse",
148155
"Package",
156+
"CleanupPolicy",
157+
"CleanupPolicyCondition",
158+
"CleanupPolicyMostRecentVersions",
149159
"CreateRepositoryRequest",
150160
"DeleteRepositoryRequest",
151161
"GetRepositoryRequest",
152162
"ListRepositoriesRequest",
153163
"ListRepositoriesResponse",
164+
"RemoteRepositoryConfig",
154165
"Repository",
155166
"UpdateRepositoryRequest",
167+
"UpstreamPolicy",
168+
"VirtualRepositoryConfig",
156169
"OperationMetadata",
157170
"GetProjectSettingsRequest",
158171
"ProjectSettings",
@@ -165,6 +178,7 @@
165178
"Tag",
166179
"UpdateTagRequest",
167180
"BatchDeleteVersionsMetadata",
181+
"BatchDeleteVersionsRequest",
168182
"DeleteVersionRequest",
169183
"GetVersionRequest",
170184
"ListVersionsRequest",

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,19 @@
5757
Package,
5858
)
5959
from .types.repository import (
60+
CleanupPolicy,
61+
CleanupPolicyCondition,
62+
CleanupPolicyMostRecentVersions,
6063
CreateRepositoryRequest,
6164
DeleteRepositoryRequest,
6265
GetRepositoryRequest,
6366
ListRepositoriesRequest,
6467
ListRepositoriesResponse,
68+
RemoteRepositoryConfig,
6569
Repository,
6670
UpdateRepositoryRequest,
71+
UpstreamPolicy,
72+
VirtualRepositoryConfig,
6773
)
6874
from .types.service import OperationMetadata
6975
from .types.settings import (
@@ -82,6 +88,7 @@
8288
)
8389
from .types.version import (
8490
BatchDeleteVersionsMetadata,
91+
BatchDeleteVersionsRequest,
8592
DeleteVersionRequest,
8693
GetVersionRequest,
8794
ListVersionsRequest,
@@ -108,6 +115,10 @@
108115
"AptArtifact",
109116
"ArtifactRegistryClient",
110117
"BatchDeleteVersionsMetadata",
118+
"BatchDeleteVersionsRequest",
119+
"CleanupPolicy",
120+
"CleanupPolicyCondition",
121+
"CleanupPolicyMostRecentVersions",
111122
"CreateRepositoryRequest",
112123
"CreateTagRequest",
113124
"DeletePackageRequest",
@@ -162,14 +173,17 @@
162173
"Package",
163174
"ProjectSettings",
164175
"PythonPackage",
176+
"RemoteRepositoryConfig",
165177
"Repository",
166178
"Tag",
167179
"UpdateProjectSettingsRequest",
168180
"UpdateRepositoryRequest",
169181
"UpdateTagRequest",
170182
"UpdateVPCSCConfigRequest",
183+
"UpstreamPolicy",
171184
"VPCSCConfig",
172185
"Version",
173186
"VersionView",
187+
"VirtualRepositoryConfig",
174188
"YumArtifact",
175189
)

packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"grpc": {
1111
"libraryClient": "ArtifactRegistryClient",
1212
"rpcs": {
13+
"BatchDeleteVersions": {
14+
"methods": [
15+
"batch_delete_versions"
16+
]
17+
},
1318
"CreateRepository": {
1419
"methods": [
1520
"create_repository"
@@ -190,6 +195,11 @@
190195
"grpc-async": {
191196
"libraryClient": "ArtifactRegistryAsyncClient",
192197
"rpcs": {
198+
"BatchDeleteVersions": {
199+
"methods": [
200+
"batch_delete_versions"
201+
]
202+
},
193203
"CreateRepository": {
194204
"methods": [
195205
"create_repository"
@@ -370,6 +380,11 @@
370380
"rest": {
371381
"libraryClient": "ArtifactRegistryClient",
372382
"rpcs": {
383+
"BatchDeleteVersions": {
384+
"methods": [
385+
"batch_delete_versions"
386+
]
387+
},
373388
"CreateRepository": {
374389
"methods": [
375390
"create_repository"

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

Lines changed: 149 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ class ArtifactRegistryAsyncClient:
119119
)
120120
repository_path = staticmethod(ArtifactRegistryClient.repository_path)
121121
parse_repository_path = staticmethod(ArtifactRegistryClient.parse_repository_path)
122+
secret_version_path = staticmethod(ArtifactRegistryClient.secret_version_path)
123+
parse_secret_version_path = staticmethod(
124+
ArtifactRegistryClient.parse_secret_version_path
125+
)
122126
tag_path = staticmethod(ArtifactRegistryClient.tag_path)
123127
parse_tag_path = staticmethod(ArtifactRegistryClient.parse_tag_path)
124128
version_path = staticmethod(ArtifactRegistryClient.version_path)
@@ -1623,13 +1627,15 @@ async def sample_create_repository():
16231627
on the ``request`` instance; if ``request`` is provided, this
16241628
should not be set.
16251629
repository (:class:`google.cloud.artifactregistry_v1.types.Repository`):
1626-
The repository to be created.
1630+
Required. The repository to be
1631+
created.
1632+
16271633
This corresponds to the ``repository`` field
16281634
on the ``request`` instance; if ``request`` is provided, this
16291635
should not be set.
16301636
repository_id (:class:`str`):
1631-
The repository id to use for this
1632-
repository.
1637+
Required. The repository id to use
1638+
for this repository.
16331639
16341640
This corresponds to the ``repository_id`` field
16351641
on the ``request`` instance; if ``request`` is provided, this
@@ -2619,6 +2625,143 @@ async def sample_delete_version():
26192625
# Done; return the response.
26202626
return response
26212627

2628+
async def batch_delete_versions(
2629+
self,
2630+
request: Optional[Union[version.BatchDeleteVersionsRequest, dict]] = None,
2631+
*,
2632+
parent: Optional[str] = None,
2633+
names: Optional[MutableSequence[str]] = None,
2634+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2635+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2636+
metadata: Sequence[Tuple[str, str]] = (),
2637+
) -> operation_async.AsyncOperation:
2638+
r"""Deletes multiple versions across a repository. The
2639+
returned operation will complete once the versions have
2640+
been deleted.
2641+
2642+
.. code-block:: python
2643+
2644+
# This snippet has been automatically generated and should be regarded as a
2645+
# code template only.
2646+
# It will require modifications to work:
2647+
# - It may require correct/in-range values for request initialization.
2648+
# - It may require specifying regional endpoints when creating the service
2649+
# client as shown in:
2650+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
2651+
from google.cloud import artifactregistry_v1
2652+
2653+
async def sample_batch_delete_versions():
2654+
# Create a client
2655+
client = artifactregistry_v1.ArtifactRegistryAsyncClient()
2656+
2657+
# Initialize request argument(s)
2658+
request = artifactregistry_v1.BatchDeleteVersionsRequest(
2659+
names=['names_value1', 'names_value2'],
2660+
)
2661+
2662+
# Make the request
2663+
operation = client.batch_delete_versions(request=request)
2664+
2665+
print("Waiting for operation to complete...")
2666+
2667+
response = (await operation).result()
2668+
2669+
# Handle the response
2670+
print(response)
2671+
2672+
Args:
2673+
request (Optional[Union[google.cloud.artifactregistry_v1.types.BatchDeleteVersionsRequest, dict]]):
2674+
The request object. The request to delete multiple
2675+
versions across a repository.
2676+
parent (:class:`str`):
2677+
The name of the repository holding
2678+
all requested versions.
2679+
2680+
This corresponds to the ``parent`` field
2681+
on the ``request`` instance; if ``request`` is provided, this
2682+
should not be set.
2683+
names (:class:`MutableSequence[str]`):
2684+
Required. The names of the versions
2685+
to delete. A maximum of 10000 versions
2686+
can be deleted in a batch.
2687+
2688+
This corresponds to the ``names`` field
2689+
on the ``request`` instance; if ``request`` is provided, this
2690+
should not be set.
2691+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
2692+
should be retried.
2693+
timeout (float): The timeout for this request.
2694+
metadata (Sequence[Tuple[str, str]]): Strings which should be
2695+
sent along with the request as metadata.
2696+
2697+
Returns:
2698+
google.api_core.operation_async.AsyncOperation:
2699+
An object representing a long-running operation.
2700+
2701+
The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
2702+
empty messages in your APIs. A typical example is to
2703+
use it as the request or the response type of an API
2704+
method. For instance:
2705+
2706+
service Foo {
2707+
rpc Bar(google.protobuf.Empty) returns
2708+
(google.protobuf.Empty);
2709+
2710+
}
2711+
2712+
"""
2713+
# Create or coerce a protobuf request object.
2714+
# Quick check: If we got a request object, we should *not* have
2715+
# gotten any keyword arguments that map to the request.
2716+
has_flattened_params = any([parent, names])
2717+
if request is not None and has_flattened_params:
2718+
raise ValueError(
2719+
"If the `request` argument is set, then none of "
2720+
"the individual field arguments should be set."
2721+
)
2722+
2723+
request = version.BatchDeleteVersionsRequest(request)
2724+
2725+
# If we have keyword arguments corresponding to fields on the
2726+
# request, apply these.
2727+
if parent is not None:
2728+
request.parent = parent
2729+
if names:
2730+
request.names.extend(names)
2731+
2732+
# Wrap the RPC method; this adds retry and timeout information,
2733+
# and friendly error handling.
2734+
rpc = gapic_v1.method_async.wrap_method(
2735+
self._client._transport.batch_delete_versions,
2736+
default_timeout=None,
2737+
client_info=DEFAULT_CLIENT_INFO,
2738+
)
2739+
2740+
# Certain fields should be provided within the metadata header;
2741+
# add these here.
2742+
metadata = tuple(metadata) + (
2743+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
2744+
)
2745+
2746+
# Send the request.
2747+
response = await rpc(
2748+
request,
2749+
retry=retry,
2750+
timeout=timeout,
2751+
metadata=metadata,
2752+
)
2753+
2754+
# Wrap the response in an operation future.
2755+
response = operation_async.from_gapic(
2756+
response,
2757+
self._client._transport.operations_client,
2758+
empty_pb2.Empty,
2759+
metadata_type=version.BatchDeleteVersionsMetadata,
2760+
)
2761+
2762+
# Done; return the response.
2763+
return response
2764+
26222765
async def list_files(
26232766
self,
26242767
request: Optional[Union[file.ListFilesRequest, dict]] = None,
@@ -2877,8 +3020,9 @@ async def sample_list_tags():
28773020
request (Optional[Union[google.cloud.artifactregistry_v1.types.ListTagsRequest, dict]]):
28783021
The request object. The request to list tags.
28793022
parent (:class:`str`):
2880-
The name of the parent resource whose
2881-
tags will be listed.
3023+
The name of the parent package whose tags will be
3024+
listed. For example:
3025+
``projects/p1/locations/us-central1/repositories/repo1/packages/pkg1``.
28823026
28833027
This corresponds to the ``parent`` field
28843028
on the ``request`` instance; if ``request`` is provided, this

0 commit comments

Comments
 (0)