diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java
index 60015329..ca04c843 100644
--- a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java
+++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java
@@ -20,6 +20,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
@@ -36,7 +37,6 @@
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
@@ -125,13 +125,29 @@
* ArtifactRegistryClient.create(artifactRegistrySettings);
* }
*
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ArtifactRegistrySettings artifactRegistrySettings =
+ * ArtifactRegistrySettings.newBuilder()
+ * .setTransportChannelProvider(
+ * ArtifactRegistrySettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * ArtifactRegistryClient artifactRegistryClient =
+ * ArtifactRegistryClient.create(artifactRegistrySettings);
+ * }
+ *
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class ArtifactRegistryClient implements BackgroundResource {
private final ArtifactRegistrySettings settings;
private final ArtifactRegistryStub stub;
- private final OperationsClient operationsClient;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of ArtifactRegistryClient with default settings. */
public static final ArtifactRegistryClient create() throws IOException {
@@ -151,7 +167,6 @@ public static final ArtifactRegistryClient create(ArtifactRegistrySettings setti
* Constructs an instance of ArtifactRegistryClient, using the given stub for making calls. This
* is for advanced usage - prefer using create(ArtifactRegistrySettings).
*/
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ArtifactRegistryClient create(ArtifactRegistryStub stub) {
return new ArtifactRegistryClient(stub);
}
@@ -164,21 +179,23 @@ public static final ArtifactRegistryClient create(ArtifactRegistryStub stub) {
protected ArtifactRegistryClient(ArtifactRegistrySettings settings) throws IOException {
this.settings = settings;
this.stub = ((ArtifactRegistryStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected ArtifactRegistryClient(ArtifactRegistryStub stub) {
this.settings = null;
this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final ArtifactRegistrySettings getSettings() {
return settings;
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ArtifactRegistryStub getStub() {
return stub;
}
@@ -187,10 +204,19 @@ public ArtifactRegistryStub getStub() {
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
- public final OperationsClient getOperationsClient() {
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists docker images.
@@ -295,7 +321,7 @@ public final ListDockerImagesPagedResponse listDockerImages(ListDockerImagesRequ
* while (true) {
* ListDockerImagesResponse response =
* artifactRegistryClient.listDockerImagesCallable().call(request);
- * for (DockerImage element : response.getResponsesList()) {
+ * for (DockerImage element : response.getDockerImagesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -707,7 +733,7 @@ public final ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequ
* while (true) {
* ListRepositoriesResponse response =
* artifactRegistryClient.listRepositoriesCallable().call(request);
- * for (Repository element : response.getResponsesList()) {
+ * for (Repository element : response.getRepositoriesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1297,7 +1323,7 @@ public final ListPackagesPagedResponse listPackages(ListPackagesRequest request)
* .build();
* while (true) {
* ListPackagesResponse response = artifactRegistryClient.listPackagesCallable().call(request);
- * for (Package element : response.getResponsesList()) {
+ * for (Package element : response.getPackagesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1586,7 +1612,7 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request)
* .build();
* while (true) {
* ListVersionsResponse response = artifactRegistryClient.listVersionsCallable().call(request);
- * for (Version element : response.getResponsesList()) {
+ * for (Version element : response.getVersionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1882,7 +1908,7 @@ public final UnaryCallable listFilesPa
* .build();
* while (true) {
* ListFilesResponse response = artifactRegistryClient.listFilesCallable().call(request);
- * for (File element : response.getResponsesList()) {
+ * for (File element : response.getFilesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -2068,7 +2094,7 @@ public final UnaryCallable listTagsPaged
* .build();
* while (true) {
* ListTagsResponse response = artifactRegistryClient.listTagsCallable().call(request);
- * for (Tag element : response.getResponsesList()) {
+ * for (Tag element : response.getTagsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -2388,9 +2414,7 @@ public final UnaryCallable deleteTagCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
- * .setResource(
- * DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
- * .toString())
+ * .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
@@ -2417,9 +2441,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
- * .setResource(
- * DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
- * .toString())
+ * .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
@@ -2445,9 +2467,7 @@ public final UnaryCallable setIamPolicyCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
- * .setResource(
- * DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
- * .toString())
+ * .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = artifactRegistryClient.getIamPolicy(request);
@@ -2473,9 +2493,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
- * .setResource(
- * DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
- * .toString())
+ * .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture future = artifactRegistryClient.getIamPolicyCallable().futureCall(request);
@@ -2500,9 +2518,7 @@ public final UnaryCallable getIamPolicyCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
- * .setResource(
- * DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
- * .toString())
+ * .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .addAllPermissions(new ArrayList())
* .build();
* TestIamPermissionsResponse response = artifactRegistryClient.testIamPermissions(request);
@@ -2528,9 +2544,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
- * .setResource(
- * DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
- * .toString())
+ * .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .addAllPermissions(new ArrayList())
* .build();
* ApiFuture future =
diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java
index 4d59eaef..fd0751f2 100644
--- a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java
+++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java
@@ -28,6 +28,7 @@
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
@@ -294,11 +295,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return ArtifactRegistryStubSettings.defaultCredentialsProviderBuilder();
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return ArtifactRegistryStubSettings.defaultGrpcTransportProviderBuilder();
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return ArtifactRegistryStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return ArtifactRegistryStubSettings.defaultTransportChannelProvider();
}
@@ -308,11 +316,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
return ArtifactRegistryStubSettings.defaultApiClientHeaderProviderBuilder();
}
- /** Returns a new builder for this class. */
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -350,6 +364,11 @@ private static Builder createDefault() {
return new Builder(ArtifactRegistryStubSettings.newBuilder());
}
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(ArtifactRegistryStubSettings.newHttpJsonBuilder());
+ }
+
public ArtifactRegistryStubSettings.Builder getStubSettingsBuilder() {
return ((ArtifactRegistryStubSettings.Builder) getStubSettings());
}
diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStub.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStub.java
index 0b5f455c..e63f56e4 100644
--- a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStub.java
+++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStub.java
@@ -88,7 +88,11 @@
public abstract class ArtifactRegistryStub implements BackgroundResource {
public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
}
public UnaryCallable
diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStubSettings.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStubSettings.java
index c03da748..0ba3a47c 100644
--- a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStubSettings.java
+++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStubSettings.java
@@ -33,6 +33,9 @@
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
@@ -718,13 +721,17 @@ public UnaryCallSettings getIamPolicySettings() {
return updateProjectSettingsSettings;
}
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ArtifactRegistryStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
.equals(GrpcTransportChannel.getGrpcTransportName())) {
return GrpcArtifactRegistryStub.create(this);
}
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonArtifactRegistryStub.create(this);
+ }
throw new UnsupportedOperationException(
String.format(
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -757,18 +764,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
.setUseJwtAccessWithScope(true);
}
- /** Returns a builder for the default ChannelProvider for this service. */
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return InstantiatingGrpcChannelProvider.newBuilder()
.setMaxInboundMessageSize(Integer.MAX_VALUE);
}
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
public static TransportChannelProvider defaultTransportChannelProvider() {
return defaultGrpcTransportProviderBuilder().build();
}
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
- public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
return ApiClientHeaderProvider.newBuilder()
.setGeneratedLibToken(
"gapic", GaxProperties.getLibraryVersion(ArtifactRegistryStubSettings.class))
@@ -776,11 +790,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
}
- /** Returns a new builder for this class. */
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(ArtifactRegistryStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return ArtifactRegistryStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
@@ -1080,6 +1113,19 @@ private static Builder createDefault() {
return initDefaults(builder);
}
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
private static Builder initDefaults(Builder builder) {
builder
.listDockerImagesSettings()
diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/HttpJsonArtifactRegistryCallableFactory.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/HttpJsonArtifactRegistryCallableFactory.java
new file mode 100644
index 00000000..ae74a968
--- /dev/null
+++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/HttpJsonArtifactRegistryCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.devtools.artifactregistry.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the ArtifactRegistry service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonArtifactRegistryCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/HttpJsonArtifactRegistryStub.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/HttpJsonArtifactRegistryStub.java
new file mode 100644
index 00000000..a6ff2063
--- /dev/null
+++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/HttpJsonArtifactRegistryStub.java
@@ -0,0 +1,1766 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.devtools.artifactregistry.v1.stub;
+
+import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListDockerImagesPagedResponse;
+import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListFilesPagedResponse;
+import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListPackagesPagedResponse;
+import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListRepositoriesPagedResponse;
+import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListTagsPagedResponse;
+import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListVersionsPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.devtools.artifactregistry.v1.CreateRepositoryRequest;
+import com.google.devtools.artifactregistry.v1.CreateTagRequest;
+import com.google.devtools.artifactregistry.v1.DeletePackageRequest;
+import com.google.devtools.artifactregistry.v1.DeleteRepositoryRequest;
+import com.google.devtools.artifactregistry.v1.DeleteTagRequest;
+import com.google.devtools.artifactregistry.v1.DeleteVersionRequest;
+import com.google.devtools.artifactregistry.v1.DockerImage;
+import com.google.devtools.artifactregistry.v1.File;
+import com.google.devtools.artifactregistry.v1.GetDockerImageRequest;
+import com.google.devtools.artifactregistry.v1.GetFileRequest;
+import com.google.devtools.artifactregistry.v1.GetPackageRequest;
+import com.google.devtools.artifactregistry.v1.GetProjectSettingsRequest;
+import com.google.devtools.artifactregistry.v1.GetRepositoryRequest;
+import com.google.devtools.artifactregistry.v1.GetTagRequest;
+import com.google.devtools.artifactregistry.v1.GetVersionRequest;
+import com.google.devtools.artifactregistry.v1.ImportAptArtifactsMetadata;
+import com.google.devtools.artifactregistry.v1.ImportAptArtifactsRequest;
+import com.google.devtools.artifactregistry.v1.ImportAptArtifactsResponse;
+import com.google.devtools.artifactregistry.v1.ImportYumArtifactsMetadata;
+import com.google.devtools.artifactregistry.v1.ImportYumArtifactsRequest;
+import com.google.devtools.artifactregistry.v1.ImportYumArtifactsResponse;
+import com.google.devtools.artifactregistry.v1.ListDockerImagesRequest;
+import com.google.devtools.artifactregistry.v1.ListDockerImagesResponse;
+import com.google.devtools.artifactregistry.v1.ListFilesRequest;
+import com.google.devtools.artifactregistry.v1.ListFilesResponse;
+import com.google.devtools.artifactregistry.v1.ListPackagesRequest;
+import com.google.devtools.artifactregistry.v1.ListPackagesResponse;
+import com.google.devtools.artifactregistry.v1.ListRepositoriesRequest;
+import com.google.devtools.artifactregistry.v1.ListRepositoriesResponse;
+import com.google.devtools.artifactregistry.v1.ListTagsRequest;
+import com.google.devtools.artifactregistry.v1.ListTagsResponse;
+import com.google.devtools.artifactregistry.v1.ListVersionsRequest;
+import com.google.devtools.artifactregistry.v1.ListVersionsResponse;
+import com.google.devtools.artifactregistry.v1.OperationMetadata;
+import com.google.devtools.artifactregistry.v1.Package;
+import com.google.devtools.artifactregistry.v1.ProjectSettings;
+import com.google.devtools.artifactregistry.v1.Repository;
+import com.google.devtools.artifactregistry.v1.Tag;
+import com.google.devtools.artifactregistry.v1.UpdateProjectSettingsRequest;
+import com.google.devtools.artifactregistry.v1.UpdateRepositoryRequest;
+import com.google.devtools.artifactregistry.v1.UpdateTagRequest;
+import com.google.devtools.artifactregistry.v1.Version;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the ArtifactRegistry service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonArtifactRegistryStub extends ArtifactRegistryStub {
+ private static final TypeRegistry typeRegistry =
+ TypeRegistry.newBuilder()
+ .add(Empty.getDescriptor())
+ .add(ImportYumArtifactsResponse.getDescriptor())
+ .add(ImportAptArtifactsResponse.getDescriptor())
+ .add(ImportYumArtifactsMetadata.getDescriptor())
+ .add(ImportAptArtifactsMetadata.getDescriptor())
+ .add(Repository.getDescriptor())
+ .add(OperationMetadata.getDescriptor())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listDockerImagesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/ListDockerImages")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*}/dockerImages",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListDockerImagesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getDockerImageMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/GetDockerImage")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/dockerImages/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(DockerImage.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ importAptArtifactsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/ImportAptArtifacts")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*}/aptArtifacts:import",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ImportAptArtifactsRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ importYumArtifactsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/ImportYumArtifacts")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*}/yumArtifacts:import",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearParent().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (ImportYumArtifactsRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listRepositoriesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/ListRepositories")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/repositories",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListRepositoriesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getRepositoryMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/GetRepository")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Repository.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ createRepositoryMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/CreateRepository")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*}/repositories",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(
+ fields, "repositoryId", request.getRepositoryId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("repository", request.getRepository()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (CreateRepositoryRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateRepositoryMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateRepository")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{repository.name=projects/*/locations/*/repositories/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields, "repository.name", request.getRepository().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("repository", request.getRepository()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Repository.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteRepositoryMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteRepository")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteRepositoryRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listPackagesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/ListPackages")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*}/packages",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListPackagesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor getPackageMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/GetPackage")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/packages/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Package.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deletePackageMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/DeletePackage")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/packages/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeletePackageRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listVersionsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/ListVersions")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/versions",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ serializer.putQueryParam(fields, "view", request.getView());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListVersionsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor getVersionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/GetVersion")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "view", request.getView());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Version.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ deleteVersionMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteVersion")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/packages/*/versions/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "force", request.getForce());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Operation.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .setOperationSnapshotFactory(
+ (DeleteVersionRequest request, Operation response) ->
+ HttpJsonOperationSnapshot.create(response))
+ .build();
+
+ private static final ApiMethodDescriptor
+ listFilesMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/ListFiles")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*}/files",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListFilesResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor getFileMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/GetFile")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/files/**}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(File.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ listTagsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/ListTags")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/tags",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "filter", request.getFilter());
+ serializer.putQueryParam(fields, "pageSize", request.getPageSize());
+ serializer.putQueryParam(fields, "pageToken", request.getPageToken());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ListTagsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor getTagMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/GetTag")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Tag.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor createTagMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/CreateTag")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{parent=projects/*/locations/*/repositories/*/packages/*}/tags",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "parent", request.getParent());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "tagId", request.getTagId());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request -> ProtoRestSerializer.create().toBody("tag", request.getTag()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Tag.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor updateTagMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateTag")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{tag.name=projects/*/locations/*/repositories/*/packages/*/tags/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "tag.name", request.getTag().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request -> ProtoRestSerializer.create().toBody("tag", request.getTag()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Tag.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor deleteTagMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName("google.devtools.artifactregistry.v1.ArtifactRegistry/DeleteTag")
+ .setHttpMethod("DELETE")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/locations/*/repositories/*/packages/*/tags/*}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Empty.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ setIamPolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/SetIamPolicy")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{resource=projects/*/locations/*/repositories/*}:setIamPolicy",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "resource", request.getResource());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearResource().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getIamPolicyMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/GetIamPolicy")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{resource=projects/*/locations/*/repositories/*}:getIamPolicy",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "resource", request.getResource());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "options", request.getOptions());
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(Policy.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ testIamPermissionsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/TestIamPermissions")
+ .setHttpMethod("POST")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{resource=projects/*/locations/*/repositories/*}:testIamPermissions",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "resource", request.getResource());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("*", request.toBuilder().clearResource().build()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ getProjectSettingsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/GetProjectSettings")
+ .setHttpMethod("GET")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{name=projects/*/projectSettings}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(fields, "name", request.getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ return fields;
+ })
+ .setRequestBodyExtractor(request -> null)
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.newBuilder()
+ .setDefaultInstance(ProjectSettings.getDefaultInstance())
+ .setDefaultTypeRegistry(typeRegistry)
+ .build())
+ .build();
+
+ private static final ApiMethodDescriptor
+ updateProjectSettingsMethodDescriptor =
+ ApiMethodDescriptor.newBuilder()
+ .setFullMethodName(
+ "google.devtools.artifactregistry.v1.ArtifactRegistry/UpdateProjectSettings")
+ .setHttpMethod("PATCH")
+ .setType(ApiMethodDescriptor.MethodType.UNARY)
+ .setRequestFormatter(
+ ProtoMessageRequestFormatter.newBuilder()
+ .setPath(
+ "/v1/{projectSettings.name=projects/*/projectSettings}",
+ request -> {
+ Map fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putPathParam(
+ fields,
+ "projectSettings.name",
+ request.getProjectSettings().getName());
+ return fields;
+ })
+ .setQueryParamsExtractor(
+ request -> {
+ Map> fields = new HashMap<>();
+ ProtoRestSerializer serializer =
+ ProtoRestSerializer.create();
+ serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
+ return fields;
+ })
+ .setRequestBodyExtractor(
+ request ->
+ ProtoRestSerializer.create()
+ .toBody("projectSettings", request.getProjectSettings()))
+ .build())
+ .setResponseParser(
+ ProtoMessageResponseParser.