Skip to content

Commit 2da5c2a

Browse files
chore: librarian generate pull request: 20251203T085040Z (#14944)
PR created by the Librarian CLI to generate Cloud Client Libraries code from protos. BEGIN_COMMIT BEGIN_NESTED_COMMIT feat: add ExportArtifact API PiperOrigin-RevId: 839457154 Library-IDs: google-cloud-artifact-registry Source-link: [googleapis/googleapis@535d161c](googleapis/googleapis@535d161c) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `tags` in message `.google.cloud.gkemulticloud.v1.AttachedCluster` is changed PiperOrigin-RevId: 839306772 Library-IDs: google-cloud-gke-multicloud Source-link: [googleapis/googleapis@9f786b58](googleapis/googleapis@9f786b58) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `throughput` in message `.google.cloud.gkemulticloud.v1.AwsVolumeTemplate` is changed PiperOrigin-RevId: 839306772 Library-IDs: google-cloud-gke-multicloud Source-link: [googleapis/googleapis@9f786b58](googleapis/googleapis@9f786b58) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `requested_cancellation` in message `.google.cloud.gkemulticloud.v1.OperationMetadata` is changed PiperOrigin-RevId: 839306772 Library-IDs: google-cloud-gke-multicloud Source-link: [googleapis/googleapis@9f786b58](googleapis/googleapis@9f786b58) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: added custom tolerations and labels support for Attached Clusters PiperOrigin-RevId: 839306772 Library-IDs: google-cloud-gke-multicloud Source-link: [googleapis/googleapis@9f786b58](googleapis/googleapis@9f786b58) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: mark GKE-on-AWS and GKE-on-Azure protos as being deprecated to discourage any new usage as these services turn down PiperOrigin-RevId: 839306772 Library-IDs: google-cloud-gke-multicloud Source-link: [googleapis/googleapis@9f786b58](googleapis/googleapis@9f786b58) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: update tickets component number PiperOrigin-RevId: 839132650 Library-IDs: google-cloud-parallelstore Source-link: [googleapis/googleapis@02f73f53](googleapis/googleapis@02f73f53) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: add transfer metadata options proto definition PiperOrigin-RevId: 839132650 Library-IDs: google-cloud-parallelstore Source-link: [googleapis/googleapis@02f73f53](googleapis/googleapis@02f73f53) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: update tickets component number PiperOrigin-RevId: 839132192 Library-IDs: google-cloud-parallelstore Source-link: [googleapis/googleapis@4d2bfee2](googleapis/googleapis@4d2bfee2) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: publish networksecurity v1beta1 api PiperOrigin-RevId: 838919865 Library-IDs: google-cloud-network-security Source-link: [googleapis/googleapis@586e752d](googleapis/googleapis@586e752d) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `owned` in message `.google.cloud.channel.v1.CloudIdentityCustomerAccount` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `customer_attestation_state` in message `.google.cloud.channel.v1.Customer` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `event_type` in message `.google.cloud.channel.v1.CustomerEvent` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for method `RegisterSubscriber` in service `CloudChannelService` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `account` in message `.google.cloud.channel.v1.RegisterSubscriberRequest` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for message `ChangeParametersRequest` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `account` in message `.google.cloud.channel.v1.ListSubscribersRequest` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `offers` in message `.google.cloud.channel.v1.ListOffersResponse` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `page_token` in message `.google.cloud.channel.v1.ListSkuGroupBillableSkusRequest` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for method `UnregisterSubscriber` in service `CloudChannelService` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `entitlement_granularity` in message `.google.cloud.channel.v1.RepricingConfig` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `account` in message `.google.cloud.channel.v1.UnregisterSubscriberRequest` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `event_type` in message `.google.cloud.channel.v1.EntitlementEvent` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT fix: Changed field behavior for an existing field `entitlement_granularity` in message `.google.cloud.channel.v1.RepricingConfig` PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `page_token` in message `.google.cloud.channel.v1.ListSkuGroupsRequest` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `next_page_token` in message `.google.cloud.channel.v1.ListSkuGroupsResponse` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for field `next_page_token` in message `.google.cloud.channel.v1.ListSkuGroupBillableSkusResponse` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for enum `CustomerAttestationState` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT docs: A comment for method `ListSubscribers` in service `CloudChannelService` is changed PiperOrigin-RevId: 838889186 Library-IDs: google-cloud-channel Source-link: [googleapis/googleapis@1c1b1ff7](googleapis/googleapis@1c1b1ff7) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: A new field `radius_area` is added to message `.google.shopping.merchant.accounts.v1.Region` PiperOrigin-RevId: 838817995 Library-IDs: google-shopping-merchant-accounts Source-link: [googleapis/googleapis@9a665b70](googleapis/googleapis@9a665b70) END_NESTED_COMMIT BEGIN_NESTED_COMMIT feat: Update GCB with latest proto changes PiperOrigin-RevId: 837135318 Library-IDs: google-cloud-build Source-link: [googleapis/googleapis@943025a9](googleapis/googleapis@943025a9) END_NESTED_COMMIT END_COMMIT This pull request is generated with proto changes between [googleapis/googleapis@c9ff4f1c](googleapis/googleapis@c9ff4f1) (exclusive) and [googleapis/googleapis@535d161c](googleapis/googleapis@535d161) (inclusive). Librarian Version: v0.0.0-20251113212345-55e52e492404 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:72e9b62c0f8f3799651ee62d777a2905f5b72ff19ea46f2e7b7d682d7d1e9414 ## Generation failed for - google-cloud-compute-v1beta
1 parent 230bc11 commit 2da5c2a

File tree

104 files changed

+24271
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+24271
-481
lines changed

.librarian/state.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ libraries:
473473
tag_format: '{id}-v{version}'
474474
- id: google-cloud-artifact-registry
475475
version: 1.17.0
476-
last_generated_commit: c2db528a3e4d12b95666c719ee0db30a3d4c78ad
476+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
477477
apis:
478478
- path: google/devtools/artifactregistry/v1
479479
service_config: artifactregistry_v1.yaml
@@ -990,7 +990,7 @@ libraries:
990990
tag_format: '{id}-v{version}'
991991
- id: google-cloud-build
992992
version: 3.33.0
993-
last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd
993+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
994994
apis:
995995
- path: google/devtools/cloudbuild/v1
996996
service_config: cloudbuild_v1.yaml
@@ -1043,7 +1043,7 @@ libraries:
10431043
tag_format: '{id}-v{version}'
10441044
- id: google-cloud-channel
10451045
version: 1.24.0
1046-
last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd
1046+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
10471047
apis:
10481048
- path: google/cloud/channel/v1
10491049
service_config: cloudchannel_v1.yaml
@@ -1957,7 +1957,7 @@ libraries:
19571957
tag_format: '{id}-v{version}'
19581958
- id: google-cloud-gke-multicloud
19591959
version: 0.6.22
1960-
last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd
1960+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
19611961
apis:
19621962
- path: google/cloud/gkemulticloud/v1
19631963
service_config: gkemulticloud_v1.yaml
@@ -2497,7 +2497,7 @@ libraries:
24972497
tag_format: '{id}-v{version}'
24982498
- id: google-cloud-network-security
24992499
version: 0.9.21
2500-
last_generated_commit: c9ff4f1cd26f1fe63e6d1c11a198366b70ebdb84
2500+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
25012501
apis:
25022502
- path: google/cloud/networksecurity/v1alpha1
25032503
service_config: networksecurity_v1alpha1.yaml
@@ -2669,7 +2669,7 @@ libraries:
26692669
tag_format: '{id}-v{version}'
26702670
- id: google-cloud-parallelstore
26712671
version: 0.3.0
2672-
last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd
2672+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
26732673
apis:
26742674
- path: google/cloud/parallelstore/v1
26752675
service_config: parallelstore_v1.yaml
@@ -3980,7 +3980,7 @@ libraries:
39803980
tag_format: '{id}-v{version}'
39813981
- id: google-shopping-merchant-accounts
39823982
version: 1.1.0
3983-
last_generated_commit: a17b84add8318f780fcc8a027815d5fee644b9f7
3983+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
39843984
apis:
39853985
- path: google/shopping/merchant/accounts/v1
39863986
service_config: merchantapi_v1.yaml
@@ -4262,7 +4262,7 @@ libraries:
42624262
tag_format: '{id}-v{version}'
42634263
- id: googleapis-common-protos
42644264
version: 1.72.0
4265-
last_generated_commit: c9ff4f1cd26f1fe63e6d1c11a198366b70ebdb84
4265+
last_generated_commit: 535d161c24965e9ed1a0b27032cc1c8b4beab818
42664266
apis:
42674267
- path: google/api
42684268
service_config: serviceconfig.yaml

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
ListAttachmentsRequest,
6060
ListAttachmentsResponse,
6161
)
62+
from google.cloud.artifactregistry_v1.types.export import (
63+
ExportArtifactMetadata,
64+
ExportArtifactRequest,
65+
ExportArtifactResponse,
66+
)
6267
from google.cloud.artifactregistry_v1.types.file import (
6368
DeleteFileRequest,
6469
File,
@@ -175,6 +180,9 @@
175180
"GetAttachmentRequest",
176181
"ListAttachmentsRequest",
177182
"ListAttachmentsResponse",
183+
"ExportArtifactMetadata",
184+
"ExportArtifactRequest",
185+
"ExportArtifactResponse",
178186
"DeleteFileRequest",
179187
"File",
180188
"GetFileRequest",

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
ListAttachmentsRequest,
5858
ListAttachmentsResponse,
5959
)
60+
from .types.export import (
61+
ExportArtifactMetadata,
62+
ExportArtifactRequest,
63+
ExportArtifactResponse,
64+
)
6065
from .types.file import (
6166
DeleteFileRequest,
6267
File,
@@ -163,6 +168,9 @@
163168
"DeleteTagRequest",
164169
"DeleteVersionRequest",
165170
"DockerImage",
171+
"ExportArtifactMetadata",
172+
"ExportArtifactRequest",
173+
"ExportArtifactResponse",
166174
"File",
167175
"GenericArtifact",
168176
"GetAttachmentRequest",

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
@@ -70,6 +70,11 @@
7070
"delete_version"
7171
]
7272
},
73+
"ExportArtifact": {
74+
"methods": [
75+
"export_artifact"
76+
]
77+
},
7378
"GetAttachment": {
7479
"methods": [
7580
"get_attachment"
@@ -320,6 +325,11 @@
320325
"delete_version"
321326
]
322327
},
328+
"ExportArtifact": {
329+
"methods": [
330+
"export_artifact"
331+
]
332+
},
323333
"GetAttachment": {
324334
"methods": [
325335
"get_attachment"
@@ -570,6 +580,11 @@
570580
"delete_version"
571581
]
572582
},
583+
"ExportArtifact": {
584+
"methods": [
585+
"export_artifact"
586+
]
587+
},
573588
"GetAttachment": {
574589
"methods": [
575590
"get_attachment"

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

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
from google.cloud.artifactregistry_v1.types import apt_artifact, artifact
6262
from google.cloud.artifactregistry_v1.types import attachment
6363
from google.cloud.artifactregistry_v1.types import attachment as gda_attachment
64+
from google.cloud.artifactregistry_v1.types import export
6465
from google.cloud.artifactregistry_v1.types import file
6566
from google.cloud.artifactregistry_v1.types import file as gda_file
6667
from google.cloud.artifactregistry_v1.types import package
@@ -6278,6 +6279,111 @@ async def sample_delete_attachment():
62786279
# Done; return the response.
62796280
return response
62806281

6282+
async def export_artifact(
6283+
self,
6284+
request: Optional[Union[export.ExportArtifactRequest, dict]] = None,
6285+
*,
6286+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
6287+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
6288+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
6289+
) -> operation_async.AsyncOperation:
6290+
r"""Exports an artifact.
6291+
6292+
.. code-block:: python
6293+
6294+
# This snippet has been automatically generated and should be regarded as a
6295+
# code template only.
6296+
# It will require modifications to work:
6297+
# - It may require correct/in-range values for request initialization.
6298+
# - It may require specifying regional endpoints when creating the service
6299+
# client as shown in:
6300+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
6301+
from google.cloud import artifactregistry_v1
6302+
6303+
async def sample_export_artifact():
6304+
# Create a client
6305+
client = artifactregistry_v1.ArtifactRegistryAsyncClient()
6306+
6307+
# Initialize request argument(s)
6308+
request = artifactregistry_v1.ExportArtifactRequest(
6309+
source_version="source_version_value",
6310+
gcs_path="gcs_path_value",
6311+
repository="repository_value",
6312+
)
6313+
6314+
# Make the request
6315+
operation = client.export_artifact(request=request)
6316+
6317+
print("Waiting for operation to complete...")
6318+
6319+
response = (await operation).result()
6320+
6321+
# Handle the response
6322+
print(response)
6323+
6324+
Args:
6325+
request (Optional[Union[google.cloud.artifactregistry_v1.types.ExportArtifactRequest, dict]]):
6326+
The request object. The request for exporting an artifact
6327+
to a destination.
6328+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
6329+
should be retried.
6330+
timeout (float): The timeout for this request.
6331+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
6332+
sent along with the request as metadata. Normally, each value must be of type `str`,
6333+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
6334+
be of type `bytes`.
6335+
6336+
Returns:
6337+
google.api_core.operation_async.AsyncOperation:
6338+
An object representing a long-running operation.
6339+
6340+
The result type for the operation will be
6341+
:class:`google.cloud.artifactregistry_v1.types.ExportArtifactResponse`
6342+
The response for exporting an artifact to a destination.
6343+
6344+
"""
6345+
# Create or coerce a protobuf request object.
6346+
# - Use the request object if provided (there's no risk of modifying the input as
6347+
# there are no flattened fields), or create one.
6348+
if not isinstance(request, export.ExportArtifactRequest):
6349+
request = export.ExportArtifactRequest(request)
6350+
6351+
# Wrap the RPC method; this adds retry and timeout information,
6352+
# and friendly error handling.
6353+
rpc = self._client._transport._wrapped_methods[
6354+
self._client._transport.export_artifact
6355+
]
6356+
6357+
# Certain fields should be provided within the metadata header;
6358+
# add these here.
6359+
metadata = tuple(metadata) + (
6360+
gapic_v1.routing_header.to_grpc_metadata(
6361+
(("repository", request.repository),)
6362+
),
6363+
)
6364+
6365+
# Validate the universe domain.
6366+
self._client._validate_universe_domain()
6367+
6368+
# Send the request.
6369+
response = await rpc(
6370+
request,
6371+
retry=retry,
6372+
timeout=timeout,
6373+
metadata=metadata,
6374+
)
6375+
6376+
# Wrap the response in an operation future.
6377+
response = operation_async.from_gapic(
6378+
response,
6379+
self._client._transport.operations_client,
6380+
export.ExportArtifactResponse,
6381+
metadata_type=export.ExportArtifactMetadata,
6382+
)
6383+
6384+
# Done; return the response.
6385+
return response
6386+
62816387
async def get_operation(
62826388
self,
62836389
request: Optional[operations_pb2.GetOperationRequest] = None,

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

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
from google.cloud.artifactregistry_v1.types import apt_artifact, artifact
7979
from google.cloud.artifactregistry_v1.types import attachment
8080
from google.cloud.artifactregistry_v1.types import attachment as gda_attachment
81+
from google.cloud.artifactregistry_v1.types import export
8182
from google.cloud.artifactregistry_v1.types import file
8283
from google.cloud.artifactregistry_v1.types import file as gda_file
8384
from google.cloud.artifactregistry_v1.types import package
@@ -6873,6 +6874,109 @@ def sample_delete_attachment():
68736874
# Done; return the response.
68746875
return response
68756876

6877+
def export_artifact(
6878+
self,
6879+
request: Optional[Union[export.ExportArtifactRequest, dict]] = None,
6880+
*,
6881+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
6882+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
6883+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
6884+
) -> operation.Operation:
6885+
r"""Exports an artifact.
6886+
6887+
.. code-block:: python
6888+
6889+
# This snippet has been automatically generated and should be regarded as a
6890+
# code template only.
6891+
# It will require modifications to work:
6892+
# - It may require correct/in-range values for request initialization.
6893+
# - It may require specifying regional endpoints when creating the service
6894+
# client as shown in:
6895+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
6896+
from google.cloud import artifactregistry_v1
6897+
6898+
def sample_export_artifact():
6899+
# Create a client
6900+
client = artifactregistry_v1.ArtifactRegistryClient()
6901+
6902+
# Initialize request argument(s)
6903+
request = artifactregistry_v1.ExportArtifactRequest(
6904+
source_version="source_version_value",
6905+
gcs_path="gcs_path_value",
6906+
repository="repository_value",
6907+
)
6908+
6909+
# Make the request
6910+
operation = client.export_artifact(request=request)
6911+
6912+
print("Waiting for operation to complete...")
6913+
6914+
response = operation.result()
6915+
6916+
# Handle the response
6917+
print(response)
6918+
6919+
Args:
6920+
request (Union[google.cloud.artifactregistry_v1.types.ExportArtifactRequest, dict]):
6921+
The request object. The request for exporting an artifact
6922+
to a destination.
6923+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
6924+
should be retried.
6925+
timeout (float): The timeout for this request.
6926+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
6927+
sent along with the request as metadata. Normally, each value must be of type `str`,
6928+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
6929+
be of type `bytes`.
6930+
6931+
Returns:
6932+
google.api_core.operation.Operation:
6933+
An object representing a long-running operation.
6934+
6935+
The result type for the operation will be
6936+
:class:`google.cloud.artifactregistry_v1.types.ExportArtifactResponse`
6937+
The response for exporting an artifact to a destination.
6938+
6939+
"""
6940+
# Create or coerce a protobuf request object.
6941+
# - Use the request object if provided (there's no risk of modifying the input as
6942+
# there are no flattened fields), or create one.
6943+
if not isinstance(request, export.ExportArtifactRequest):
6944+
request = export.ExportArtifactRequest(request)
6945+
6946+
# Wrap the RPC method; this adds retry and timeout information,
6947+
# and friendly error handling.
6948+
rpc = self._transport._wrapped_methods[self._transport.export_artifact]
6949+
6950+
# Certain fields should be provided within the metadata header;
6951+
# add these here.
6952+
metadata = tuple(metadata) + (
6953+
gapic_v1.routing_header.to_grpc_metadata(
6954+
(("repository", request.repository),)
6955+
),
6956+
)
6957+
6958+
# Validate the universe domain.
6959+
self._validate_universe_domain()
6960+
6961+
# Send the request.
6962+
response = rpc(
6963+
request,
6964+
retry=retry,
6965+
timeout=timeout,
6966+
metadata=metadata,
6967+
)
6968+
6969+
# Wrap the response in an operation future.
6970+
response = operation.from_gapic(
6971+
response,
6972+
self._transport.operations_client,
6973+
export.ExportArtifactResponse,
6974+
metadata_type=export.ExportArtifactMetadata,
6975+
)
6976+
6977+
# Done; return the response.
6978+
return response
6979+
68766980
def __enter__(self) -> "ArtifactRegistryClient":
68776981
return self
68786982

0 commit comments

Comments
 (0)