From 3764ef67c52af1692e2b66a7100c203d74c75c54 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 8 Oct 2021 22:51:43 -0400 Subject: [PATCH] feat: Artifact Registry v1 public protos (#159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Artifact Registry v1 public protos Committer: @alexander-fenster PiperOrigin-RevId: 398316447 Source-Link: https://github.com/googleapis/googleapis/commit/6d40da43945ec7e26972845a167b2a49a5a457f8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95ac2d4027c540ddbde94986555f8f84a443e723 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTVhYzJkNDAyN2M1NDBkZGJkZTk0OTg2NTU1ZjhmODRhNDQzZTcyMyJ9 * đŸ¦‰ Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Remove unused dependency Co-authored-by: Owl Bot Co-authored-by: Chanseok Oh --- google-cloud-artifact-registry-bom/pom.xml | 10 + google-cloud-artifact-registry/pom.xml | 9 + .../v1/ArtifactRegistryClient.java | 691 +++++ .../v1/ArtifactRegistrySettings.java | 214 ++ .../artifactregistry/v1/gapic_metadata.json | 27 + .../artifactregistry/v1/package-info.java | 51 + .../v1/stub/ArtifactRegistryStub.java | 67 + .../v1/stub/ArtifactRegistryStubSettings.java | 464 ++++ .../GrpcArtifactRegistryCallableFactory.java | 113 + .../v1/stub/GrpcArtifactRegistryStub.java | 260 ++ .../v1/ArtifactRegistryClientTest.java | 301 +++ .../v1/MockArtifactRegistry.java | 59 + .../v1/MockArtifactRegistryImpl.java | 123 + .../pom.xml | 65 + .../v1/ArtifactRegistryGrpc.java | 655 +++++ pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 46 + .../artifactregistry/v1/ArtifactProto.java | 125 + .../artifactregistry/v1/DockerImage.java | 2068 +++++++++++++++ .../v1/DockerImageOrBuilder.java | 276 ++ .../v1/GetRepositoryRequest.java | 654 +++++ .../v1/GetRepositoryRequestOrBuilder.java | 54 + .../v1/ListDockerImagesRequest.java | 913 +++++++ .../v1/ListDockerImagesRequestOrBuilder.java | 88 + .../v1/ListDockerImagesResponse.java | 1156 ++++++++ .../v1/ListDockerImagesResponseOrBuilder.java | 104 + .../v1/ListRepositoriesRequest.java | 927 +++++++ .../v1/ListRepositoriesRequestOrBuilder.java | 92 + .../v1/ListRepositoriesResponse.java | 1156 ++++++++ .../v1/ListRepositoriesResponseOrBuilder.java | 104 + .../artifactregistry/v1/LocationName.java | 192 ++ .../artifactregistry/v1/Repository.java | 2339 +++++++++++++++++ .../artifactregistry/v1/RepositoryName.java | 223 ++ .../v1/RepositoryOrBuilder.java | 277 ++ .../artifactregistry/v1/RepositoryProto.java | 161 ++ .../artifactregistry/v1/ServiceProto.java | 99 + .../artifactregistry/v1/artifact.proto | 106 + .../artifactregistry/v1/repository.proto | 129 + .../artifactregistry/v1/service.proto | 75 + versions.txt | 2 + 41 files changed, 14506 insertions(+) create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/gapic_metadata.json create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/package-info.java create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStub.java create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStubSettings.java create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryCallableFactory.java create mode 100644 google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryStub.java create mode 100644 google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClientTest.java create mode 100644 google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistry.java create mode 100644 google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistryImpl.java create mode 100644 grpc-google-cloud-artifact-registry-v1/pom.xml create mode 100644 grpc-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryGrpc.java create mode 100644 proto-google-cloud-artifact-registry-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-artifact-registry-v1/pom.xml create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactProto.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImage.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImageOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequest.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequestOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequest.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequestOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponse.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponseOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequest.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequestOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponse.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponseOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/LocationName.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/Repository.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryName.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryOrBuilder.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryProto.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ServiceProto.java create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/artifact.proto create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/repository.proto create mode 100644 proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/service.proto diff --git a/google-cloud-artifact-registry-bom/pom.xml b/google-cloud-artifact-registry-bom/pom.xml index e79e473b..d6fecf1f 100644 --- a/google-cloud-artifact-registry-bom/pom.xml +++ b/google-cloud-artifact-registry-bom/pom.xml @@ -63,11 +63,21 @@ grpc-google-cloud-artifact-registry-v1beta2 0.4.4-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-artifact-registry-v1 + 0.4.4-SNAPSHOT + com.google.api.grpc proto-google-cloud-artifact-registry-v1beta2 0.4.4-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-artifact-registry-v1 + 0.4.4-SNAPSHOT + diff --git a/google-cloud-artifact-registry/pom.xml b/google-cloud-artifact-registry/pom.xml index 5fb500e2..07ed346a 100644 --- a/google-cloud-artifact-registry/pom.xml +++ b/google-cloud-artifact-registry/pom.xml @@ -42,6 +42,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-artifact-registry-v1 + com.google.api.grpc proto-google-cloud-artifact-registry-v1beta2 @@ -80,6 +84,11 @@ grpc-google-cloud-artifact-registry-v1beta2 test + + com.google.api.grpc + grpc-google-cloud-artifact-registry-v1 + test + com.google.api 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 new file mode 100644 index 00000000..084d6f31 --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java @@ -0,0 +1,691 @@ +/* + * Copyright 2021 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; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.devtools.artifactregistry.v1.stub.ArtifactRegistryStub; +import com.google.devtools.artifactregistry.v1.stub.ArtifactRegistryStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The Artifact Registry API service. + * + *

Artifact Registry is an artifact management system for storing artifacts from different + * package management systems. + * + *

The resources managed by this API are: + * + *

    + *
  • Repositories, which group packages and their data. + *
  • Packages, which group versions and their tags. + *
  • Versions, which are specific forms of a package. + *
  • Tags, which represent alternative names for versions. + *
  • Files, which contain content and are optionally associated with a Package or Version. + *
+ * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+ *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Repository response = artifactRegistryClient.getRepository(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ArtifactRegistryClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ArtifactRegistrySettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * ArtifactRegistrySettings artifactRegistrySettings =
+ *     ArtifactRegistrySettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ArtifactRegistryClient artifactRegistryClient =
+ *     ArtifactRegistryClient.create(artifactRegistrySettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * ArtifactRegistrySettings artifactRegistrySettings =
+ *     ArtifactRegistrySettings.newBuilder().setEndpoint(myEndpoint).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; + + /** Constructs an instance of ArtifactRegistryClient with default settings. */ + public static final ArtifactRegistryClient create() throws IOException { + return create(ArtifactRegistrySettings.newBuilder().build()); + } + + /** + * Constructs an instance of ArtifactRegistryClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ArtifactRegistryClient create(ArtifactRegistrySettings settings) + throws IOException { + return new ArtifactRegistryClient(settings); + } + + /** + * 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); + } + + /** + * Constructs an instance of ArtifactRegistryClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ArtifactRegistryClient(ArtifactRegistrySettings settings) throws IOException { + this.settings = settings; + this.stub = ((ArtifactRegistryStubSettings) settings.getStubSettings()).createStub(); + } + + @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; + } + + 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; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists docker images. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   String parent = "parent-995424086";
+   *   for (DockerImage element : artifactRegistryClient.listDockerImages(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource whose docker images will be listed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDockerImagesPagedResponse listDockerImages(String parent) { + ListDockerImagesRequest request = + ListDockerImagesRequest.newBuilder().setParent(parent).build(); + return listDockerImages(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists docker images. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   ListDockerImagesRequest request =
+   *       ListDockerImagesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (DockerImage element : artifactRegistryClient.listDockerImages(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDockerImagesPagedResponse listDockerImages(ListDockerImagesRequest request) { + return listDockerImagesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists docker images. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   ListDockerImagesRequest request =
+   *       ListDockerImagesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       artifactRegistryClient.listDockerImagesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (DockerImage element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDockerImagesPagedCallable() { + return stub.listDockerImagesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists docker images. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   ListDockerImagesRequest request =
+   *       ListDockerImagesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDockerImagesResponse response =
+   *         artifactRegistryClient.listDockerImagesCallable().call(request);
+   *     for (DockerImage element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDockerImagesCallable() { + return stub.listDockerImagesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists repositories. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Repository element : artifactRegistryClient.listRepositories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource whose repositories will be listed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRepositoriesPagedResponse listRepositories(LocationName parent) { + ListRepositoriesRequest request = + ListRepositoriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listRepositories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists repositories. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   String parent = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
+   *   for (Repository element : artifactRegistryClient.listRepositories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource whose repositories will be listed. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRepositoriesPagedResponse listRepositories(String parent) { + ListRepositoriesRequest request = + ListRepositoriesRequest.newBuilder().setParent(parent).build(); + return listRepositories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists repositories. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   ListRepositoriesRequest request =
+   *       ListRepositoriesRequest.newBuilder()
+   *           .setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Repository element : artifactRegistryClient.listRepositories(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequest request) { + return listRepositoriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists repositories. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   ListRepositoriesRequest request =
+   *       ListRepositoriesRequest.newBuilder()
+   *           .setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       artifactRegistryClient.listRepositoriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Repository element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listRepositoriesPagedCallable() { + return stub.listRepositoriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists repositories. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   ListRepositoriesRequest request =
+   *       ListRepositoriesRequest.newBuilder()
+   *           .setParent(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListRepositoriesResponse response =
+   *         artifactRegistryClient.listRepositoriesCallable().call(request);
+   *     for (Repository element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listRepositoriesCallable() { + return stub.listRepositoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a repository. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Repository response = artifactRegistryClient.getRepository(name);
+   * }
+   * }
+ * + * @param name Required. The name of the repository to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Repository getRepository(LocationName name) { + GetRepositoryRequest request = + GetRepositoryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRepository(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a repository. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   String name = RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString();
+   *   Repository response = artifactRegistryClient.getRepository(name);
+   * }
+   * }
+ * + * @param name Required. The name of the repository to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Repository getRepository(String name) { + GetRepositoryRequest request = GetRepositoryRequest.newBuilder().setName(name).build(); + return getRepository(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a repository. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   GetRepositoryRequest request =
+   *       GetRepositoryRequest.newBuilder()
+   *           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
+   *           .build();
+   *   Repository response = artifactRegistryClient.getRepository(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Repository getRepository(GetRepositoryRequest request) { + return getRepositoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a repository. + * + *

Sample code: + * + *

{@code
+   * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+   *   GetRepositoryRequest request =
+   *       GetRepositoryRequest.newBuilder()
+   *           .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       artifactRegistryClient.getRepositoryCallable().futureCall(request);
+   *   // Do something.
+   *   Repository response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getRepositoryCallable() { + return stub.getRepositoryCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListDockerImagesPagedResponse + extends AbstractPagedListResponse< + ListDockerImagesRequest, + ListDockerImagesResponse, + DockerImage, + ListDockerImagesPage, + ListDockerImagesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDockerImagesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDockerImagesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDockerImagesPagedResponse(ListDockerImagesPage page) { + super(page, ListDockerImagesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDockerImagesPage + extends AbstractPage< + ListDockerImagesRequest, ListDockerImagesResponse, DockerImage, ListDockerImagesPage> { + + private ListDockerImagesPage( + PageContext context, + ListDockerImagesResponse response) { + super(context, response); + } + + private static ListDockerImagesPage createEmptyPage() { + return new ListDockerImagesPage(null, null); + } + + @Override + protected ListDockerImagesPage createPage( + PageContext context, + ListDockerImagesResponse response) { + return new ListDockerImagesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDockerImagesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDockerImagesRequest, + ListDockerImagesResponse, + DockerImage, + ListDockerImagesPage, + ListDockerImagesFixedSizeCollection> { + + private ListDockerImagesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDockerImagesFixedSizeCollection createEmptyCollection() { + return new ListDockerImagesFixedSizeCollection(null, 0); + } + + @Override + protected ListDockerImagesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDockerImagesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListRepositoriesPagedResponse + extends AbstractPagedListResponse< + ListRepositoriesRequest, + ListRepositoriesResponse, + Repository, + ListRepositoriesPage, + ListRepositoriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRepositoriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListRepositoriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListRepositoriesPagedResponse(ListRepositoriesPage page) { + super(page, ListRepositoriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRepositoriesPage + extends AbstractPage< + ListRepositoriesRequest, ListRepositoriesResponse, Repository, ListRepositoriesPage> { + + private ListRepositoriesPage( + PageContext context, + ListRepositoriesResponse response) { + super(context, response); + } + + private static ListRepositoriesPage createEmptyPage() { + return new ListRepositoriesPage(null, null); + } + + @Override + protected ListRepositoriesPage createPage( + PageContext context, + ListRepositoriesResponse response) { + return new ListRepositoriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRepositoriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRepositoriesRequest, + ListRepositoriesResponse, + Repository, + ListRepositoriesPage, + ListRepositoriesFixedSizeCollection> { + + private ListRepositoriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRepositoriesFixedSizeCollection createEmptyCollection() { + return new ListRepositoriesFixedSizeCollection(null, 0); + } + + @Override + protected ListRepositoriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRepositoriesFixedSizeCollection(pages, collectionSize); + } + } +} 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 new file mode 100644 index 00000000..d26e4838 --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java @@ -0,0 +1,214 @@ +/* + * Copyright 2021 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; + +import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListDockerImagesPagedResponse; +import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListRepositoriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.devtools.artifactregistry.v1.stub.ArtifactRegistryStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ArtifactRegistryClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (artifactregistry.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getRepository to 30 seconds: + * + *

{@code
+ * ArtifactRegistrySettings.Builder artifactRegistrySettingsBuilder =
+ *     ArtifactRegistrySettings.newBuilder();
+ * artifactRegistrySettingsBuilder
+ *     .getRepositorySettings()
+ *     .setRetrySettings(
+ *         artifactRegistrySettingsBuilder
+ *             .getRepositorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ArtifactRegistrySettings artifactRegistrySettings = artifactRegistrySettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ArtifactRegistrySettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listDockerImages. */ + public PagedCallSettings< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + listDockerImagesSettings() { + return ((ArtifactRegistryStubSettings) getStubSettings()).listDockerImagesSettings(); + } + + /** Returns the object with the settings used for calls to listRepositories. */ + public PagedCallSettings< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings() { + return ((ArtifactRegistryStubSettings) getStubSettings()).listRepositoriesSettings(); + } + + /** Returns the object with the settings used for calls to getRepository. */ + public UnaryCallSettings getRepositorySettings() { + return ((ArtifactRegistryStubSettings) getStubSettings()).getRepositorySettings(); + } + + public static final ArtifactRegistrySettings create(ArtifactRegistryStubSettings stub) + throws IOException { + return new ArtifactRegistrySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ArtifactRegistryStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ArtifactRegistryStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ArtifactRegistryStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ArtifactRegistryStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ArtifactRegistryStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ArtifactRegistryStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ArtifactRegistryStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ArtifactRegistrySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ArtifactRegistrySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ArtifactRegistryStubSettings.newBuilder(clientContext)); + } + + protected Builder(ArtifactRegistrySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ArtifactRegistryStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ArtifactRegistryStubSettings.newBuilder()); + } + + public ArtifactRegistryStubSettings.Builder getStubSettingsBuilder() { + return ((ArtifactRegistryStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listDockerImages. */ + public PagedCallSettings.Builder< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + listDockerImagesSettings() { + return getStubSettingsBuilder().listDockerImagesSettings(); + } + + /** Returns the builder for the settings used for calls to listRepositories. */ + public PagedCallSettings.Builder< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings() { + return getStubSettingsBuilder().listRepositoriesSettings(); + } + + /** Returns the builder for the settings used for calls to getRepository. */ + public UnaryCallSettings.Builder getRepositorySettings() { + return getStubSettingsBuilder().getRepositorySettings(); + } + + @Override + public ArtifactRegistrySettings build() throws IOException { + return new ArtifactRegistrySettings(this); + } + } +} diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/gapic_metadata.json b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/gapic_metadata.json new file mode 100644 index 00000000..d7339c6f --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/gapic_metadata.json @@ -0,0 +1,27 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.devtools.artifactregistry.v1", + "libraryPackage": "com.google.devtools.artifactregistry.v1", + "services": { + "ArtifactRegistry": { + "clients": { + "grpc": { + "libraryClient": "ArtifactRegistryClient", + "rpcs": { + "GetRepository": { + "methods": ["getRepository", "getRepository", "getRepository", "getRepositoryCallable"] + }, + "ListDockerImages": { + "methods": ["listDockerImages", "listDockerImages", "listDockerImagesPagedCallable", "listDockerImagesCallable"] + }, + "ListRepositories": { + "methods": ["listRepositories", "listRepositories", "listRepositories", "listRepositoriesPagedCallable", "listRepositoriesCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/package-info.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/package-info.java new file mode 100644 index 00000000..fad25323 --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/package-info.java @@ -0,0 +1,51 @@ +/* + * Copyright 2021 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. + */ + +/** + * A client to Artifact Registry API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= ArtifactRegistryClient ======================= + * + *

Service Description: The Artifact Registry API service. + * + *

Artifact Registry is an artifact management system for storing artifacts from different + * package management systems. + * + *

The resources managed by this API are: + * + *

    + *
  • Repositories, which group packages and their data. + *
  • Packages, which group versions and their tags. + *
  • Versions, which are specific forms of a package. + *
  • Tags, which represent alternative names for versions. + *
  • Files, which contain content and are optionally associated with a Package or Version. + *
+ * + *

Sample for ArtifactRegistryClient: + * + *

{@code
+ * try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
+ *   LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Repository response = artifactRegistryClient.getRepository(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.devtools.artifactregistry.v1; + +import javax.annotation.Generated; 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 new file mode 100644 index 00000000..d6d0933f --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStub.java @@ -0,0 +1,67 @@ +/* + * Copyright 2021 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.ListRepositoriesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.devtools.artifactregistry.v1.GetRepositoryRequest; +import com.google.devtools.artifactregistry.v1.ListDockerImagesRequest; +import com.google.devtools.artifactregistry.v1.ListDockerImagesResponse; +import com.google.devtools.artifactregistry.v1.ListRepositoriesRequest; +import com.google.devtools.artifactregistry.v1.ListRepositoriesResponse; +import com.google.devtools.artifactregistry.v1.Repository; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ArtifactRegistry service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ArtifactRegistryStub implements BackgroundResource { + + public UnaryCallable + listDockerImagesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDockerImagesPagedCallable()"); + } + + public UnaryCallable + listDockerImagesCallable() { + throw new UnsupportedOperationException("Not implemented: listDockerImagesCallable()"); + } + + public UnaryCallable + listRepositoriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRepositoriesPagedCallable()"); + } + + public UnaryCallable + listRepositoriesCallable() { + throw new UnsupportedOperationException("Not implemented: listRepositoriesCallable()"); + } + + public UnaryCallable getRepositoryCallable() { + throw new UnsupportedOperationException("Not implemented: getRepositoryCallable()"); + } + + @Override + public abstract void close(); +} 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 new file mode 100644 index 00000000..4100d74a --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/ArtifactRegistryStubSettings.java @@ -0,0 +1,464 @@ +/* + * Copyright 2021 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.ListRepositoriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.devtools.artifactregistry.v1.DockerImage; +import com.google.devtools.artifactregistry.v1.GetRepositoryRequest; +import com.google.devtools.artifactregistry.v1.ListDockerImagesRequest; +import com.google.devtools.artifactregistry.v1.ListDockerImagesResponse; +import com.google.devtools.artifactregistry.v1.ListRepositoriesRequest; +import com.google.devtools.artifactregistry.v1.ListRepositoriesResponse; +import com.google.devtools.artifactregistry.v1.Repository; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ArtifactRegistryStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (artifactregistry.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getRepository to 30 seconds: + * + *

{@code
+ * ArtifactRegistryStubSettings.Builder artifactRegistrySettingsBuilder =
+ *     ArtifactRegistryStubSettings.newBuilder();
+ * artifactRegistrySettingsBuilder
+ *     .getRepositorySettings()
+ *     .setRetrySettings(
+ *         artifactRegistrySettingsBuilder
+ *             .getRepositorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ArtifactRegistryStubSettings artifactRegistrySettings = artifactRegistrySettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ArtifactRegistryStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final PagedCallSettings< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + listDockerImagesSettings; + private final PagedCallSettings< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings; + private final UnaryCallSettings getRepositorySettings; + + private static final PagedListDescriptor< + ListDockerImagesRequest, ListDockerImagesResponse, DockerImage> + LIST_DOCKER_IMAGES_PAGE_STR_DESC = + new PagedListDescriptor< + ListDockerImagesRequest, ListDockerImagesResponse, DockerImage>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDockerImagesRequest injectToken( + ListDockerImagesRequest payload, String token) { + return ListDockerImagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDockerImagesRequest injectPageSize( + ListDockerImagesRequest payload, int pageSize) { + return ListDockerImagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDockerImagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDockerImagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDockerImagesResponse payload) { + return payload.getDockerImagesList() == null + ? ImmutableList.of() + : payload.getDockerImagesList(); + } + }; + + private static final PagedListDescriptor< + ListRepositoriesRequest, ListRepositoriesResponse, Repository> + LIST_REPOSITORIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRepositoriesRequest injectToken( + ListRepositoriesRequest payload, String token) { + return ListRepositoriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRepositoriesRequest injectPageSize( + ListRepositoriesRequest payload, int pageSize) { + return ListRepositoriesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRepositoriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRepositoriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRepositoriesResponse payload) { + return payload.getRepositoriesList() == null + ? ImmutableList.of() + : payload.getRepositoriesList(); + } + }; + + private static final PagedListResponseFactory< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + LIST_DOCKER_IMAGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDockerImagesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_DOCKER_IMAGES_PAGE_STR_DESC, request, context); + return ListDockerImagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + LIST_REPOSITORIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRepositoriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_REPOSITORIES_PAGE_STR_DESC, request, context); + return ListRepositoriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listDockerImages. */ + public PagedCallSettings< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + listDockerImagesSettings() { + return listDockerImagesSettings; + } + + /** Returns the object with the settings used for calls to listRepositories. */ + public PagedCallSettings< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings() { + return listRepositoriesSettings; + } + + /** Returns the object with the settings used for calls to getRepository. */ + public UnaryCallSettings getRepositorySettings() { + return getRepositorySettings; + } + + @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); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "artifactregistry.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "artifactregistry.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + 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() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ArtifactRegistryStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ArtifactRegistryStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listDockerImagesSettings = settingsBuilder.listDockerImagesSettings().build(); + listRepositoriesSettings = settingsBuilder.listRepositoriesSettings().build(); + getRepositorySettings = settingsBuilder.getRepositorySettings().build(); + } + + /** Builder for ArtifactRegistryStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + listDockerImagesSettings; + private final PagedCallSettings.Builder< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings; + private final UnaryCallSettings.Builder getRepositorySettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listDockerImagesSettings = PagedCallSettings.newBuilder(LIST_DOCKER_IMAGES_PAGE_STR_FACT); + listRepositoriesSettings = PagedCallSettings.newBuilder(LIST_REPOSITORIES_PAGE_STR_FACT); + getRepositorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listDockerImagesSettings, listRepositoriesSettings, getRepositorySettings); + initDefaults(this); + } + + protected Builder(ArtifactRegistryStubSettings settings) { + super(settings); + + listDockerImagesSettings = settings.listDockerImagesSettings.toBuilder(); + listRepositoriesSettings = settings.listRepositoriesSettings.toBuilder(); + getRepositorySettings = settings.getRepositorySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listDockerImagesSettings, listRepositoriesSettings, getRepositorySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listDockerImagesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listRepositoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getRepositorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listDockerImages. */ + public PagedCallSettings.Builder< + ListDockerImagesRequest, ListDockerImagesResponse, ListDockerImagesPagedResponse> + listDockerImagesSettings() { + return listDockerImagesSettings; + } + + /** Returns the builder for the settings used for calls to listRepositories. */ + public PagedCallSettings.Builder< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings() { + return listRepositoriesSettings; + } + + /** Returns the builder for the settings used for calls to getRepository. */ + public UnaryCallSettings.Builder getRepositorySettings() { + return getRepositorySettings; + } + + @Override + public ArtifactRegistryStubSettings build() throws IOException { + return new ArtifactRegistryStubSettings(this); + } + } +} diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryCallableFactory.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryCallableFactory.java new file mode 100644 index 00000000..59399408 --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 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.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +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.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the ArtifactRegistry service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcArtifactRegistryCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryStub.java b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryStub.java new file mode 100644 index 00000000..4b98b6d0 --- /dev/null +++ b/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/stub/GrpcArtifactRegistryStub.java @@ -0,0 +1,260 @@ +/* + * Copyright 2021 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.ListRepositoriesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.artifactregistry.v1.GetRepositoryRequest; +import com.google.devtools.artifactregistry.v1.ListDockerImagesRequest; +import com.google.devtools.artifactregistry.v1.ListDockerImagesResponse; +import com.google.devtools.artifactregistry.v1.ListRepositoriesRequest; +import com.google.devtools.artifactregistry.v1.ListRepositoriesResponse; +import com.google.devtools.artifactregistry.v1.Repository; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ArtifactRegistry service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcArtifactRegistryStub extends ArtifactRegistryStub { + private static final MethodDescriptor + listDockerImagesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.artifactregistry.v1.ArtifactRegistry/ListDockerImages") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDockerImagesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDockerImagesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRepositoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.artifactregistry.v1.ArtifactRegistry/ListRepositories") + .setRequestMarshaller( + ProtoUtils.marshaller(ListRepositoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRepositoriesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getRepositoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.artifactregistry.v1.ArtifactRegistry/GetRepository") + .setRequestMarshaller( + ProtoUtils.marshaller(GetRepositoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Repository.getDefaultInstance())) + .build(); + + private final UnaryCallable + listDockerImagesCallable; + private final UnaryCallable + listDockerImagesPagedCallable; + private final UnaryCallable + listRepositoriesCallable; + private final UnaryCallable + listRepositoriesPagedCallable; + private final UnaryCallable getRepositoryCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcArtifactRegistryStub create(ArtifactRegistryStubSettings settings) + throws IOException { + return new GrpcArtifactRegistryStub(settings, ClientContext.create(settings)); + } + + public static final GrpcArtifactRegistryStub create(ClientContext clientContext) + throws IOException { + return new GrpcArtifactRegistryStub( + ArtifactRegistryStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcArtifactRegistryStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcArtifactRegistryStub( + ArtifactRegistryStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcArtifactRegistryStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcArtifactRegistryStub( + ArtifactRegistryStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcArtifactRegistryCallableFactory()); + } + + /** + * Constructs an instance of GrpcArtifactRegistryStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcArtifactRegistryStub( + ArtifactRegistryStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listDockerImagesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDockerImagesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + listRepositoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRepositoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getRepositoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRepositoryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.listDockerImagesCallable = + callableFactory.createUnaryCallable( + listDockerImagesTransportSettings, settings.listDockerImagesSettings(), clientContext); + this.listDockerImagesPagedCallable = + callableFactory.createPagedCallable( + listDockerImagesTransportSettings, settings.listDockerImagesSettings(), clientContext); + this.listRepositoriesCallable = + callableFactory.createUnaryCallable( + listRepositoriesTransportSettings, settings.listRepositoriesSettings(), clientContext); + this.listRepositoriesPagedCallable = + callableFactory.createPagedCallable( + listRepositoriesTransportSettings, settings.listRepositoriesSettings(), clientContext); + this.getRepositoryCallable = + callableFactory.createUnaryCallable( + getRepositoryTransportSettings, settings.getRepositorySettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listDockerImagesCallable() { + return listDockerImagesCallable; + } + + @Override + public UnaryCallable + listDockerImagesPagedCallable() { + return listDockerImagesPagedCallable; + } + + @Override + public UnaryCallable + listRepositoriesCallable() { + return listRepositoriesCallable; + } + + @Override + public UnaryCallable + listRepositoriesPagedCallable() { + return listRepositoriesPagedCallable; + } + + @Override + public UnaryCallable getRepositoryCallable() { + return getRepositoryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClientTest.java b/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClientTest.java new file mode 100644 index 00000000..0398d32c --- /dev/null +++ b/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClientTest.java @@ -0,0 +1,301 @@ +/* + * Copyright 2021 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; + +import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListDockerImagesPagedResponse; +import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListRepositoriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ArtifactRegistryClientTest { + private static MockArtifactRegistry mockArtifactRegistry; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ArtifactRegistryClient client; + + @BeforeClass + public static void startStaticServer() { + mockArtifactRegistry = new MockArtifactRegistry(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockArtifactRegistry)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ArtifactRegistrySettings settings = + ArtifactRegistrySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ArtifactRegistryClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listDockerImagesTest() throws Exception { + DockerImage responsesElement = DockerImage.newBuilder().build(); + ListDockerImagesResponse expectedResponse = + ListDockerImagesResponse.newBuilder() + .setNextPageToken("") + .addAllDockerImages(Arrays.asList(responsesElement)) + .build(); + mockArtifactRegistry.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDockerImagesPagedResponse pagedListResponse = client.listDockerImages(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDockerImagesList().get(0), resources.get(0)); + + List actualRequests = mockArtifactRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDockerImagesRequest actualRequest = ((ListDockerImagesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDockerImagesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockArtifactRegistry.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDockerImages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRepositoriesTest() throws Exception { + Repository responsesElement = Repository.newBuilder().build(); + ListRepositoriesResponse expectedResponse = + ListRepositoriesResponse.newBuilder() + .setNextPageToken("") + .addAllRepositories(Arrays.asList(responsesElement)) + .build(); + mockArtifactRegistry.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRepositoriesPagedResponse pagedListResponse = client.listRepositories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRepositoriesList().get(0), resources.get(0)); + + List actualRequests = mockArtifactRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRepositoriesRequest actualRequest = ((ListRepositoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRepositoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockArtifactRegistry.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRepositories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRepositoriesTest2() throws Exception { + Repository responsesElement = Repository.newBuilder().build(); + ListRepositoriesResponse expectedResponse = + ListRepositoriesResponse.newBuilder() + .setNextPageToken("") + .addAllRepositories(Arrays.asList(responsesElement)) + .build(); + mockArtifactRegistry.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRepositoriesPagedResponse pagedListResponse = client.listRepositories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRepositoriesList().get(0), resources.get(0)); + + List actualRequests = mockArtifactRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRepositoriesRequest actualRequest = ((ListRepositoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRepositoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockArtifactRegistry.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRepositories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRepositoryTest() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString()) + .setDescription("description-1724546052") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockArtifactRegistry.addResponse(expectedResponse); + + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + + Repository actualResponse = client.getRepository(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockArtifactRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRepositoryRequest actualRequest = ((GetRepositoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRepositoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockArtifactRegistry.addException(exception); + + try { + LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); + client.getRepository(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRepositoryTest2() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString()) + .setDescription("description-1724546052") + .putAllLabels(new HashMap()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .build(); + mockArtifactRegistry.addResponse(expectedResponse); + + String name = "name3373707"; + + Repository actualResponse = client.getRepository(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockArtifactRegistry.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRepositoryRequest actualRequest = ((GetRepositoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRepositoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockArtifactRegistry.addException(exception); + + try { + String name = "name3373707"; + client.getRepository(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistry.java b/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistry.java new file mode 100644 index 00000000..e38d9198 --- /dev/null +++ b/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistry.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 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; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockArtifactRegistry implements MockGrpcService { + private final MockArtifactRegistryImpl serviceImpl; + + public MockArtifactRegistry() { + serviceImpl = new MockArtifactRegistryImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistryImpl.java b/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistryImpl.java new file mode 100644 index 00000000..b6379771 --- /dev/null +++ b/google-cloud-artifact-registry/src/test/java/com/google/devtools/artifactregistry/v1/MockArtifactRegistryImpl.java @@ -0,0 +1,123 @@ +/* + * Copyright 2021 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; + +import com.google.api.core.BetaApi; +import com.google.devtools.artifactregistry.v1.ArtifactRegistryGrpc.ArtifactRegistryImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockArtifactRegistryImpl extends ArtifactRegistryImplBase { + private List requests; + private Queue responses; + + public MockArtifactRegistryImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listDockerImages( + ListDockerImagesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDockerImagesResponse) { + requests.add(request); + responseObserver.onNext(((ListDockerImagesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListDockerImages, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDockerImagesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRepositories( + ListRepositoriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRepositoriesResponse) { + requests.add(request); + responseObserver.onNext(((ListRepositoriesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRepositories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRepositoriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRepository( + GetRepositoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Repository) { + requests.add(request); + responseObserver.onNext(((Repository) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetRepository, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Repository.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-artifact-registry-v1/pom.xml b/grpc-google-cloud-artifact-registry-v1/pom.xml new file mode 100644 index 00000000..7800a177 --- /dev/null +++ b/grpc-google-cloud-artifact-registry-v1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-artifact-registry-v1 + 0.4.4-SNAPSHOT + grpc-google-cloud-artifact-registry-v1 + GRPC library for google-cloud-artifact-registry + + com.google.cloud + google-cloud-artifact-registry-parent + 0.4.4-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-artifact-registry-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/grpc-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryGrpc.java b/grpc-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryGrpc.java new file mode 100644 index 00000000..fe5805d1 --- /dev/null +++ b/grpc-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryGrpc.java @@ -0,0 +1,655 @@ +/* + * Copyright 2020 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; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The Artifact Registry API service.
+ * Artifact Registry is an artifact management system for storing artifacts
+ * from different package management systems.
+ * The resources managed by this API are:
+ * * Repositories, which group packages and their data.
+ * * Packages, which group versions and their tags.
+ * * Versions, which are specific forms of a package.
+ * * Tags, which represent alternative names for versions.
+ * * Files, which contain content and are optionally associated with a Package
+ *   or Version.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/devtools/artifactregistry/v1/service.proto") +public final class ArtifactRegistryGrpc { + + private ArtifactRegistryGrpc() {} + + public static final String SERVICE_NAME = "google.devtools.artifactregistry.v1.ArtifactRegistry"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest, + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse> + getListDockerImagesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDockerImages", + requestType = com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.class, + responseType = com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest, + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse> + getListDockerImagesMethod() { + io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest, + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse> + getListDockerImagesMethod; + if ((getListDockerImagesMethod = ArtifactRegistryGrpc.getListDockerImagesMethod) == null) { + synchronized (ArtifactRegistryGrpc.class) { + if ((getListDockerImagesMethod = ArtifactRegistryGrpc.getListDockerImagesMethod) == null) { + ArtifactRegistryGrpc.getListDockerImagesMethod = + getListDockerImagesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDockerImages")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ArtifactRegistryMethodDescriptorSupplier("ListDockerImages")) + .build(); + } + } + } + return getListDockerImagesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest, + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse> + getListRepositoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRepositories", + requestType = com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.class, + responseType = com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest, + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse> + getListRepositoriesMethod() { + io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest, + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse> + getListRepositoriesMethod; + if ((getListRepositoriesMethod = ArtifactRegistryGrpc.getListRepositoriesMethod) == null) { + synchronized (ArtifactRegistryGrpc.class) { + if ((getListRepositoriesMethod = ArtifactRegistryGrpc.getListRepositoriesMethod) == null) { + ArtifactRegistryGrpc.getListRepositoriesMethod = + getListRepositoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRepositories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ArtifactRegistryMethodDescriptorSupplier("ListRepositories")) + .build(); + } + } + } + return getListRepositoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.GetRepositoryRequest, + com.google.devtools.artifactregistry.v1.Repository> + getGetRepositoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRepository", + requestType = com.google.devtools.artifactregistry.v1.GetRepositoryRequest.class, + responseType = com.google.devtools.artifactregistry.v1.Repository.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.GetRepositoryRequest, + com.google.devtools.artifactregistry.v1.Repository> + getGetRepositoryMethod() { + io.grpc.MethodDescriptor< + com.google.devtools.artifactregistry.v1.GetRepositoryRequest, + com.google.devtools.artifactregistry.v1.Repository> + getGetRepositoryMethod; + if ((getGetRepositoryMethod = ArtifactRegistryGrpc.getGetRepositoryMethod) == null) { + synchronized (ArtifactRegistryGrpc.class) { + if ((getGetRepositoryMethod = ArtifactRegistryGrpc.getGetRepositoryMethod) == null) { + ArtifactRegistryGrpc.getGetRepositoryMethod = + getGetRepositoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRepository")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.devtools.artifactregistry.v1.Repository + .getDefaultInstance())) + .setSchemaDescriptor( + new ArtifactRegistryMethodDescriptorSupplier("GetRepository")) + .build(); + } + } + } + return getGetRepositoryMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ArtifactRegistryStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ArtifactRegistryStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ArtifactRegistryStub(channel, callOptions); + } + }; + return ArtifactRegistryStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ArtifactRegistryBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ArtifactRegistryBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ArtifactRegistryBlockingStub(channel, callOptions); + } + }; + return ArtifactRegistryBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ArtifactRegistryFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ArtifactRegistryFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ArtifactRegistryFutureStub(channel, callOptions); + } + }; + return ArtifactRegistryFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The Artifact Registry API service.
+   * Artifact Registry is an artifact management system for storing artifacts
+   * from different package management systems.
+   * The resources managed by this API are:
+   * * Repositories, which group packages and their data.
+   * * Packages, which group versions and their tags.
+   * * Versions, which are specific forms of a package.
+   * * Tags, which represent alternative names for versions.
+   * * Files, which contain content and are optionally associated with a Package
+   *   or Version.
+   * 
+ */ + public abstract static class ArtifactRegistryImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists docker images.
+     * 
+ */ + public void listDockerImages( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest request, + io.grpc.stub.StreamObserver< + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDockerImagesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists repositories.
+     * 
+ */ + public void listRepositories( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest request, + io.grpc.stub.StreamObserver< + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRepositoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a repository.
+     * 
+ */ + public void getRepository( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetRepositoryMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListDockerImagesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest, + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse>( + this, METHODID_LIST_DOCKER_IMAGES))) + .addMethod( + getListRepositoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest, + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse>( + this, METHODID_LIST_REPOSITORIES))) + .addMethod( + getGetRepositoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.devtools.artifactregistry.v1.GetRepositoryRequest, + com.google.devtools.artifactregistry.v1.Repository>( + this, METHODID_GET_REPOSITORY))) + .build(); + } + } + + /** + * + * + *
+   * The Artifact Registry API service.
+   * Artifact Registry is an artifact management system for storing artifacts
+   * from different package management systems.
+   * The resources managed by this API are:
+   * * Repositories, which group packages and their data.
+   * * Packages, which group versions and their tags.
+   * * Versions, which are specific forms of a package.
+   * * Tags, which represent alternative names for versions.
+   * * Files, which contain content and are optionally associated with a Package
+   *   or Version.
+   * 
+ */ + public static final class ArtifactRegistryStub + extends io.grpc.stub.AbstractAsyncStub { + private ArtifactRegistryStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ArtifactRegistryStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ArtifactRegistryStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists docker images.
+     * 
+ */ + public void listDockerImages( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest request, + io.grpc.stub.StreamObserver< + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDockerImagesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists repositories.
+     * 
+ */ + public void listRepositories( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest request, + io.grpc.stub.StreamObserver< + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRepositoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a repository.
+     * 
+ */ + public void getRepository( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRepositoryMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * The Artifact Registry API service.
+   * Artifact Registry is an artifact management system for storing artifacts
+   * from different package management systems.
+   * The resources managed by this API are:
+   * * Repositories, which group packages and their data.
+   * * Packages, which group versions and their tags.
+   * * Versions, which are specific forms of a package.
+   * * Tags, which represent alternative names for versions.
+   * * Files, which contain content and are optionally associated with a Package
+   *   or Version.
+   * 
+ */ + public static final class ArtifactRegistryBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ArtifactRegistryBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ArtifactRegistryBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ArtifactRegistryBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists docker images.
+     * 
+ */ + public com.google.devtools.artifactregistry.v1.ListDockerImagesResponse listDockerImages( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDockerImagesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists repositories.
+     * 
+ */ + public com.google.devtools.artifactregistry.v1.ListRepositoriesResponse listRepositories( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRepositoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a repository.
+     * 
+ */ + public com.google.devtools.artifactregistry.v1.Repository getRepository( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRepositoryMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * The Artifact Registry API service.
+   * Artifact Registry is an artifact management system for storing artifacts
+   * from different package management systems.
+   * The resources managed by this API are:
+   * * Repositories, which group packages and their data.
+   * * Packages, which group versions and their tags.
+   * * Versions, which are specific forms of a package.
+   * * Tags, which represent alternative names for versions.
+   * * Files, which contain content and are optionally associated with a Package
+   *   or Version.
+   * 
+ */ + public static final class ArtifactRegistryFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ArtifactRegistryFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ArtifactRegistryFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ArtifactRegistryFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists docker images.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse> + listDockerImages(com.google.devtools.artifactregistry.v1.ListDockerImagesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDockerImagesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists repositories.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse> + listRepositories(com.google.devtools.artifactregistry.v1.ListRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRepositoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a repository.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.devtools.artifactregistry.v1.Repository> + getRepository(com.google.devtools.artifactregistry.v1.GetRepositoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRepositoryMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_DOCKER_IMAGES = 0; + private static final int METHODID_LIST_REPOSITORIES = 1; + private static final int METHODID_GET_REPOSITORY = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ArtifactRegistryImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ArtifactRegistryImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_DOCKER_IMAGES: + serviceImpl.listDockerImages( + (com.google.devtools.artifactregistry.v1.ListDockerImagesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse>) + responseObserver); + break; + case METHODID_LIST_REPOSITORIES: + serviceImpl.listRepositories( + (com.google.devtools.artifactregistry.v1.ListRepositoriesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse>) + responseObserver); + break; + case METHODID_GET_REPOSITORY: + serviceImpl.getRepository( + (com.google.devtools.artifactregistry.v1.GetRepositoryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ArtifactRegistryBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ArtifactRegistryBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.devtools.artifactregistry.v1.ServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ArtifactRegistry"); + } + } + + private static final class ArtifactRegistryFileDescriptorSupplier + extends ArtifactRegistryBaseDescriptorSupplier { + ArtifactRegistryFileDescriptorSupplier() {} + } + + private static final class ArtifactRegistryMethodDescriptorSupplier + extends ArtifactRegistryBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ArtifactRegistryMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ArtifactRegistryGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ArtifactRegistryFileDescriptorSupplier()) + .addMethod(getListDockerImagesMethod()) + .addMethod(getListRepositoriesMethod()) + .addMethod(getGetRepositoryMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index b560217a..7fafdc82 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,16 @@ google-cloud-artifact-registry 0.4.4-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-artifact-registry-v1 + 0.4.4-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-artifact-registry-v1 + 0.4.4-SNAPSHOT + com.google.api.grpc proto-google-cloud-artifact-registry-v1beta2 @@ -104,7 +114,9 @@ google-cloud-artifact-registry grpc-google-cloud-artifact-registry-v1beta2 + grpc-google-cloud-artifact-registry-v1 proto-google-cloud-artifact-registry-v1beta2 + proto-google-cloud-artifact-registry-v1 google-cloud-artifact-registry-bom diff --git a/proto-google-cloud-artifact-registry-v1/clirr-ignored-differences.xml b/proto-google-cloud-artifact-registry-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..9e295134 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/devtools/artifactregistry/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/devtools/artifactregistry/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/devtools/artifactregistry/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-artifact-registry-v1/pom.xml b/proto-google-cloud-artifact-registry-v1/pom.xml new file mode 100644 index 00000000..cf6e1cd7 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-artifact-registry-v1 + 0.4.4-SNAPSHOT + proto-google-cloud-artifact-registry-v1 + Proto library for google-cloud-artifact-registry + + com.google.cloud + google-cloud-artifact-registry-parent + 0.4.4-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactProto.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactProto.java new file mode 100644 index 00000000..98bf89ed --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactProto.java @@ -0,0 +1,125 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +public final class ArtifactProto { + private ArtifactProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_DockerImage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_DockerImage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/devtools/artifactregistry/v1/ar" + + "tifact.proto\022#google.devtools.artifactre" + + "gistry.v1\032\037google/api/field_behavior.pro" + + "to\032\031google/api/resource.proto\032\037google/pr" + + "otobuf/timestamp.proto\032\034google/api/annot" + + "ations.proto\"\342\002\n\013DockerImage\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\002\022\020\n\003uri\030\002 \001(\tB\003\340A\002\022\014\n\004tags\030\003 \003(\t\022" + + "\030\n\020image_size_bytes\030\004 \001(\003\022/\n\013upload_time" + + "\030\005 \001(\0132\032.google.protobuf.Timestamp\022\022\n\nme" + + "dia_type\030\006 \001(\t\022.\n\nbuild_time\030\007 \001(\0132\032.goo" + + "gle.protobuf.Timestamp:\220\001\352A\214\001\n+artifactr" + + "egistry.googleapis.com/DockerImage\022]proj" + + "ects/{project}/locations/{location}/repo" + + "sitories/{repository}/dockerImages/{dock" + + "er_image}\"U\n\027ListDockerImagesRequest\022\023\n\006" + + "parent\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"|\n\030ListDockerImagesResp" + + "onse\022G\n\rdocker_images\030\001 \003(\01320.google.dev" + + "tools.artifactregistry.v1.DockerImage\022\027\n" + + "\017next_page_token\030\002 \001(\tB\373\001\n\'com.google.de" + + "vtools.artifactregistry.v1B\rArtifactProt" + + "oP\001ZSgoogle.golang.org/genproto/googleap" + + "is/devtools/artifactregistry/v1;artifact" + + "registry\252\002 Google.Cloud.ArtifactRegistry" + + ".V1\312\002 Google\\Cloud\\ArtifactRegistry\\V1\352\002" + + "#Google::Cloud::ArtifactRegistry::V1b\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_devtools_artifactregistry_v1_DockerImage_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_devtools_artifactregistry_v1_DockerImage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_DockerImage_descriptor, + new java.lang.String[] { + "Name", "Uri", "Tags", "ImageSizeBytes", "UploadTime", "MediaType", "BuildTime", + }); + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_descriptor, + new java.lang.String[] { + "DockerImages", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImage.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImage.java new file mode 100644 index 00000000..096fc83e --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImage.java @@ -0,0 +1,2068 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * DockerImage represents a docker artifact.
+ * The following fields are returned as untyped metadata in the Version
+ * resource, using camelcase keys (i.e. metadata.imageSizeBytes):
+ *   - imageSizeBytes
+ *   - mediaType
+ *   - buildTime
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.DockerImage} + */ +public final class DockerImage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.DockerImage) + DockerImageOrBuilder { + private static final long serialVersionUID = 0L; + // Use DockerImage.newBuilder() to construct. + private DockerImage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DockerImage() { + name_ = ""; + uri_ = ""; + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + mediaType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DockerImage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DockerImage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tags_.add(s); + break; + } + case 32: + { + imageSizeBytes_ = input.readInt64(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (uploadTime_ != null) { + subBuilder = uploadTime_.toBuilder(); + } + uploadTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(uploadTime_); + uploadTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + mediaType_ = s; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (buildTime_ != null) { + subBuilder = buildTime_.toBuilder(); + } + buildTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildTime_); + buildTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tags_ = tags_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_DockerImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_DockerImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.DockerImage.class, + com.google.devtools.artifactregistry.v1.DockerImage.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. registry_location, project_id, repository_name and image id forms a unique
+   * image
+   * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+   * For example,
+   * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+   * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+   * where "us-west4" is the registry_location, "test-project" is the
+   * project_id, "test-repo" is the repository_name and
+   * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+   * is the image's digest.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. registry_location, project_id, repository_name and image id forms a unique
+   * image
+   * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+   * For example,
+   * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+   * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+   * where "us-west4" is the registry_location, "test-project" is the
+   * project_id, "test-repo" is the repository_name and
+   * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+   * is the image's digest.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 2; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Required. URL to access the image.
+   * Example:
+   * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+   * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. URL to access the image.
+   * Example:
+   * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+   * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAGS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList tags_; + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_; + } + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int IMAGE_SIZE_BYTES_FIELD_NUMBER = 4; + private long imageSizeBytes_; + /** + * + * + *
+   * Calculated size of the image.
+   * This field is returned as the 'metadata.imageSizeBytes' field in the
+   * Version resource.
+   * 
+ * + * int64 image_size_bytes = 4; + * + * @return The imageSizeBytes. + */ + @java.lang.Override + public long getImageSizeBytes() { + return imageSizeBytes_; + } + + public static final int UPLOAD_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp uploadTime_; + /** + * + * + *
+   * Time the image was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + * + * @return Whether the uploadTime field is set. + */ + @java.lang.Override + public boolean hasUploadTime() { + return uploadTime_ != null; + } + /** + * + * + *
+   * Time the image was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + * + * @return The uploadTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUploadTime() { + return uploadTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : uploadTime_; + } + /** + * + * + *
+   * Time the image was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUploadTimeOrBuilder() { + return getUploadTime(); + } + + public static final int MEDIA_TYPE_FIELD_NUMBER = 6; + private volatile java.lang.Object mediaType_; + /** + * + * + *
+   * Media type of this image, e.g.
+   * "application/vnd.docker.distribution.manifest.v2+json".
+   * This field is returned as the 'metadata.mediaType' field in the
+   * Version resource.
+   * 
+ * + * string media_type = 6; + * + * @return The mediaType. + */ + @java.lang.Override + public java.lang.String getMediaType() { + java.lang.Object ref = mediaType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mediaType_ = s; + return s; + } + } + /** + * + * + *
+   * Media type of this image, e.g.
+   * "application/vnd.docker.distribution.manifest.v2+json".
+   * This field is returned as the 'metadata.mediaType' field in the
+   * Version resource.
+   * 
+ * + * string media_type = 6; + * + * @return The bytes for mediaType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMediaTypeBytes() { + java.lang.Object ref = mediaType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mediaType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp buildTime_; + /** + * + * + *
+   * The time this image was built.
+   * This field is returned as the 'metadata.buildTime' field in the
+   * Version resource.
+   * The build time is returned to the client as an RFC 3339 string, which can
+   * be easily used with the JavaScript Date constructor.
+   * 
+ * + * .google.protobuf.Timestamp build_time = 7; + * + * @return Whether the buildTime field is set. + */ + @java.lang.Override + public boolean hasBuildTime() { + return buildTime_ != null; + } + /** + * + * + *
+   * The time this image was built.
+   * This field is returned as the 'metadata.buildTime' field in the
+   * Version resource.
+   * The build time is returned to the client as an RFC 3339 string, which can
+   * be easily used with the JavaScript Date constructor.
+   * 
+ * + * .google.protobuf.Timestamp build_time = 7; + * + * @return The buildTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBuildTime() { + return buildTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : buildTime_; + } + /** + * + * + *
+   * The time this image was built.
+   * This field is returned as the 'metadata.buildTime' field in the
+   * Version resource.
+   * The build time is returned to the client as an RFC 3339 string, which can
+   * be easily used with the JavaScript Date constructor.
+   * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBuildTimeOrBuilder() { + return getBuildTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tags_.getRaw(i)); + } + if (imageSizeBytes_ != 0L) { + output.writeInt64(4, imageSizeBytes_); + } + if (uploadTime_ != null) { + output.writeMessage(5, getUploadTime()); + } + if (!getMediaTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, mediaType_); + } + if (buildTime_ != null) { + output.writeMessage(7, getBuildTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + if (imageSizeBytes_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, imageSizeBytes_); + } + if (uploadTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUploadTime()); + } + if (!getMediaTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, mediaType_); + } + if (buildTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getBuildTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.DockerImage)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.DockerImage other = + (com.google.devtools.artifactregistry.v1.DockerImage) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getTagsList().equals(other.getTagsList())) return false; + if (getImageSizeBytes() != other.getImageSizeBytes()) return false; + if (hasUploadTime() != other.hasUploadTime()) return false; + if (hasUploadTime()) { + if (!getUploadTime().equals(other.getUploadTime())) return false; + } + if (!getMediaType().equals(other.getMediaType())) return false; + if (hasBuildTime() != other.hasBuildTime()) return false; + if (hasBuildTime()) { + if (!getBuildTime().equals(other.getBuildTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + hash = (37 * hash) + IMAGE_SIZE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getImageSizeBytes()); + if (hasUploadTime()) { + hash = (37 * hash) + UPLOAD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUploadTime().hashCode(); + } + hash = (37 * hash) + MEDIA_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMediaType().hashCode(); + if (hasBuildTime()) { + hash = (37 * hash) + BUILD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getBuildTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.devtools.artifactregistry.v1.DockerImage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * DockerImage represents a docker artifact.
+   * The following fields are returned as untyped metadata in the Version
+   * resource, using camelcase keys (i.e. metadata.imageSizeBytes):
+   *   - imageSizeBytes
+   *   - mediaType
+   *   - buildTime
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.DockerImage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.DockerImage) + com.google.devtools.artifactregistry.v1.DockerImageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_DockerImage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_DockerImage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.DockerImage.class, + com.google.devtools.artifactregistry.v1.DockerImage.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.DockerImage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + uri_ = ""; + + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + imageSizeBytes_ = 0L; + + if (uploadTimeBuilder_ == null) { + uploadTime_ = null; + } else { + uploadTime_ = null; + uploadTimeBuilder_ = null; + } + mediaType_ = ""; + + if (buildTimeBuilder_ == null) { + buildTime_ = null; + } else { + buildTime_ = null; + buildTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_DockerImage_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.DockerImage getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.DockerImage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.DockerImage build() { + com.google.devtools.artifactregistry.v1.DockerImage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.DockerImage buildPartial() { + com.google.devtools.artifactregistry.v1.DockerImage result = + new com.google.devtools.artifactregistry.v1.DockerImage(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.uri_ = uri_; + if (((bitField0_ & 0x00000001) != 0)) { + tags_ = tags_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tags_ = tags_; + result.imageSizeBytes_ = imageSizeBytes_; + if (uploadTimeBuilder_ == null) { + result.uploadTime_ = uploadTime_; + } else { + result.uploadTime_ = uploadTimeBuilder_.build(); + } + result.mediaType_ = mediaType_; + if (buildTimeBuilder_ == null) { + result.buildTime_ = buildTime_; + } else { + result.buildTime_ = buildTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.DockerImage) { + return mergeFrom((com.google.devtools.artifactregistry.v1.DockerImage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.devtools.artifactregistry.v1.DockerImage other) { + if (other == com.google.devtools.artifactregistry.v1.DockerImage.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (other.getImageSizeBytes() != 0L) { + setImageSizeBytes(other.getImageSizeBytes()); + } + if (other.hasUploadTime()) { + mergeUploadTime(other.getUploadTime()); + } + if (!other.getMediaType().isEmpty()) { + mediaType_ = other.mediaType_; + onChanged(); + } + if (other.hasBuildTime()) { + mergeBuildTime(other.getBuildTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.DockerImage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.DockerImage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. registry_location, project_id, repository_name and image id forms a unique
+     * image
+     * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+     * For example,
+     * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+     * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+     * where "us-west4" is the registry_location, "test-project" is the
+     * project_id, "test-repo" is the repository_name and
+     * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+     * is the image's digest.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. registry_location, project_id, repository_name and image id forms a unique
+     * image
+     * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+     * For example,
+     * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+     * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+     * where "us-west4" is the registry_location, "test-project" is the
+     * project_id, "test-repo" is the repository_name and
+     * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+     * is the image's digest.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. registry_location, project_id, repository_name and image id forms a unique
+     * image
+     * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+     * For example,
+     * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+     * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+     * where "us-west4" is the registry_location, "test-project" is the
+     * project_id, "test-repo" is the repository_name and
+     * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+     * is the image's digest.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. registry_location, project_id, repository_name and image id forms a unique
+     * image
+     * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+     * For example,
+     * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+     * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+     * where "us-west4" is the registry_location, "test-project" is the
+     * project_id, "test-repo" is the repository_name and
+     * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+     * is the image's digest.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. registry_location, project_id, repository_name and image id forms a unique
+     * image
+     * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+     * For example,
+     * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+     * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+     * where "us-west4" is the registry_location, "test-project" is the
+     * project_id, "test-repo" is the repository_name and
+     * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+     * is the image's digest.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Required. URL to access the image.
+     * Example:
+     * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+     * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. URL to access the image.
+     * Example:
+     * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+     * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. URL to access the image.
+     * Example:
+     * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+     * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL to access the image.
+     * Example:
+     * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+     * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. URL to access the image.
+     * Example:
+     * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+     * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList tags_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTagsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList getTagsList() { + return tags_.getUnmodifiableView(); + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags(java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Tags attached to this image.
+     * 
+ * + * repeated string tags = 3; + * + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + onChanged(); + return this; + } + + private long imageSizeBytes_; + /** + * + * + *
+     * Calculated size of the image.
+     * This field is returned as the 'metadata.imageSizeBytes' field in the
+     * Version resource.
+     * 
+ * + * int64 image_size_bytes = 4; + * + * @return The imageSizeBytes. + */ + @java.lang.Override + public long getImageSizeBytes() { + return imageSizeBytes_; + } + /** + * + * + *
+     * Calculated size of the image.
+     * This field is returned as the 'metadata.imageSizeBytes' field in the
+     * Version resource.
+     * 
+ * + * int64 image_size_bytes = 4; + * + * @param value The imageSizeBytes to set. + * @return This builder for chaining. + */ + public Builder setImageSizeBytes(long value) { + + imageSizeBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Calculated size of the image.
+     * This field is returned as the 'metadata.imageSizeBytes' field in the
+     * Version resource.
+     * 
+ * + * int64 image_size_bytes = 4; + * + * @return This builder for chaining. + */ + public Builder clearImageSizeBytes() { + + imageSizeBytes_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp uploadTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + uploadTimeBuilder_; + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + * + * @return Whether the uploadTime field is set. + */ + public boolean hasUploadTime() { + return uploadTimeBuilder_ != null || uploadTime_ != null; + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + * + * @return The uploadTime. + */ + public com.google.protobuf.Timestamp getUploadTime() { + if (uploadTimeBuilder_ == null) { + return uploadTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : uploadTime_; + } else { + return uploadTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + public Builder setUploadTime(com.google.protobuf.Timestamp value) { + if (uploadTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uploadTime_ = value; + onChanged(); + } else { + uploadTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + public Builder setUploadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (uploadTimeBuilder_ == null) { + uploadTime_ = builderForValue.build(); + onChanged(); + } else { + uploadTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + public Builder mergeUploadTime(com.google.protobuf.Timestamp value) { + if (uploadTimeBuilder_ == null) { + if (uploadTime_ != null) { + uploadTime_ = + com.google.protobuf.Timestamp.newBuilder(uploadTime_).mergeFrom(value).buildPartial(); + } else { + uploadTime_ = value; + } + onChanged(); + } else { + uploadTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + public Builder clearUploadTime() { + if (uploadTimeBuilder_ == null) { + uploadTime_ = null; + onChanged(); + } else { + uploadTime_ = null; + uploadTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getUploadTimeBuilder() { + + onChanged(); + return getUploadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUploadTimeOrBuilder() { + if (uploadTimeBuilder_ != null) { + return uploadTimeBuilder_.getMessageOrBuilder(); + } else { + return uploadTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : uploadTime_; + } + } + /** + * + * + *
+     * Time the image was uploaded.
+     * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUploadTimeFieldBuilder() { + if (uploadTimeBuilder_ == null) { + uploadTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUploadTime(), getParentForChildren(), isClean()); + uploadTime_ = null; + } + return uploadTimeBuilder_; + } + + private java.lang.Object mediaType_ = ""; + /** + * + * + *
+     * Media type of this image, e.g.
+     * "application/vnd.docker.distribution.manifest.v2+json".
+     * This field is returned as the 'metadata.mediaType' field in the
+     * Version resource.
+     * 
+ * + * string media_type = 6; + * + * @return The mediaType. + */ + public java.lang.String getMediaType() { + java.lang.Object ref = mediaType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mediaType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Media type of this image, e.g.
+     * "application/vnd.docker.distribution.manifest.v2+json".
+     * This field is returned as the 'metadata.mediaType' field in the
+     * Version resource.
+     * 
+ * + * string media_type = 6; + * + * @return The bytes for mediaType. + */ + public com.google.protobuf.ByteString getMediaTypeBytes() { + java.lang.Object ref = mediaType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mediaType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Media type of this image, e.g.
+     * "application/vnd.docker.distribution.manifest.v2+json".
+     * This field is returned as the 'metadata.mediaType' field in the
+     * Version resource.
+     * 
+ * + * string media_type = 6; + * + * @param value The mediaType to set. + * @return This builder for chaining. + */ + public Builder setMediaType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mediaType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Media type of this image, e.g.
+     * "application/vnd.docker.distribution.manifest.v2+json".
+     * This field is returned as the 'metadata.mediaType' field in the
+     * Version resource.
+     * 
+ * + * string media_type = 6; + * + * @return This builder for chaining. + */ + public Builder clearMediaType() { + + mediaType_ = getDefaultInstance().getMediaType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Media type of this image, e.g.
+     * "application/vnd.docker.distribution.manifest.v2+json".
+     * This field is returned as the 'metadata.mediaType' field in the
+     * Version resource.
+     * 
+ * + * string media_type = 6; + * + * @param value The bytes for mediaType to set. + * @return This builder for chaining. + */ + public Builder setMediaTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mediaType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp buildTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + buildTimeBuilder_; + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + * + * @return Whether the buildTime field is set. + */ + public boolean hasBuildTime() { + return buildTimeBuilder_ != null || buildTime_ != null; + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + * + * @return The buildTime. + */ + public com.google.protobuf.Timestamp getBuildTime() { + if (buildTimeBuilder_ == null) { + return buildTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : buildTime_; + } else { + return buildTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + public Builder setBuildTime(com.google.protobuf.Timestamp value) { + if (buildTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildTime_ = value; + onChanged(); + } else { + buildTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + public Builder setBuildTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (buildTimeBuilder_ == null) { + buildTime_ = builderForValue.build(); + onChanged(); + } else { + buildTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + public Builder mergeBuildTime(com.google.protobuf.Timestamp value) { + if (buildTimeBuilder_ == null) { + if (buildTime_ != null) { + buildTime_ = + com.google.protobuf.Timestamp.newBuilder(buildTime_).mergeFrom(value).buildPartial(); + } else { + buildTime_ = value; + } + onChanged(); + } else { + buildTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + public Builder clearBuildTime() { + if (buildTimeBuilder_ == null) { + buildTime_ = null; + onChanged(); + } else { + buildTime_ = null; + buildTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getBuildTimeBuilder() { + + onChanged(); + return getBuildTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getBuildTimeOrBuilder() { + if (buildTimeBuilder_ != null) { + return buildTimeBuilder_.getMessageOrBuilder(); + } else { + return buildTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : buildTime_; + } + } + /** + * + * + *
+     * The time this image was built.
+     * This field is returned as the 'metadata.buildTime' field in the
+     * Version resource.
+     * The build time is returned to the client as an RFC 3339 string, which can
+     * be easily used with the JavaScript Date constructor.
+     * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBuildTimeFieldBuilder() { + if (buildTimeBuilder_ == null) { + buildTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBuildTime(), getParentForChildren(), isClean()); + buildTime_ = null; + } + return buildTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.DockerImage) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.DockerImage) + private static final com.google.devtools.artifactregistry.v1.DockerImage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.DockerImage(); + } + + public static com.google.devtools.artifactregistry.v1.DockerImage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DockerImage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DockerImage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.DockerImage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImageOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImageOrBuilder.java new file mode 100644 index 00000000..23262b8c --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/DockerImageOrBuilder.java @@ -0,0 +1,276 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +public interface DockerImageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.DockerImage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. registry_location, project_id, repository_name and image id forms a unique
+   * image
+   * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+   * For example,
+   * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+   * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+   * where "us-west4" is the registry_location, "test-project" is the
+   * project_id, "test-repo" is the repository_name and
+   * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+   * is the image's digest.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. registry_location, project_id, repository_name and image id forms a unique
+   * image
+   * name:`projects/<project_id>/locations/<location>/repository/<repository_name>/dockerImages/<docker_image>`.
+   * For example,
+   * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/
+   * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf",
+   * where "us-west4" is the registry_location, "test-project" is the
+   * project_id, "test-repo" is the repository_name and
+   * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf"
+   * is the image's digest.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. URL to access the image.
+   * Example:
+   * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+   * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Required. URL to access the image.
+   * Example:
+   * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf
+   * 
+ * + * string uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @return A list containing the tags. + */ + java.util.List getTagsList(); + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @return The count of tags. + */ + int getTagsCount(); + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + * + * + *
+   * Tags attached to this image.
+   * 
+ * + * repeated string tags = 3; + * + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString getTagsBytes(int index); + + /** + * + * + *
+   * Calculated size of the image.
+   * This field is returned as the 'metadata.imageSizeBytes' field in the
+   * Version resource.
+   * 
+ * + * int64 image_size_bytes = 4; + * + * @return The imageSizeBytes. + */ + long getImageSizeBytes(); + + /** + * + * + *
+   * Time the image was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + * + * @return Whether the uploadTime field is set. + */ + boolean hasUploadTime(); + /** + * + * + *
+   * Time the image was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + * + * @return The uploadTime. + */ + com.google.protobuf.Timestamp getUploadTime(); + /** + * + * + *
+   * Time the image was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getUploadTimeOrBuilder(); + + /** + * + * + *
+   * Media type of this image, e.g.
+   * "application/vnd.docker.distribution.manifest.v2+json".
+   * This field is returned as the 'metadata.mediaType' field in the
+   * Version resource.
+   * 
+ * + * string media_type = 6; + * + * @return The mediaType. + */ + java.lang.String getMediaType(); + /** + * + * + *
+   * Media type of this image, e.g.
+   * "application/vnd.docker.distribution.manifest.v2+json".
+   * This field is returned as the 'metadata.mediaType' field in the
+   * Version resource.
+   * 
+ * + * string media_type = 6; + * + * @return The bytes for mediaType. + */ + com.google.protobuf.ByteString getMediaTypeBytes(); + + /** + * + * + *
+   * The time this image was built.
+   * This field is returned as the 'metadata.buildTime' field in the
+   * Version resource.
+   * The build time is returned to the client as an RFC 3339 string, which can
+   * be easily used with the JavaScript Date constructor.
+   * 
+ * + * .google.protobuf.Timestamp build_time = 7; + * + * @return Whether the buildTime field is set. + */ + boolean hasBuildTime(); + /** + * + * + *
+   * The time this image was built.
+   * This field is returned as the 'metadata.buildTime' field in the
+   * Version resource.
+   * The build time is returned to the client as an RFC 3339 string, which can
+   * be easily used with the JavaScript Date constructor.
+   * 
+ * + * .google.protobuf.Timestamp build_time = 7; + * + * @return The buildTime. + */ + com.google.protobuf.Timestamp getBuildTime(); + /** + * + * + *
+   * The time this image was built.
+   * This field is returned as the 'metadata.buildTime' field in the
+   * Version resource.
+   * The build time is returned to the client as an RFC 3339 string, which can
+   * be easily used with the JavaScript Date constructor.
+   * 
+ * + * .google.protobuf.Timestamp build_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getBuildTimeOrBuilder(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequest.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequest.java new file mode 100644 index 00000000..61cab971 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * The request to retrieve a repository.
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.GetRepositoryRequest} + */ +public final class GetRepositoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.GetRepositoryRequest) + GetRepositoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetRepositoryRequest.newBuilder() to construct. + private GetRepositoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRepositoryRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetRepositoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetRepositoryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest.class, + com.google.devtools.artifactregistry.v1.GetRepositoryRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the repository to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the repository to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.GetRepositoryRequest)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.GetRepositoryRequest other = + (com.google.devtools.artifactregistry.v1.GetRepositoryRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request to retrieve a repository.
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.GetRepositoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.GetRepositoryRequest) + com.google.devtools.artifactregistry.v1.GetRepositoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.GetRepositoryRequest.class, + com.google.devtools.artifactregistry.v1.GetRepositoryRequest.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.GetRepositoryRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.GetRepositoryRequest + getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.GetRepositoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.GetRepositoryRequest build() { + com.google.devtools.artifactregistry.v1.GetRepositoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.GetRepositoryRequest buildPartial() { + com.google.devtools.artifactregistry.v1.GetRepositoryRequest result = + new com.google.devtools.artifactregistry.v1.GetRepositoryRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.GetRepositoryRequest) { + return mergeFrom((com.google.devtools.artifactregistry.v1.GetRepositoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.devtools.artifactregistry.v1.GetRepositoryRequest other) { + if (other + == com.google.devtools.artifactregistry.v1.GetRepositoryRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.GetRepositoryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.GetRepositoryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the repository to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the repository to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the repository to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the repository to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the repository to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.GetRepositoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.GetRepositoryRequest) + private static final com.google.devtools.artifactregistry.v1.GetRepositoryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.GetRepositoryRequest(); + } + + public static com.google.devtools.artifactregistry.v1.GetRepositoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRepositoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetRepositoryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.GetRepositoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequestOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequestOrBuilder.java new file mode 100644 index 00000000..5a1488a1 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/GetRepositoryRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +public interface GetRepositoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.GetRepositoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the repository to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the repository to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequest.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequest.java new file mode 100644 index 00000000..c2b7e263 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequest.java @@ -0,0 +1,913 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * The request to list docker images.
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListDockerImagesRequest} + */ +public final class ListDockerImagesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.ListDockerImagesRequest) + ListDockerImagesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDockerImagesRequest.newBuilder() to construct. + private ListDockerImagesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDockerImagesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDockerImagesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDockerImagesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.class, + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the parent resource whose docker images will be listed.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the parent resource whose docker images will be listed.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of artifacts to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.ListDockerImagesRequest)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest other = + (com.google.devtools.artifactregistry.v1.ListDockerImagesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request to list docker images.
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListDockerImagesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.ListDockerImagesRequest) + com.google.devtools.artifactregistry.v1.ListDockerImagesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.class, + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesRequest_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesRequest + getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesRequest build() { + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesRequest buildPartial() { + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest result = + new com.google.devtools.artifactregistry.v1.ListDockerImagesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.ListDockerImagesRequest) { + return mergeFrom((com.google.devtools.artifactregistry.v1.ListDockerImagesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest other) { + if (other + == com.google.devtools.artifactregistry.v1.ListDockerImagesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.ListDockerImagesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.ListDockerImagesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource whose docker images will be listed.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource whose docker images will be listed.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource whose docker images will be listed.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource whose docker images will be listed.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource whose docker images will be listed.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of artifacts to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of artifacts to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of artifacts to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.ListDockerImagesRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.ListDockerImagesRequest) + private static final com.google.devtools.artifactregistry.v1.ListDockerImagesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.ListDockerImagesRequest(); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDockerImagesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDockerImagesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequestOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequestOrBuilder.java new file mode 100644 index 00000000..30b4accd --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +public interface ListDockerImagesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.ListDockerImagesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource whose docker images will be listed.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource whose docker images will be listed.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of artifacts to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponse.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponse.java new file mode 100644 index 00000000..5c90afc6 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponse.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * The response from listing docker images.
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListDockerImagesResponse} + */ +public final class ListDockerImagesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.ListDockerImagesResponse) + ListDockerImagesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListDockerImagesResponse.newBuilder() to construct. + private ListDockerImagesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDockerImagesResponse() { + dockerImages_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDockerImagesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListDockerImagesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + dockerImages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + dockerImages_.add( + input.readMessage( + com.google.devtools.artifactregistry.v1.DockerImage.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + dockerImages_ = java.util.Collections.unmodifiableList(dockerImages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.class, + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.Builder.class); + } + + public static final int DOCKER_IMAGES_FIELD_NUMBER = 1; + private java.util.List dockerImages_; + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + @java.lang.Override + public java.util.List getDockerImagesList() { + return dockerImages_; + } + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + @java.lang.Override + public java.util.List + getDockerImagesOrBuilderList() { + return dockerImages_; + } + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + @java.lang.Override + public int getDockerImagesCount() { + return dockerImages_.size(); + } + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + @java.lang.Override + public com.google.devtools.artifactregistry.v1.DockerImage getDockerImages(int index) { + return dockerImages_.get(index); + } + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + @java.lang.Override + public com.google.devtools.artifactregistry.v1.DockerImageOrBuilder getDockerImagesOrBuilder( + int index) { + return dockerImages_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The token to retrieve the next page of artifacts, or empty if there are no
+   * more artifacts to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The token to retrieve the next page of artifacts, or empty if there are no
+   * more artifacts to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < dockerImages_.size(); i++) { + output.writeMessage(1, dockerImages_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < dockerImages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dockerImages_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.ListDockerImagesResponse)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse other = + (com.google.devtools.artifactregistry.v1.ListDockerImagesResponse) obj; + + if (!getDockerImagesList().equals(other.getDockerImagesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDockerImagesCount() > 0) { + hash = (37 * hash) + DOCKER_IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getDockerImagesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response from listing docker images.
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListDockerImagesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.ListDockerImagesResponse) + com.google.devtools.artifactregistry.v1.ListDockerImagesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.class, + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDockerImagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (dockerImagesBuilder_ == null) { + dockerImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + dockerImagesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.ArtifactProto + .internal_static_google_devtools_artifactregistry_v1_ListDockerImagesResponse_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesResponse + getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesResponse build() { + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesResponse buildPartial() { + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse result = + new com.google.devtools.artifactregistry.v1.ListDockerImagesResponse(this); + int from_bitField0_ = bitField0_; + if (dockerImagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dockerImages_ = java.util.Collections.unmodifiableList(dockerImages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dockerImages_ = dockerImages_; + } else { + result.dockerImages_ = dockerImagesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.ListDockerImagesResponse) { + return mergeFrom((com.google.devtools.artifactregistry.v1.ListDockerImagesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse other) { + if (other + == com.google.devtools.artifactregistry.v1.ListDockerImagesResponse.getDefaultInstance()) + return this; + if (dockerImagesBuilder_ == null) { + if (!other.dockerImages_.isEmpty()) { + if (dockerImages_.isEmpty()) { + dockerImages_ = other.dockerImages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDockerImagesIsMutable(); + dockerImages_.addAll(other.dockerImages_); + } + onChanged(); + } + } else { + if (!other.dockerImages_.isEmpty()) { + if (dockerImagesBuilder_.isEmpty()) { + dockerImagesBuilder_.dispose(); + dockerImagesBuilder_ = null; + dockerImages_ = other.dockerImages_; + bitField0_ = (bitField0_ & ~0x00000001); + dockerImagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDockerImagesFieldBuilder() + : null; + } else { + dockerImagesBuilder_.addAllMessages(other.dockerImages_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.ListDockerImagesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.ListDockerImagesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List dockerImages_ = + java.util.Collections.emptyList(); + + private void ensureDockerImagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dockerImages_ = + new java.util.ArrayList( + dockerImages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.devtools.artifactregistry.v1.DockerImage, + com.google.devtools.artifactregistry.v1.DockerImage.Builder, + com.google.devtools.artifactregistry.v1.DockerImageOrBuilder> + dockerImagesBuilder_; + + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public java.util.List + getDockerImagesList() { + if (dockerImagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dockerImages_); + } else { + return dockerImagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public int getDockerImagesCount() { + if (dockerImagesBuilder_ == null) { + return dockerImages_.size(); + } else { + return dockerImagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public com.google.devtools.artifactregistry.v1.DockerImage getDockerImages(int index) { + if (dockerImagesBuilder_ == null) { + return dockerImages_.get(index); + } else { + return dockerImagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder setDockerImages( + int index, com.google.devtools.artifactregistry.v1.DockerImage value) { + if (dockerImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDockerImagesIsMutable(); + dockerImages_.set(index, value); + onChanged(); + } else { + dockerImagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder setDockerImages( + int index, com.google.devtools.artifactregistry.v1.DockerImage.Builder builderForValue) { + if (dockerImagesBuilder_ == null) { + ensureDockerImagesIsMutable(); + dockerImages_.set(index, builderForValue.build()); + onChanged(); + } else { + dockerImagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder addDockerImages(com.google.devtools.artifactregistry.v1.DockerImage value) { + if (dockerImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDockerImagesIsMutable(); + dockerImages_.add(value); + onChanged(); + } else { + dockerImagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder addDockerImages( + int index, com.google.devtools.artifactregistry.v1.DockerImage value) { + if (dockerImagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDockerImagesIsMutable(); + dockerImages_.add(index, value); + onChanged(); + } else { + dockerImagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder addDockerImages( + com.google.devtools.artifactregistry.v1.DockerImage.Builder builderForValue) { + if (dockerImagesBuilder_ == null) { + ensureDockerImagesIsMutable(); + dockerImages_.add(builderForValue.build()); + onChanged(); + } else { + dockerImagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder addDockerImages( + int index, com.google.devtools.artifactregistry.v1.DockerImage.Builder builderForValue) { + if (dockerImagesBuilder_ == null) { + ensureDockerImagesIsMutable(); + dockerImages_.add(index, builderForValue.build()); + onChanged(); + } else { + dockerImagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder addAllDockerImages( + java.lang.Iterable values) { + if (dockerImagesBuilder_ == null) { + ensureDockerImagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dockerImages_); + onChanged(); + } else { + dockerImagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder clearDockerImages() { + if (dockerImagesBuilder_ == null) { + dockerImages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dockerImagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public Builder removeDockerImages(int index) { + if (dockerImagesBuilder_ == null) { + ensureDockerImagesIsMutable(); + dockerImages_.remove(index); + onChanged(); + } else { + dockerImagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public com.google.devtools.artifactregistry.v1.DockerImage.Builder getDockerImagesBuilder( + int index) { + return getDockerImagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public com.google.devtools.artifactregistry.v1.DockerImageOrBuilder getDockerImagesOrBuilder( + int index) { + if (dockerImagesBuilder_ == null) { + return dockerImages_.get(index); + } else { + return dockerImagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public java.util.List + getDockerImagesOrBuilderList() { + if (dockerImagesBuilder_ != null) { + return dockerImagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dockerImages_); + } + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public com.google.devtools.artifactregistry.v1.DockerImage.Builder addDockerImagesBuilder() { + return getDockerImagesFieldBuilder() + .addBuilder(com.google.devtools.artifactregistry.v1.DockerImage.getDefaultInstance()); + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public com.google.devtools.artifactregistry.v1.DockerImage.Builder addDockerImagesBuilder( + int index) { + return getDockerImagesFieldBuilder() + .addBuilder( + index, com.google.devtools.artifactregistry.v1.DockerImage.getDefaultInstance()); + } + /** + * + * + *
+     * The docker images returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + public java.util.List + getDockerImagesBuilderList() { + return getDockerImagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.devtools.artifactregistry.v1.DockerImage, + com.google.devtools.artifactregistry.v1.DockerImage.Builder, + com.google.devtools.artifactregistry.v1.DockerImageOrBuilder> + getDockerImagesFieldBuilder() { + if (dockerImagesBuilder_ == null) { + dockerImagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.devtools.artifactregistry.v1.DockerImage, + com.google.devtools.artifactregistry.v1.DockerImage.Builder, + com.google.devtools.artifactregistry.v1.DockerImageOrBuilder>( + dockerImages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + dockerImages_ = null; + } + return dockerImagesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The token to retrieve the next page of artifacts, or empty if there are no
+     * more artifacts to return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token to retrieve the next page of artifacts, or empty if there are no
+     * more artifacts to return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token to retrieve the next page of artifacts, or empty if there are no
+     * more artifacts to return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The token to retrieve the next page of artifacts, or empty if there are no
+     * more artifacts to return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The token to retrieve the next page of artifacts, or empty if there are no
+     * more artifacts to return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.ListDockerImagesResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.ListDockerImagesResponse) + private static final com.google.devtools.artifactregistry.v1.ListDockerImagesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.ListDockerImagesResponse(); + } + + public static com.google.devtools.artifactregistry.v1.ListDockerImagesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDockerImagesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListDockerImagesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListDockerImagesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponseOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponseOrBuilder.java new file mode 100644 index 00000000..e0d919e8 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListDockerImagesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/artifact.proto + +package com.google.devtools.artifactregistry.v1; + +public interface ListDockerImagesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.ListDockerImagesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + java.util.List getDockerImagesList(); + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + com.google.devtools.artifactregistry.v1.DockerImage getDockerImages(int index); + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + int getDockerImagesCount(); + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + java.util.List + getDockerImagesOrBuilderList(); + /** + * + * + *
+   * The docker images returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.DockerImage docker_images = 1; + */ + com.google.devtools.artifactregistry.v1.DockerImageOrBuilder getDockerImagesOrBuilder(int index); + + /** + * + * + *
+   * The token to retrieve the next page of artifacts, or empty if there are no
+   * more artifacts to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The token to retrieve the next page of artifacts, or empty if there are no
+   * more artifacts to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequest.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequest.java new file mode 100644 index 00000000..1bd71c29 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequest.java @@ -0,0 +1,927 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * The request to list repositories.
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListRepositoriesRequest} + */ +public final class ListRepositoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.ListRepositoriesRequest) + ListRepositoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRepositoriesRequest.newBuilder() to construct. + private ListRepositoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRepositoriesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRepositoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRepositoriesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.class, + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the parent resource whose repositories will be listed.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the parent resource whose repositories will be listed.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of repositories to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.ListRepositoriesRequest)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest other = + (com.google.devtools.artifactregistry.v1.ListRepositoriesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request to list repositories.
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListRepositoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.ListRepositoriesRequest) + com.google.devtools.artifactregistry.v1.ListRepositoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.class, + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesRequest + getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesRequest build() { + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesRequest buildPartial() { + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest result = + new com.google.devtools.artifactregistry.v1.ListRepositoriesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.ListRepositoriesRequest) { + return mergeFrom((com.google.devtools.artifactregistry.v1.ListRepositoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest other) { + if (other + == com.google.devtools.artifactregistry.v1.ListRepositoriesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.ListRepositoriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.ListRepositoriesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource whose repositories will be listed.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource whose repositories will be listed.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource whose repositories will be listed.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource whose repositories will be listed.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource whose repositories will be listed.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of repositories to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of repositories to return.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of repositories to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next_page_token value returned from a previous list request, if any.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.ListRepositoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.ListRepositoriesRequest) + private static final com.google.devtools.artifactregistry.v1.ListRepositoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.ListRepositoriesRequest(); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRepositoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRepositoriesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequestOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequestOrBuilder.java new file mode 100644 index 00000000..e4ce1c53 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +public interface ListRepositoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.ListRepositoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource whose repositories will be listed.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource whose repositories will be listed.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of repositories to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The next_page_token value returned from a previous list request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponse.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponse.java new file mode 100644 index 00000000..5e17cbf0 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponse.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * The response from listing repositories.
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListRepositoriesResponse} + */ +public final class ListRepositoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.ListRepositoriesResponse) + ListRepositoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRepositoriesResponse.newBuilder() to construct. + private ListRepositoriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRepositoriesResponse() { + repositories_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRepositoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRepositoriesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + repositories_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + repositories_.add( + input.readMessage( + com.google.devtools.artifactregistry.v1.Repository.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + repositories_ = java.util.Collections.unmodifiableList(repositories_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.class, + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.Builder.class); + } + + public static final int REPOSITORIES_FIELD_NUMBER = 1; + private java.util.List repositories_; + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List getRepositoriesList() { + return repositories_; + } + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List + getRepositoriesOrBuilderList() { + return repositories_; + } + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + @java.lang.Override + public int getRepositoriesCount() { + return repositories_.size(); + } + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository getRepositories(int index) { + return repositories_.get(index); + } + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + @java.lang.Override + public com.google.devtools.artifactregistry.v1.RepositoryOrBuilder getRepositoriesOrBuilder( + int index) { + return repositories_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The token to retrieve the next page of repositories, or empty if there are
+   * no more repositories to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The token to retrieve the next page of repositories, or empty if there are
+   * no more repositories to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < repositories_.size(); i++) { + output.writeMessage(1, repositories_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < repositories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, repositories_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.ListRepositoriesResponse)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse other = + (com.google.devtools.artifactregistry.v1.ListRepositoriesResponse) obj; + + if (!getRepositoriesList().equals(other.getRepositoriesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRepositoriesCount() > 0) { + hash = (37 * hash) + REPOSITORIES_FIELD_NUMBER; + hash = (53 * hash) + getRepositoriesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response from listing repositories.
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.ListRepositoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.ListRepositoriesResponse) + com.google.devtools.artifactregistry.v1.ListRepositoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.class, + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRepositoriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + repositoriesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesResponse + getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesResponse build() { + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesResponse buildPartial() { + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse result = + new com.google.devtools.artifactregistry.v1.ListRepositoriesResponse(this); + int from_bitField0_ = bitField0_; + if (repositoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + repositories_ = java.util.Collections.unmodifiableList(repositories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.repositories_ = repositories_; + } else { + result.repositories_ = repositoriesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.ListRepositoriesResponse) { + return mergeFrom((com.google.devtools.artifactregistry.v1.ListRepositoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse other) { + if (other + == com.google.devtools.artifactregistry.v1.ListRepositoriesResponse.getDefaultInstance()) + return this; + if (repositoriesBuilder_ == null) { + if (!other.repositories_.isEmpty()) { + if (repositories_.isEmpty()) { + repositories_ = other.repositories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRepositoriesIsMutable(); + repositories_.addAll(other.repositories_); + } + onChanged(); + } + } else { + if (!other.repositories_.isEmpty()) { + if (repositoriesBuilder_.isEmpty()) { + repositoriesBuilder_.dispose(); + repositoriesBuilder_ = null; + repositories_ = other.repositories_; + bitField0_ = (bitField0_ & ~0x00000001); + repositoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRepositoriesFieldBuilder() + : null; + } else { + repositoriesBuilder_.addAllMessages(other.repositories_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.ListRepositoriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.ListRepositoriesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List repositories_ = + java.util.Collections.emptyList(); + + private void ensureRepositoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + repositories_ = + new java.util.ArrayList( + repositories_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.devtools.artifactregistry.v1.Repository, + com.google.devtools.artifactregistry.v1.Repository.Builder, + com.google.devtools.artifactregistry.v1.RepositoryOrBuilder> + repositoriesBuilder_; + + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public java.util.List + getRepositoriesList() { + if (repositoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(repositories_); + } else { + return repositoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public int getRepositoriesCount() { + if (repositoriesBuilder_ == null) { + return repositories_.size(); + } else { + return repositoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public com.google.devtools.artifactregistry.v1.Repository getRepositories(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder setRepositories( + int index, com.google.devtools.artifactregistry.v1.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.set(index, value); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder setRepositories( + int index, com.google.devtools.artifactregistry.v1.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.set(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder addRepositories(com.google.devtools.artifactregistry.v1.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder addRepositories( + int index, com.google.devtools.artifactregistry.v1.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(index, value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder addRepositories( + com.google.devtools.artifactregistry.v1.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder addRepositories( + int index, com.google.devtools.artifactregistry.v1.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder addAllRepositories( + java.lang.Iterable values) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, repositories_); + onChanged(); + } else { + repositoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder clearRepositories() { + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + repositoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public Builder removeRepositories(int index) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.remove(index); + onChanged(); + } else { + repositoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public com.google.devtools.artifactregistry.v1.Repository.Builder getRepositoriesBuilder( + int index) { + return getRepositoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public com.google.devtools.artifactregistry.v1.RepositoryOrBuilder getRepositoriesOrBuilder( + int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public java.util.List + getRepositoriesOrBuilderList() { + if (repositoriesBuilder_ != null) { + return repositoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(repositories_); + } + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public com.google.devtools.artifactregistry.v1.Repository.Builder addRepositoriesBuilder() { + return getRepositoriesFieldBuilder() + .addBuilder(com.google.devtools.artifactregistry.v1.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public com.google.devtools.artifactregistry.v1.Repository.Builder addRepositoriesBuilder( + int index) { + return getRepositoriesFieldBuilder() + .addBuilder( + index, com.google.devtools.artifactregistry.v1.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * The repositories returned.
+     * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + public java.util.List + getRepositoriesBuilderList() { + return getRepositoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.devtools.artifactregistry.v1.Repository, + com.google.devtools.artifactregistry.v1.Repository.Builder, + com.google.devtools.artifactregistry.v1.RepositoryOrBuilder> + getRepositoriesFieldBuilder() { + if (repositoriesBuilder_ == null) { + repositoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.devtools.artifactregistry.v1.Repository, + com.google.devtools.artifactregistry.v1.Repository.Builder, + com.google.devtools.artifactregistry.v1.RepositoryOrBuilder>( + repositories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + repositories_ = null; + } + return repositoriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The token to retrieve the next page of repositories, or empty if there are
+     * no more repositories to return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token to retrieve the next page of repositories, or empty if there are
+     * no more repositories to return.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token to retrieve the next page of repositories, or empty if there are
+     * no more repositories to return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The token to retrieve the next page of repositories, or empty if there are
+     * no more repositories to return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The token to retrieve the next page of repositories, or empty if there are
+     * no more repositories to return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.ListRepositoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.ListRepositoriesResponse) + private static final com.google.devtools.artifactregistry.v1.ListRepositoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.ListRepositoriesResponse(); + } + + public static com.google.devtools.artifactregistry.v1.ListRepositoriesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRepositoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRepositoriesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.ListRepositoriesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponseOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponseOrBuilder.java new file mode 100644 index 00000000..1654957b --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ListRepositoriesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +public interface ListRepositoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.ListRepositoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + java.util.List getRepositoriesList(); + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + com.google.devtools.artifactregistry.v1.Repository getRepositories(int index); + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + int getRepositoriesCount(); + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + java.util.List + getRepositoriesOrBuilderList(); + /** + * + * + *
+   * The repositories returned.
+   * 
+ * + * repeated .google.devtools.artifactregistry.v1.Repository repositories = 1; + */ + com.google.devtools.artifactregistry.v1.RepositoryOrBuilder getRepositoriesOrBuilder(int index); + + /** + * + * + *
+   * The token to retrieve the next page of repositories, or empty if there are
+   * no more repositories to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The token to retrieve the next page of repositories, or empty if there are
+   * no more repositories to return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/LocationName.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/LocationName.java new file mode 100644 index 00000000..5ffa2755 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2021 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/Repository.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/Repository.java new file mode 100644 index 00000000..12e2328b --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/Repository.java @@ -0,0 +1,2339 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +/** + * + * + *
+ * A Repository for storing artifacts with a specific format.
+ * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.Repository} + */ +public final class Repository extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.artifactregistry.v1.Repository) + RepositoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Repository.newBuilder() to construct. + private Repository(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Repository() { + name_ = ""; + format_ = 0; + description_ = ""; + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Repository(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Repository( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + format_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_Repository_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_Repository_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.Repository.class, + com.google.devtools.artifactregistry.v1.Repository.Builder.class); + } + + /** + * + * + *
+   * A package format.
+   * 
+ * + * Protobuf enum {@code google.devtools.artifactregistry.v1.Repository.Format} + */ + public enum Format implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified package format.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + FORMAT_UNSPECIFIED(0), + /** + * + * + *
+     * Docker package format.
+     * 
+ * + * DOCKER = 1; + */ + DOCKER(1), + /** + * + * + *
+     * Maven package format.
+     * 
+ * + * MAVEN = 2; + */ + MAVEN(2), + /** + * + * + *
+     * NPM package format.
+     * 
+ * + * NPM = 3; + */ + NPM(3), + /** + * + * + *
+     * APT package format.
+     * 
+ * + * APT = 5; + */ + APT(5), + /** + * + * + *
+     * YUM package format.
+     * 
+ * + * YUM = 6; + */ + YUM(6), + /** + * + * + *
+     * Python package format.
+     * 
+ * + * PYTHON = 8; + */ + PYTHON(8), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified package format.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + public static final int FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Docker package format.
+     * 
+ * + * DOCKER = 1; + */ + public static final int DOCKER_VALUE = 1; + /** + * + * + *
+     * Maven package format.
+     * 
+ * + * MAVEN = 2; + */ + public static final int MAVEN_VALUE = 2; + /** + * + * + *
+     * NPM package format.
+     * 
+ * + * NPM = 3; + */ + public static final int NPM_VALUE = 3; + /** + * + * + *
+     * APT package format.
+     * 
+ * + * APT = 5; + */ + public static final int APT_VALUE = 5; + /** + * + * + *
+     * YUM package format.
+     * 
+ * + * YUM = 6; + */ + public static final int YUM_VALUE = 6; + /** + * + * + *
+     * Python package format.
+     * 
+ * + * PYTHON = 8; + */ + public static final int PYTHON_VALUE = 8; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Format valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Format forNumber(int value) { + switch (value) { + case 0: + return FORMAT_UNSPECIFIED; + case 1: + return DOCKER; + case 2: + return MAVEN; + case 3: + return NPM; + case 5: + return APT; + case 6: + return YUM; + case 8: + return PYTHON; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Format findValueByNumber(int number) { + return Format.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.Repository.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Format[] VALUES = values(); + + public static Format valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Format(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.devtools.artifactregistry.v1.Repository.Format) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The name of the repository, for example:
+   * "projects/p1/locations/us-central1/repositories/repo1".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the repository, for example:
+   * "projects/p1/locations/us-central1/repositories/repo1".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORMAT_FIELD_NUMBER = 2; + private int format_; + /** + * + * + *
+   * The format of packages that are stored in the repository.
+   * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + /** + * + * + *
+   * The format of packages that are stored in the repository.
+   * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return The format. + */ + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository.Format getFormat() { + @SuppressWarnings("deprecation") + com.google.devtools.artifactregistry.v1.Repository.Format result = + com.google.devtools.artifactregistry.v1.Repository.Format.valueOf(format_); + return result == null + ? com.google.devtools.artifactregistry.v1.Repository.Format.UNRECOGNIZED + : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * The user-provided description of the repository.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * The user-provided description of the repository.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_Repository_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time when the repository was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time when the repository was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time when the repository was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The time when the repository was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The time when the repository was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The time when the repository was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 8; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * The Cloud KMS resource name of the customer managed encryption key that’s
+   * used to encrypt the contents of the Repository. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * This value may not be changed after the Repository has been created.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * The Cloud KMS resource name of the customer managed encryption key that’s
+   * used to encrypt the contents of the Repository. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * This value may not be changed after the Repository has been created.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (format_ + != com.google.devtools.artifactregistry.v1.Repository.Format.FORMAT_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, format_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (!getKmsKeyNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, kmsKeyName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (format_ + != com.google.devtools.artifactregistry.v1.Repository.Format.FORMAT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, format_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (!getKmsKeyNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, kmsKeyName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.devtools.artifactregistry.v1.Repository)) { + return super.equals(obj); + } + com.google.devtools.artifactregistry.v1.Repository other = + (com.google.devtools.artifactregistry.v1.Repository) obj; + + if (!getName().equals(other.getName())) return false; + if (format_ != other.format_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.devtools.artifactregistry.v1.Repository parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.devtools.artifactregistry.v1.Repository prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Repository for storing artifacts with a specific format.
+   * 
+ * + * Protobuf type {@code google.devtools.artifactregistry.v1.Repository} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.artifactregistry.v1.Repository) + com.google.devtools.artifactregistry.v1.RepositoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_Repository_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_Repository_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.devtools.artifactregistry.v1.Repository.class, + com.google.devtools.artifactregistry.v1.Repository.Builder.class); + } + + // Construct using com.google.devtools.artifactregistry.v1.Repository.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + format_ = 0; + + description_ = ""; + + internalGetMutableLabels().clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + kmsKeyName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.devtools.artifactregistry.v1.RepositoryProto + .internal_static_google_devtools_artifactregistry_v1_Repository_descriptor; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository getDefaultInstanceForType() { + return com.google.devtools.artifactregistry.v1.Repository.getDefaultInstance(); + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository build() { + com.google.devtools.artifactregistry.v1.Repository result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository buildPartial() { + com.google.devtools.artifactregistry.v1.Repository result = + new com.google.devtools.artifactregistry.v1.Repository(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.format_ = format_; + result.description_ = description_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.kmsKeyName_ = kmsKeyName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.devtools.artifactregistry.v1.Repository) { + return mergeFrom((com.google.devtools.artifactregistry.v1.Repository) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.devtools.artifactregistry.v1.Repository other) { + if (other == com.google.devtools.artifactregistry.v1.Repository.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.devtools.artifactregistry.v1.Repository parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.devtools.artifactregistry.v1.Repository) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the repository, for example:
+     * "projects/p1/locations/us-central1/repositories/repo1".
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the repository, for example:
+     * "projects/p1/locations/us-central1/repositories/repo1".
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the repository, for example:
+     * "projects/p1/locations/us-central1/repositories/repo1".
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the repository, for example:
+     * "projects/p1/locations/us-central1/repositories/repo1".
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the repository, for example:
+     * "projects/p1/locations/us-central1/repositories/repo1".
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int format_ = 0; + /** + * + * + *
+     * The format of packages that are stored in the repository.
+     * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + /** + * + * + *
+     * The format of packages that are stored in the repository.
+     * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @param value The enum numeric value on the wire for format to set. + * @return This builder for chaining. + */ + public Builder setFormatValue(int value) { + + format_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The format of packages that are stored in the repository.
+     * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return The format. + */ + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository.Format getFormat() { + @SuppressWarnings("deprecation") + com.google.devtools.artifactregistry.v1.Repository.Format result = + com.google.devtools.artifactregistry.v1.Repository.Format.valueOf(format_); + return result == null + ? com.google.devtools.artifactregistry.v1.Repository.Format.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The format of packages that are stored in the repository.
+     * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(com.google.devtools.artifactregistry.v1.Repository.Format value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The format of packages that are stored in the repository.
+     * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + + format_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The user-provided description of the repository.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user-provided description of the repository.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user-provided description of the repository.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user-provided description of the repository.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user-provided description of the repository.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels with user-defined metadata.
+     * This field may contain up to 64 entries. Label keys and values may be no
+     * longer than 63 characters. Label keys must begin with a lowercase letter
+     * and may only contain lowercase letters, numeric characters, underscores,
+     * and dashes.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time when the repository was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The time when the repository was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * The Cloud KMS resource name of the customer managed encryption key that’s
+     * used to encrypt the contents of the Repository. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * This value may not be changed after the Repository has been created.
+     * 
+ * + * string kms_key_name = 8; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Cloud KMS resource name of the customer managed encryption key that’s
+     * used to encrypt the contents of the Repository. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * This value may not be changed after the Repository has been created.
+     * 
+ * + * string kms_key_name = 8; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Cloud KMS resource name of the customer managed encryption key that’s
+     * used to encrypt the contents of the Repository. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * This value may not be changed after the Repository has been created.
+     * 
+ * + * string kms_key_name = 8; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud KMS resource name of the customer managed encryption key that’s
+     * used to encrypt the contents of the Repository. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * This value may not be changed after the Repository has been created.
+     * 
+ * + * string kms_key_name = 8; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud KMS resource name of the customer managed encryption key that’s
+     * used to encrypt the contents of the Repository. Has the form:
+     * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+     * This value may not be changed after the Repository has been created.
+     * 
+ * + * string kms_key_name = 8; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.devtools.artifactregistry.v1.Repository) + } + + // @@protoc_insertion_point(class_scope:google.devtools.artifactregistry.v1.Repository) + private static final com.google.devtools.artifactregistry.v1.Repository DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.devtools.artifactregistry.v1.Repository(); + } + + public static com.google.devtools.artifactregistry.v1.Repository getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Repository parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Repository(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.devtools.artifactregistry.v1.Repository getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryName.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryName.java new file mode 100644 index 00000000..80d39302 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class RepositoryName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_REPOSITORY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/repositories/{repository}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String repository; + + @Deprecated + protected RepositoryName() { + project = null; + location = null; + repository = null; + } + + private RepositoryName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + repository = Preconditions.checkNotNull(builder.getRepository()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRepository() { + return repository; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RepositoryName of(String project, String location, String repository) { + return newBuilder().setProject(project).setLocation(location).setRepository(repository).build(); + } + + public static String format(String project, String location, String repository) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setRepository(repository) + .build() + .toString(); + } + + public static RepositoryName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_REPOSITORY.validatedMatch( + formattedString, "RepositoryName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("repository")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (RepositoryName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_REPOSITORY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (repository != null) { + fieldMapBuilder.put("repository", repository); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_REPOSITORY.instantiate( + "project", project, "location", location, "repository", repository); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + RepositoryName that = ((RepositoryName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.repository, that.repository); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(repository); + return h; + } + + /** Builder for projects/{project}/locations/{location}/repositories/{repository}. */ + public static class Builder { + private String project; + private String location; + private String repository; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getRepository() { + return repository; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setRepository(String repository) { + this.repository = repository; + return this; + } + + private Builder(RepositoryName repositoryName) { + this.project = repositoryName.project; + this.location = repositoryName.location; + this.repository = repositoryName.repository; + } + + public RepositoryName build() { + return new RepositoryName(this); + } + } +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryOrBuilder.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryOrBuilder.java new file mode 100644 index 00000000..5422751e --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryOrBuilder.java @@ -0,0 +1,277 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +public interface RepositoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.artifactregistry.v1.Repository) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the repository, for example:
+   * "projects/p1/locations/us-central1/repositories/repo1".
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the repository, for example:
+   * "projects/p1/locations/us-central1/repositories/repo1".
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The format of packages that are stored in the repository.
+   * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return The enum numeric value on the wire for format. + */ + int getFormatValue(); + /** + * + * + *
+   * The format of packages that are stored in the repository.
+   * 
+ * + * .google.devtools.artifactregistry.v1.Repository.Format format = 2; + * + * @return The format. + */ + com.google.devtools.artifactregistry.v1.Repository.Format getFormat(); + + /** + * + * + *
+   * The user-provided description of the repository.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The user-provided description of the repository.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels with user-defined metadata.
+   * This field may contain up to 64 entries. Label keys and values may be no
+   * longer than 63 characters. Label keys must begin with a lowercase letter
+   * and may only contain lowercase letters, numeric characters, underscores,
+   * and dashes.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The time when the repository was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time when the repository was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time when the repository was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time when the repository was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The time when the repository was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The time when the repository was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The Cloud KMS resource name of the customer managed encryption key that’s
+   * used to encrypt the contents of the Repository. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * This value may not be changed after the Repository has been created.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * The Cloud KMS resource name of the customer managed encryption key that’s
+   * used to encrypt the contents of the Repository. Has the form:
+   * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
+   * This value may not be changed after the Repository has been created.
+   * 
+ * + * string kms_key_name = 8; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryProto.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryProto.java new file mode 100644 index 00000000..b8e83c21 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/RepositoryProto.java @@ -0,0 +1,161 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/repository.proto + +package com.google.devtools.artifactregistry.v1; + +public final class RepositoryProto { + private RepositoryProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_Repository_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_Repository_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_Repository_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_Repository_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/devtools/artifactregistry/v1/re" + + "pository.proto\022#google.devtools.artifact" + + "registry.v1\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032\037google/" + + "protobuf/timestamp.proto\032\034google/api/ann" + + "otations.proto\"\277\004\n\nRepository\022\014\n\004name\030\001 " + + "\001(\t\022F\n\006format\030\002 \001(\01626.google.devtools.ar" + + "tifactregistry.v1.Repository.Format\022\023\n\013d" + + "escription\030\003 \001(\t\022K\n\006labels\030\004 \003(\0132;.googl" + + "e.devtools.artifactregistry.v1.Repositor" + + "y.LabelsEntry\022/\n\013create_time\030\005 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022/\n\013update_time\030\006 " + + "\001(\0132\032.google.protobuf.Timestamp\022\024\n\014kms_k" + + "ey_name\030\010 \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"^\n\006Format\022\026\n\022FORMAT" + + "_UNSPECIFIED\020\000\022\n\n\006DOCKER\020\001\022\t\n\005MAVEN\020\002\022\007\n" + + "\003NPM\020\003\022\007\n\003APT\020\005\022\007\n\003YUM\020\006\022\n\n\006PYTHON\020\010:r\352A" + + "o\n*artifactregistry.googleapis.com/Repos" + + "itory\022Aprojects/{project}/locations/{loc" + + "ation}/repositories/{repository}\"\204\001\n\027Lis" + + "tRepositoriesRequest\022B\n\006parent\030\001 \001(\tB2\340A" + + "\002\372A,\022*artifactregistry.googleapis.com/Re" + + "pository\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" + + "n\030\003 \001(\t\"z\n\030ListRepositoriesResponse\022E\n\014r" + + "epositories\030\001 \003(\0132/.google.devtools.arti" + + "factregistry.v1.Repository\022\027\n\017next_page_" + + "token\030\002 \001(\t\"X\n\024GetRepositoryRequest\022@\n\004n" + + "ame\030\001 \001(\tB2\340A\002\372A,\022*artifactregistry.goog" + + "leapis.com/RepositoryB\375\001\n\'com.google.dev" + + "tools.artifactregistry.v1B\017RepositoryPro" + + "toP\001ZSgoogle.golang.org/genproto/googlea" + + "pis/devtools/artifactregistry/v1;artifac" + + "tregistry\252\002 Google.Cloud.ArtifactRegistr" + + "y.V1\312\002 Google\\Cloud\\ArtifactRegistry\\V1\352" + + "\002#Google::Cloud::ArtifactRegistry::V1b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_devtools_artifactregistry_v1_Repository_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_devtools_artifactregistry_v1_Repository_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_Repository_descriptor, + new java.lang.String[] { + "Name", "Format", "Description", "Labels", "CreateTime", "UpdateTime", "KmsKeyName", + }); + internal_static_google_devtools_artifactregistry_v1_Repository_LabelsEntry_descriptor = + internal_static_google_devtools_artifactregistry_v1_Repository_descriptor + .getNestedTypes() + .get(0); + internal_static_google_devtools_artifactregistry_v1_Repository_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_Repository_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_ListRepositoriesResponse_descriptor, + new java.lang.String[] { + "Repositories", "NextPageToken", + }); + internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_artifactregistry_v1_GetRepositoryRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ServiceProto.java b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ServiceProto.java new file mode 100644 index 00000000..924e861a --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/java/com/google/devtools/artifactregistry/v1/ServiceProto.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/artifactregistry/v1/service.proto + +package com.google.devtools.artifactregistry.v1; + +public final class ServiceProto { + private ServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/devtools/artifactregistry/v1/se" + + "rvice.proto\022#google.devtools.artifactreg" + + "istry.v1\032\034google/api/annotations.proto\032\027" + + "google/api/client.proto\0322google/devtools" + + "/artifactregistry/v1/artifact.proto\0324goo" + + "gle/devtools/artifactregistry/v1/reposit" + + "ory.proto\032\032google/iam/v1/policy.proto2\231\006" + + "\n\020ArtifactRegistry\022\341\001\n\020ListDockerImages\022" + + "<.google.devtools.artifactregistry.v1.Li" + + "stDockerImagesRequest\032=.google.devtools." + + "artifactregistry.v1.ListDockerImagesResp" + + "onse\"P\202\323\344\223\002A\022?/v1/{parent=projects/*/loc" + + "ations/*/repositories/*}/dockerImages\332A\006" + + "parent\022\322\001\n\020ListRepositories\022<.google.dev" + + "tools.artifactregistry.v1.ListRepositori" + + "esRequest\032=.google.devtools.artifactregi" + + "stry.v1.ListRepositoriesResponse\"A\202\323\344\223\0022" + + "\0220/v1/{parent=projects/*/locations/*}/re" + + "positories\332A\006parent\022\274\001\n\rGetRepository\0229." + + "google.devtools.artifactregistry.v1.GetR" + + "epositoryRequest\032/.google.devtools.artif" + + "actregistry.v1.Repository\"?\202\323\344\223\0022\0220/v1/{" + + "name=projects/*/locations/*/repositories" + + "/*}\332A\004name\032\214\001\312A\037artifactregistry.googlea" + + "pis.com\322Aghttps://www.googleapis.com/aut" + + "h/cloud-platform,https://www.googleapis." + + "com/auth/cloud-platform.read-onlyB\372\001\n\'co" + + "m.google.devtools.artifactregistry.v1B\014S" + + "erviceProtoP\001ZSgoogle.golang.org/genprot" + + "o/googleapis/devtools/artifactregistry/v" + + "1;artifactregistry\252\002 Google.Cloud.Artifa" + + "ctRegistry.V1\312\002 Google\\Cloud\\ArtifactReg" + + "istry\\V1\352\002#Google::Cloud::ArtifactRegist" + + "ry::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.devtools.artifactregistry.v1.ArtifactProto.getDescriptor(), + com.google.devtools.artifactregistry.v1.RepositoryProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.devtools.artifactregistry.v1.ArtifactProto.getDescriptor(); + com.google.devtools.artifactregistry.v1.RepositoryProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/artifact.proto b/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/artifact.proto new file mode 100644 index 00000000..9adc076e --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/artifact.proto @@ -0,0 +1,106 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.devtools.artifactregistry.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1"; +option go_package = "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1;artifactregistry"; +option java_multiple_files = true; +option java_outer_classname = "ArtifactProto"; +option java_package = "com.google.devtools.artifactregistry.v1"; +option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1"; +option ruby_package = "Google::Cloud::ArtifactRegistry::V1"; + +// DockerImage represents a docker artifact. +// The following fields are returned as untyped metadata in the Version +// resource, using camelcase keys (i.e. metadata.imageSizeBytes): +// - imageSizeBytes +// - mediaType +// - buildTime +message DockerImage { + option (google.api.resource) = { + type: "artifactregistry.googleapis.com/DockerImage" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/dockerImages/{docker_image}" + }; + + // Required. registry_location, project_id, repository_name and image id forms a unique + // image + // name:`projects//locations//repository//dockerImages/`. + // For example, + // "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/ + // nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf", + // where "us-west4" is the registry_location, "test-project" is the + // project_id, "test-repo" is the repository_name and + // "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf" + // is the image's digest. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URL to access the image. + // Example: + // us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Tags attached to this image. + repeated string tags = 3; + + // Calculated size of the image. + // This field is returned as the 'metadata.imageSizeBytes' field in the + // Version resource. + int64 image_size_bytes = 4; + + // Time the image was uploaded. + google.protobuf.Timestamp upload_time = 5; + + // Media type of this image, e.g. + // "application/vnd.docker.distribution.manifest.v2+json". + // This field is returned as the 'metadata.mediaType' field in the + // Version resource. + string media_type = 6; + + // The time this image was built. + // This field is returned as the 'metadata.buildTime' field in the + // Version resource. + // The build time is returned to the client as an RFC 3339 string, which can + // be easily used with the JavaScript Date constructor. + google.protobuf.Timestamp build_time = 7; +} + +// The request to list docker images. +message ListDockerImagesRequest { + // Required. The name of the parent resource whose docker images will be listed. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of artifacts to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request, if any. + string page_token = 3; +} + +// The response from listing docker images. +message ListDockerImagesResponse { + // The docker images returned. + repeated DockerImage docker_images = 1; + + // The token to retrieve the next page of artifacts, or empty if there are no + // more artifacts to return. + string next_page_token = 2; +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/repository.proto b/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/repository.proto new file mode 100644 index 00000000..bde55c1c --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/repository.proto @@ -0,0 +1,129 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.devtools.artifactregistry.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1"; +option go_package = "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1;artifactregistry"; +option java_multiple_files = true; +option java_outer_classname = "RepositoryProto"; +option java_package = "com.google.devtools.artifactregistry.v1"; +option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1"; +option ruby_package = "Google::Cloud::ArtifactRegistry::V1"; + +// A Repository for storing artifacts with a specific format. +message Repository { + option (google.api.resource) = { + type: "artifactregistry.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/repositories/{repository}" + }; + + // A package format. + enum Format { + // Unspecified package format. + FORMAT_UNSPECIFIED = 0; + + // Docker package format. + DOCKER = 1; + + // Maven package format. + MAVEN = 2; + + // NPM package format. + NPM = 3; + + // APT package format. + APT = 5; + + // YUM package format. + YUM = 6; + + // Python package format. + PYTHON = 8; + } + + // The name of the repository, for example: + // "projects/p1/locations/us-central1/repositories/repo1". + string name = 1; + + // The format of packages that are stored in the repository. + Format format = 2; + + // The user-provided description of the repository. + string description = 3; + + // Labels with user-defined metadata. + // This field may contain up to 64 entries. Label keys and values may be no + // longer than 63 characters. Label keys must begin with a lowercase letter + // and may only contain lowercase letters, numeric characters, underscores, + // and dashes. + map labels = 4; + + // The time when the repository was created. + google.protobuf.Timestamp create_time = 5; + + // The time when the repository was last updated. + google.protobuf.Timestamp update_time = 6; + + // The Cloud KMS resource name of the customer managed encryption key that’s + // used to encrypt the contents of the Repository. Has the form: + // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. + // This value may not be changed after the Repository has been created. + string kms_key_name = 8; +} + +// The request to list repositories. +message ListRepositoriesRequest { + // Required. The name of the parent resource whose repositories will be listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "artifactregistry.googleapis.com/Repository" + } + ]; + + // The maximum number of repositories to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request, if any. + string page_token = 3; +} + +// The response from listing repositories. +message ListRepositoriesResponse { + // The repositories returned. + repeated Repository repositories = 1; + + // The token to retrieve the next page of repositories, or empty if there are + // no more repositories to return. + string next_page_token = 2; +} + +// The request to retrieve a repository. +message GetRepositoryRequest { + // Required. The name of the repository to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "artifactregistry.googleapis.com/Repository" + } + ]; +} diff --git a/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/service.proto b/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/service.proto new file mode 100644 index 00000000..535f1ba5 --- /dev/null +++ b/proto-google-cloud-artifact-registry-v1/src/main/proto/google/devtools/artifactregistry/v1/service.proto @@ -0,0 +1,75 @@ +// Copyright 2021 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 +// +// http://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. + +syntax = "proto3"; + +package google.devtools.artifactregistry.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/devtools/artifactregistry/v1/artifact.proto"; +import "google/devtools/artifactregistry/v1/repository.proto"; +import "google/iam/v1/policy.proto"; + +option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1"; +option go_package = "google.golang.org/genproto/googleapis/devtools/artifactregistry/v1;artifactregistry"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.devtools.artifactregistry.v1"; +option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1"; +option ruby_package = "Google::Cloud::ArtifactRegistry::V1"; + +// The Artifact Registry API service. +// +// Artifact Registry is an artifact management system for storing artifacts +// from different package management systems. +// +// The resources managed by this API are: +// +// * Repositories, which group packages and their data. +// * Packages, which group versions and their tags. +// * Versions, which are specific forms of a package. +// * Tags, which represent alternative names for versions. +// * Files, which contain content and are optionally associated with a Package +// or Version. +service ArtifactRegistry { + option (google.api.default_host) = "artifactregistry.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists docker images. + rpc ListDockerImages(ListDockerImagesRequest) returns (ListDockerImagesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/repositories/*}/dockerImages" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists repositories. + rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/repositories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a repository. + rpc GetRepository(GetRepositoryRequest) returns (Repository) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/versions.txt b/versions.txt index 3bc71f47..5403fc9d 100644 --- a/versions.txt +++ b/versions.txt @@ -3,4 +3,6 @@ google-cloud-artifact-registry:0.4.3:0.4.4-SNAPSHOT grpc-google-cloud-artifact-registry-v1beta2:0.4.3:0.4.4-SNAPSHOT +grpc-google-cloud-artifact-registry-v1:0.4.3:0.4.4-SNAPSHOT proto-google-cloud-artifact-registry-v1beta2:0.4.3:0.4.4-SNAPSHOT +proto-google-cloud-artifact-registry-v1:0.4.3:0.4.4-SNAPSHOT