diff --git a/java-cloudbuild/README.md b/java-cloudbuild/README.md index 0d608519b5fb..072631705088 100644 --- a/java-cloudbuild/README.md +++ b/java-cloudbuild/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-build - 3.10.0 + 3.12.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-build:3.10.0' +implementation 'com.google.cloud:google-cloud-build:3.12.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-build" % "3.10.0" +libraryDependencies += "com.google.cloud" % "google-cloud-build" % "3.12.0" ``` ## Authentication diff --git a/java-cloudbuild/google-cloud-build-bom/pom.xml b/java-cloudbuild/google-cloud-build-bom/pom.xml index 6d0bb0aea58f..92effcd962fc 100644 --- a/java-cloudbuild/google-cloud-build-bom/pom.xml +++ b/java-cloudbuild/google-cloud-build-bom/pom.xml @@ -30,11 +30,21 @@ grpc-google-cloud-build-v1 3.13.0-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-build-v2 + 3.13.0-SNAPSHOT + com.google.api.grpc proto-google-cloud-build-v1 3.13.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-build-v2 + 3.13.0-SNAPSHOT + diff --git a/java-cloudbuild/google-cloud-build/pom.xml b/java-cloudbuild/google-cloud-build/pom.xml index ba9eb957d49e..47e0d31adc4a 100644 --- a/java-cloudbuild/google-cloud-build/pom.xml +++ b/java-cloudbuild/google-cloud-build/pom.xml @@ -42,6 +42,10 @@ com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-build-v2 + com.google.api.grpc proto-google-cloud-build-v1 @@ -73,11 +77,26 @@ junit test + + com.google.api.grpc + grpc-google-iam-v1 + test + + + com.google.api.grpc + grpc-google-common-protos + test + com.google.api.grpc grpc-google-cloud-build-v1 test + + com.google.api.grpc + grpc-google-cloud-build-v2 + test + com.google.api diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerClient.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerClient.java new file mode 100644 index 000000000000..65811f452ecd --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerClient.java @@ -0,0 +1,2538 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +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.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.stub.RepositoryManagerStub; +import google.devtools.cloudbuild.v2.stub.RepositoryManagerStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages connections to source code repostiories. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+ *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+ *   Connection response = repositoryManagerClient.getConnection(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the RepositoryManagerClient 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 RepositoryManagerSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RepositoryManagerSettings repositoryManagerSettings =
+ *     RepositoryManagerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RepositoryManagerClient repositoryManagerClient =
+ *     RepositoryManagerClient.create(repositoryManagerSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RepositoryManagerSettings repositoryManagerSettings =
+ *     RepositoryManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RepositoryManagerClient repositoryManagerClient =
+ *     RepositoryManagerClient.create(repositoryManagerSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RepositoryManagerSettings repositoryManagerSettings =
+ *     RepositoryManagerSettings.newHttpJsonBuilder().build();
+ * RepositoryManagerClient repositoryManagerClient =
+ *     RepositoryManagerClient.create(repositoryManagerSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class RepositoryManagerClient implements BackgroundResource { + private final RepositoryManagerSettings settings; + private final RepositoryManagerStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of RepositoryManagerClient with default settings. */ + public static final RepositoryManagerClient create() throws IOException { + return create(RepositoryManagerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RepositoryManagerClient, 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 RepositoryManagerClient create(RepositoryManagerSettings settings) + throws IOException { + return new RepositoryManagerClient(settings); + } + + /** + * Constructs an instance of RepositoryManagerClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(RepositoryManagerSettings). + */ + public static final RepositoryManagerClient create(RepositoryManagerStub stub) { + return new RepositoryManagerClient(stub); + } + + /** + * Constructs an instance of RepositoryManagerClient, 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 RepositoryManagerClient(RepositoryManagerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RepositoryManagerStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected RepositoryManagerClient(RepositoryManagerStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final RepositoryManagerSettings getSettings() { + return settings; + } + + public RepositoryManagerStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   String connectionId = "connectionId1923106969";
+   *   Connection response =
+   *       repositoryManagerClient.createConnectionAsync(parent, connection, connectionId).get();
+   * }
+   * }
+ * + * @param parent Required. Project and location where the connection will be created. Format: + * `projects/*/locations/*`. + * @param connection Required. The Connection to create. + * @param connectionId Required. The ID to use for the Connection, which will become the final + * component of the Connection's resource name. Names must be unique per-project per-location. + * Allows alphanumeric characters and any of -._~%!$&'()*+,;={@literal @}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createConnectionAsync( + LocationName parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Connection connection = Connection.newBuilder().build();
+   *   String connectionId = "connectionId1923106969";
+   *   Connection response =
+   *       repositoryManagerClient.createConnectionAsync(parent, connection, connectionId).get();
+   * }
+   * }
+ * + * @param parent Required. Project and location where the connection will be created. Format: + * `projects/*/locations/*`. + * @param connection Required. The Connection to create. + * @param connectionId Required. The ID to use for the Connection, which will become the final + * component of the Connection's resource name. Names must be unique per-project per-location. + * Allows alphanumeric characters and any of -._~%!$&'()*+,;={@literal @}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createConnectionAsync( + String parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   CreateConnectionRequest request =
+   *       CreateConnectionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setConnection(Connection.newBuilder().build())
+   *           .setConnectionId("connectionId1923106969")
+   *           .build();
+   *   Connection response = repositoryManagerClient.createConnectionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createConnectionAsync( + CreateConnectionRequest request) { + return createConnectionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   CreateConnectionRequest request =
+   *       CreateConnectionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setConnection(Connection.newBuilder().build())
+   *           .setConnectionId("connectionId1923106969")
+   *           .build();
+   *   OperationFuture future =
+   *       repositoryManagerClient.createConnectionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Connection response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createConnectionOperationCallable() { + return stub.createConnectionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   CreateConnectionRequest request =
+   *       CreateConnectionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setConnection(Connection.newBuilder().build())
+   *           .setConnectionId("connectionId1923106969")
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.createConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createConnectionCallable() { + return stub.createConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = repositoryManagerClient.getConnection(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Connection to retrieve. Format: + * `projects/*/locations/*/connections/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection getConnection(ConnectionName name) { + GetConnectionRequest request = + GetConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
+   *   Connection response = repositoryManagerClient.getConnection(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Connection to retrieve. Format: + * `projects/*/locations/*/connections/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection getConnection(String name) { + GetConnectionRequest request = GetConnectionRequest.newBuilder().setName(name).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   GetConnectionRequest request =
+   *       GetConnectionRequest.newBuilder()
+   *           .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .build();
+   *   Connection response = repositoryManagerClient.getConnection(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 Connection getConnection(GetConnectionRequest request) { + return getConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   GetConnectionRequest request =
+   *       GetConnectionRequest.newBuilder()
+   *           .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.getConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   Connection response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getConnectionCallable() { + return stub.getConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Connections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Connection element : repositoryManagerClient.listConnections(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of Connections. Format: + * `projects/*/locations/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConnectionsPagedResponse listConnections(LocationName parent) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Connections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Connection element : repositoryManagerClient.listConnections(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of Connections. Format: + * `projects/*/locations/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConnectionsPagedResponse listConnections(String parent) { + ListConnectionsRequest request = ListConnectionsRequest.newBuilder().setParent(parent).build(); + return listConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Connections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ListConnectionsRequest request =
+   *       ListConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Connection element : repositoryManagerClient.listConnections(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 ListConnectionsPagedResponse listConnections(ListConnectionsRequest request) { + return listConnectionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Connections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ListConnectionsRequest request =
+   *       ListConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.listConnectionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Connection element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConnectionsPagedCallable() { + return stub.listConnectionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Connections in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ListConnectionsRequest request =
+   *       ListConnectionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListConnectionsResponse response =
+   *         repositoryManagerClient.listConnectionsCallable().call(request);
+   *     for (Connection element : response.getConnectionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConnectionsCallable() { + return stub.listConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response =
+   *       repositoryManagerClient.updateConnectionAsync(connection, updateMask).get();
+   * }
+   * }
+ * + * @param connection Required. The Connection to update. + * @param updateMask The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateConnectionAsync( + Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   UpdateConnectionRequest request =
+   *       UpdateConnectionRequest.newBuilder()
+   *           .setConnection(Connection.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   Connection response = repositoryManagerClient.updateConnectionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture updateConnectionAsync( + UpdateConnectionRequest request) { + return updateConnectionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   UpdateConnectionRequest request =
+   *       UpdateConnectionRequest.newBuilder()
+   *           .setConnection(Connection.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       repositoryManagerClient.updateConnectionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Connection response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateConnectionOperationCallable() { + return stub.updateConnectionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   UpdateConnectionRequest request =
+   *       UpdateConnectionRequest.newBuilder()
+   *           .setConnection(Connection.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.updateConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateConnectionCallable() { + return stub.updateConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   repositoryManagerClient.deleteConnectionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the Connection to delete. Format: + * `projects/*/locations/*/connections/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteConnectionAsync( + ConnectionName name) { + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
+   *   repositoryManagerClient.deleteConnectionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the Connection to delete. Format: + * `projects/*/locations/*/connections/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteConnectionAsync(String name) { + DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder().setName(name).build(); + return deleteConnectionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   DeleteConnectionRequest request =
+   *       DeleteConnectionRequest.newBuilder()
+   *           .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   repositoryManagerClient.deleteConnectionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deleteConnectionAsync( + DeleteConnectionRequest request) { + return deleteConnectionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   DeleteConnectionRequest request =
+   *       DeleteConnectionRequest.newBuilder()
+   *           .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       repositoryManagerClient.deleteConnectionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteConnectionOperationCallable() { + return stub.deleteConnectionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   DeleteConnectionRequest request =
+   *       DeleteConnectionRequest.newBuilder()
+   *           .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.deleteConnectionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteConnectionCallable() { + return stub.deleteConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Repository repository = Repository.newBuilder().build();
+   *   String repositoryId = "repositoryId2113747461";
+   *   Repository response =
+   *       repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get();
+   * }
+   * }
+ * + * @param parent Required. The connection to contain the repository. If the request is part of a + * BatchCreateRepositoriesRequest, this field should be empty or match the parent specified + * there. + * @param repository Required. The repository to create. + * @param repositoryId Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in the connection. + * Allows alphanumeric characters and any of -._~%!$&'()*+,;={@literal @}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createRepositoryAsync( + ConnectionName parent, Repository repository, String repositoryId) { + CreateRepositoryRequest request = + CreateRepositoryRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setRepository(repository) + .setRepositoryId(repositoryId) + .build(); + return createRepositoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
+   *   Repository repository = Repository.newBuilder().build();
+   *   String repositoryId = "repositoryId2113747461";
+   *   Repository response =
+   *       repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get();
+   * }
+   * }
+ * + * @param parent Required. The connection to contain the repository. If the request is part of a + * BatchCreateRepositoriesRequest, this field should be empty or match the parent specified + * there. + * @param repository Required. The repository to create. + * @param repositoryId Required. The ID to use for the repository, which will become the final + * component of the repository's resource name. This ID should be unique in the connection. + * Allows alphanumeric characters and any of -._~%!$&'()*+,;={@literal @}. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createRepositoryAsync( + String parent, Repository repository, String repositoryId) { + CreateRepositoryRequest request = + CreateRepositoryRequest.newBuilder() + .setParent(parent) + .setRepository(repository) + .setRepositoryId(repositoryId) + .build(); + return createRepositoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   CreateRepositoryRequest request =
+   *       CreateRepositoryRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setRepository(Repository.newBuilder().build())
+   *           .setRepositoryId("repositoryId2113747461")
+   *           .build();
+   *   Repository response = repositoryManagerClient.createRepositoryAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createRepositoryAsync( + CreateRepositoryRequest request) { + return createRepositoryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   CreateRepositoryRequest request =
+   *       CreateRepositoryRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setRepository(Repository.newBuilder().build())
+   *           .setRepositoryId("repositoryId2113747461")
+   *           .build();
+   *   OperationFuture future =
+   *       repositoryManagerClient.createRepositoryOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Repository response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createRepositoryOperationCallable() { + return stub.createRepositoryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   CreateRepositoryRequest request =
+   *       CreateRepositoryRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setRepository(Repository.newBuilder().build())
+   *           .setRepositoryId("repositoryId2113747461")
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.createRepositoryCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createRepositoryCallable() { + return stub.createRepositoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates multiple repositories inside a connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List requests = new ArrayList<>();
+   *   BatchCreateRepositoriesResponse response =
+   *       repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get();
+   * }
+   * }
+ * + * @param parent Required. The connection to contain all the repositories being created. Format: + * projects/*/locations/*/connections/* The parent field in the + * CreateRepositoryRequest messages must either be empty or match this field. + * @param requests Required. The request messages specifying the repositories to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchCreateRepositoriesAsync(ConnectionName parent, List requests) { + BatchCreateRepositoriesRequest request = + BatchCreateRepositoriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .addAllRequests(requests) + .build(); + return batchCreateRepositoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates multiple repositories inside a connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
+   *   List requests = new ArrayList<>();
+   *   BatchCreateRepositoriesResponse response =
+   *       repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get();
+   * }
+   * }
+ * + * @param parent Required. The connection to contain all the repositories being created. Format: + * projects/*/locations/*/connections/* The parent field in the + * CreateRepositoryRequest messages must either be empty or match this field. + * @param requests Required. The request messages specifying the repositories to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + batchCreateRepositoriesAsync(String parent, List requests) { + BatchCreateRepositoriesRequest request = + BatchCreateRepositoriesRequest.newBuilder() + .setParent(parent) + .addAllRequests(requests) + .build(); + return batchCreateRepositoriesAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates multiple repositories inside a connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   BatchCreateRepositoriesRequest request =
+   *       BatchCreateRepositoriesRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   BatchCreateRepositoriesResponse response =
+   *       repositoryManagerClient.batchCreateRepositoriesAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture + batchCreateRepositoriesAsync(BatchCreateRepositoriesRequest request) { + return batchCreateRepositoriesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates multiple repositories inside a connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   BatchCreateRepositoriesRequest request =
+   *       BatchCreateRepositoriesRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   OperationFuture future =
+   *       repositoryManagerClient.batchCreateRepositoriesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   BatchCreateRepositoriesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable() { + return stub.batchCreateRepositoriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates multiple repositories inside a connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   BatchCreateRepositoriesRequest request =
+   *       BatchCreateRepositoriesRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .addAllRequests(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.batchCreateRepositoriesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + batchCreateRepositoriesCallable() { + return stub.batchCreateRepositoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   RepositoryName name =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
+   *   Repository response = repositoryManagerClient.getRepository(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Repository to retrieve. Format: + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Repository getRepository(RepositoryName name) { + GetRepositoryRequest request = + GetRepositoryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRepository(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String name =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
+   *   Repository response = repositoryManagerClient.getRepository(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Repository to retrieve. Format: + * `projects/*/locations/*/connections/*/repositories/*`. + * @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 details of a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   GetRepositoryRequest request =
+   *       GetRepositoryRequest.newBuilder()
+   *           .setName(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .build();
+   *   Repository response = repositoryManagerClient.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 details of a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   GetRepositoryRequest request =
+   *       GetRepositoryRequest.newBuilder()
+   *           .setName(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.getRepositoryCallable().futureCall(request);
+   *   // Do something.
+   *   Repository response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getRepositoryCallable() { + return stub.getRepositoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Repositories in a given connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   for (Repository element : repositoryManagerClient.listRepositories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of Repositories. Format: + * `projects/*/locations/*/connections/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRepositoriesPagedResponse listRepositories(ConnectionName parent) { + ListRepositoriesRequest request = + ListRepositoriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listRepositories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Repositories in a given connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
+   *   for (Repository element : repositoryManagerClient.listRepositories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of Repositories. Format: + * `projects/*/locations/*/connections/*`. + * @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 in a given connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ListRepositoriesRequest request =
+   *       ListRepositoriesRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Repository element : repositoryManagerClient.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 in a given connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ListRepositoriesRequest request =
+   *       ListRepositoriesRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.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 in a given connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   ListRepositoriesRequest request =
+   *       ListRepositoriesRequest.newBuilder()
+   *           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListRepositoriesResponse response =
+   *         repositoryManagerClient.listRepositoriesCallable().call(request);
+   *     for (Repository element : response.getRepositoriesList()) {
+   *       // 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. + /** + * Deletes a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   RepositoryName name =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
+   *   repositoryManagerClient.deleteRepositoryAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the Repository to delete. Format: + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteRepositoryAsync( + RepositoryName name) { + DeleteRepositoryRequest request = + DeleteRepositoryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteRepositoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String name =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
+   *   repositoryManagerClient.deleteRepositoryAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the Repository to delete. Format: + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteRepositoryAsync(String name) { + DeleteRepositoryRequest request = DeleteRepositoryRequest.newBuilder().setName(name).build(); + return deleteRepositoryAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   DeleteRepositoryRequest request =
+   *       DeleteRepositoryRequest.newBuilder()
+   *           .setName(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   repositoryManagerClient.deleteRepositoryAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deleteRepositoryAsync( + DeleteRepositoryRequest request) { + return deleteRepositoryOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   DeleteRepositoryRequest request =
+   *       DeleteRepositoryRequest.newBuilder()
+   *           .setName(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       repositoryManagerClient.deleteRepositoryOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteRepositoryOperationCallable() { + return stub.deleteRepositoryOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   DeleteRepositoryRequest request =
+   *       DeleteRepositoryRequest.newBuilder()
+   *           .setName(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.deleteRepositoryCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteRepositoryCallable() { + return stub.deleteRepositoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read/write token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   RepositoryName repository =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
+   *   FetchReadWriteTokenResponse response =
+   *       repositoryManagerClient.fetchReadWriteToken(repository);
+   * }
+   * }
+ * + * @param repository Required. The resource name of the repository in the format + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FetchReadWriteTokenResponse fetchReadWriteToken(RepositoryName repository) { + FetchReadWriteTokenRequest request = + FetchReadWriteTokenRequest.newBuilder() + .setRepository(repository == null ? null : repository.toString()) + .build(); + return fetchReadWriteToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read/write token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String repository =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
+   *   FetchReadWriteTokenResponse response =
+   *       repositoryManagerClient.fetchReadWriteToken(repository);
+   * }
+   * }
+ * + * @param repository Required. The resource name of the repository in the format + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FetchReadWriteTokenResponse fetchReadWriteToken(String repository) { + FetchReadWriteTokenRequest request = + FetchReadWriteTokenRequest.newBuilder().setRepository(repository).build(); + return fetchReadWriteToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read/write token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchReadWriteTokenRequest request =
+   *       FetchReadWriteTokenRequest.newBuilder()
+   *           .setRepository(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .build();
+   *   FetchReadWriteTokenResponse response = repositoryManagerClient.fetchReadWriteToken(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 FetchReadWriteTokenResponse fetchReadWriteToken(FetchReadWriteTokenRequest request) { + return fetchReadWriteTokenCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read/write token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchReadWriteTokenRequest request =
+   *       FetchReadWriteTokenRequest.newBuilder()
+   *           .setRepository(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.fetchReadWriteTokenCallable().futureCall(request);
+   *   // Do something.
+   *   FetchReadWriteTokenResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + fetchReadWriteTokenCallable() { + return stub.fetchReadWriteTokenCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   RepositoryName repository =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
+   *   FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(repository);
+   * }
+   * }
+ * + * @param repository Required. The resource name of the repository in the format + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FetchReadTokenResponse fetchReadToken(RepositoryName repository) { + FetchReadTokenRequest request = + FetchReadTokenRequest.newBuilder() + .setRepository(repository == null ? null : repository.toString()) + .build(); + return fetchReadToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   String repository =
+   *       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
+   *   FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(repository);
+   * }
+   * }
+ * + * @param repository Required. The resource name of the repository in the format + * `projects/*/locations/*/connections/*/repositories/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FetchReadTokenResponse fetchReadToken(String repository) { + FetchReadTokenRequest request = + FetchReadTokenRequest.newBuilder().setRepository(repository).build(); + return fetchReadToken(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchReadTokenRequest request =
+   *       FetchReadTokenRequest.newBuilder()
+   *           .setRepository(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .build();
+   *   FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(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 FetchReadTokenResponse fetchReadToken(FetchReadTokenRequest request) { + return fetchReadTokenCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches read token of a given repository. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchReadTokenRequest request =
+   *       FetchReadTokenRequest.newBuilder()
+   *           .setRepository(
+   *               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.fetchReadTokenCallable().futureCall(request);
+   *   // Do something.
+   *   FetchReadTokenResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + fetchReadTokenCallable() { + return stub.fetchReadTokenCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * FetchLinkableRepositories get repositories from SCM that are accessible and could be added to + * the connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchLinkableRepositoriesRequest request =
+   *       FetchLinkableRepositoriesRequest.newBuilder()
+   *           .setConnection(
+   *               ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Repository element :
+   *       repositoryManagerClient.fetchLinkableRepositories(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 FetchLinkableRepositoriesPagedResponse fetchLinkableRepositories( + FetchLinkableRepositoriesRequest request) { + return fetchLinkableRepositoriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * FetchLinkableRepositories get repositories from SCM that are accessible and could be added to + * the connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchLinkableRepositoriesRequest request =
+   *       FetchLinkableRepositoriesRequest.newBuilder()
+   *           .setConnection(
+   *               ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.fetchLinkableRepositoriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Repository element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesPagedCallable() { + return stub.fetchLinkableRepositoriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * FetchLinkableRepositories get repositories from SCM that are accessible and could be added to + * the connection. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   FetchLinkableRepositoriesRequest request =
+   *       FetchLinkableRepositoriesRequest.newBuilder()
+   *           .setConnection(
+   *               ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     FetchLinkableRepositoriesResponse response =
+   *         repositoryManagerClient.fetchLinkableRepositoriesCallable().call(request);
+   *     for (Repository element : response.getRepositoriesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + fetchLinkableRepositoriesCallable() { + return stub.fetchLinkableRepositoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = repositoryManagerClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = repositoryManagerClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = repositoryManagerClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = repositoryManagerClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = repositoryManagerClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       repositoryManagerClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListConnectionsPagedResponse + extends AbstractPagedListResponse< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListConnectionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListConnectionsPagedResponse(ListConnectionsPage page) { + super(page, ListConnectionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConnectionsPage + extends AbstractPage< + ListConnectionsRequest, ListConnectionsResponse, Connection, ListConnectionsPage> { + + private ListConnectionsPage( + PageContext context, + ListConnectionsResponse response) { + super(context, response); + } + + private static ListConnectionsPage createEmptyPage() { + return new ListConnectionsPage(null, null); + } + + @Override + protected ListConnectionsPage createPage( + PageContext context, + ListConnectionsResponse response) { + return new ListConnectionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConnectionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + private ListConnectionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConnectionsFixedSizeCollection createEmptyCollection() { + return new ListConnectionsFixedSizeCollection(null, 0); + } + + @Override + protected ListConnectionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConnectionsFixedSizeCollection(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); + } + } + + public static class FetchLinkableRepositoriesPagedResponse + extends AbstractPagedListResponse< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + Repository, + FetchLinkableRepositoriesPage, + FetchLinkableRepositoriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + FetchLinkableRepositoriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new FetchLinkableRepositoriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private FetchLinkableRepositoriesPagedResponse(FetchLinkableRepositoriesPage page) { + super(page, FetchLinkableRepositoriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class FetchLinkableRepositoriesPage + extends AbstractPage< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + Repository, + FetchLinkableRepositoriesPage> { + + private FetchLinkableRepositoriesPage( + PageContext + context, + FetchLinkableRepositoriesResponse response) { + super(context, response); + } + + private static FetchLinkableRepositoriesPage createEmptyPage() { + return new FetchLinkableRepositoriesPage(null, null); + } + + @Override + protected FetchLinkableRepositoriesPage createPage( + PageContext + context, + FetchLinkableRepositoriesResponse response) { + return new FetchLinkableRepositoriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class FetchLinkableRepositoriesFixedSizeCollection + extends AbstractFixedSizeCollection< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + Repository, + FetchLinkableRepositoriesPage, + FetchLinkableRepositoriesFixedSizeCollection> { + + private FetchLinkableRepositoriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static FetchLinkableRepositoriesFixedSizeCollection createEmptyCollection() { + return new FetchLinkableRepositoriesFixedSizeCollection(null, 0); + } + + @Override + protected FetchLinkableRepositoriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new FetchLinkableRepositoriesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerSettings.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerSettings.java new file mode 100644 index 000000000000..6f3a3e25d24e --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerSettings.java @@ -0,0 +1,471 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.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.httpjson.InstantiatingHttpJsonChannelProvider; +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.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.stub.RepositoryManagerStubSettings; +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 RepositoryManagerClient}. + * + *

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

    + *
  • The default service address (cloudbuild.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 getConnection to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RepositoryManagerSettings.Builder repositoryManagerSettingsBuilder =
+ *     RepositoryManagerSettings.newBuilder();
+ * repositoryManagerSettingsBuilder
+ *     .getConnectionSettings()
+ *     .setRetrySettings(
+ *         repositoryManagerSettingsBuilder
+ *             .getConnectionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RepositoryManagerSettings repositoryManagerSettings = repositoryManagerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RepositoryManagerSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).createConnectionSettings(); + } + + /** Returns the object with the settings used for calls to createConnection. */ + public OperationCallSettings + createConnectionOperationSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).createConnectionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).getConnectionSettings(); + } + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).listConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).updateConnectionSettings(); + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public OperationCallSettings + updateConnectionOperationSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).updateConnectionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).deleteConnectionSettings(); + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public OperationCallSettings + deleteConnectionOperationSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).deleteConnectionOperationSettings(); + } + + /** Returns the object with the settings used for calls to createRepository. */ + public UnaryCallSettings createRepositorySettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).createRepositorySettings(); + } + + /** Returns the object with the settings used for calls to createRepository. */ + public OperationCallSettings + createRepositoryOperationSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).createRepositoryOperationSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateRepositories. */ + public UnaryCallSettings + batchCreateRepositoriesSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).batchCreateRepositoriesSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateRepositories. */ + public OperationCallSettings< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()) + .batchCreateRepositoriesOperationSettings(); + } + + /** Returns the object with the settings used for calls to getRepository. */ + public UnaryCallSettings getRepositorySettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).getRepositorySettings(); + } + + /** Returns the object with the settings used for calls to listRepositories. */ + public PagedCallSettings< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).listRepositoriesSettings(); + } + + /** Returns the object with the settings used for calls to deleteRepository. */ + public UnaryCallSettings deleteRepositorySettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).deleteRepositorySettings(); + } + + /** Returns the object with the settings used for calls to deleteRepository. */ + public OperationCallSettings + deleteRepositoryOperationSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).deleteRepositoryOperationSettings(); + } + + /** Returns the object with the settings used for calls to fetchReadWriteToken. */ + public UnaryCallSettings + fetchReadWriteTokenSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).fetchReadWriteTokenSettings(); + } + + /** Returns the object with the settings used for calls to fetchReadToken. */ + public UnaryCallSettings fetchReadTokenSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).fetchReadTokenSettings(); + } + + /** Returns the object with the settings used for calls to fetchLinkableRepositories. */ + public PagedCallSettings< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).fetchLinkableRepositoriesSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((RepositoryManagerStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final RepositoryManagerSettings create(RepositoryManagerStubSettings stub) + throws IOException { + return new RepositoryManagerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RepositoryManagerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RepositoryManagerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RepositoryManagerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RepositoryManagerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RepositoryManagerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RepositoryManagerStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RepositoryManagerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RepositoryManagerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RepositoryManagerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RepositoryManagerSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RepositoryManagerStubSettings.newBuilder(clientContext)); + } + + protected Builder(RepositoryManagerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RepositoryManagerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RepositoryManagerStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(RepositoryManagerStubSettings.newHttpJsonBuilder()); + } + + public RepositoryManagerStubSettings.Builder getStubSettingsBuilder() { + return ((RepositoryManagerStubSettings.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 createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return getStubSettingsBuilder().createConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to createConnection. */ + public OperationCallSettings.Builder + createConnectionOperationSettings() { + return getStubSettingsBuilder().createConnectionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getStubSettingsBuilder().getConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return getStubSettingsBuilder().listConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return getStubSettingsBuilder().updateConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public OperationCallSettings.Builder + updateConnectionOperationSettings() { + return getStubSettingsBuilder().updateConnectionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder + deleteConnectionSettings() { + return getStubSettingsBuilder().deleteConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public OperationCallSettings.Builder + deleteConnectionOperationSettings() { + return getStubSettingsBuilder().deleteConnectionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createRepository. */ + public UnaryCallSettings.Builder + createRepositorySettings() { + return getStubSettingsBuilder().createRepositorySettings(); + } + + /** Returns the builder for the settings used for calls to createRepository. */ + public OperationCallSettings.Builder + createRepositoryOperationSettings() { + return getStubSettingsBuilder().createRepositoryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateRepositories. */ + public UnaryCallSettings.Builder + batchCreateRepositoriesSettings() { + return getStubSettingsBuilder().batchCreateRepositoriesSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateRepositories. */ + public OperationCallSettings.Builder< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationSettings() { + return getStubSettingsBuilder().batchCreateRepositoriesOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getRepository. */ + public UnaryCallSettings.Builder getRepositorySettings() { + return getStubSettingsBuilder().getRepositorySettings(); + } + + /** 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 deleteRepository. */ + public UnaryCallSettings.Builder + deleteRepositorySettings() { + return getStubSettingsBuilder().deleteRepositorySettings(); + } + + /** Returns the builder for the settings used for calls to deleteRepository. */ + public OperationCallSettings.Builder + deleteRepositoryOperationSettings() { + return getStubSettingsBuilder().deleteRepositoryOperationSettings(); + } + + /** Returns the builder for the settings used for calls to fetchReadWriteToken. */ + public UnaryCallSettings.Builder + fetchReadWriteTokenSettings() { + return getStubSettingsBuilder().fetchReadWriteTokenSettings(); + } + + /** Returns the builder for the settings used for calls to fetchReadToken. */ + public UnaryCallSettings.Builder + fetchReadTokenSettings() { + return getStubSettingsBuilder().fetchReadTokenSettings(); + } + + /** Returns the builder for the settings used for calls to fetchLinkableRepositories. */ + public PagedCallSettings.Builder< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesSettings() { + return getStubSettingsBuilder().fetchLinkableRepositoriesSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public RepositoryManagerSettings build() throws IOException { + return new RepositoryManagerSettings(this); + } + } +} diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/gapic_metadata.json b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/gapic_metadata.json new file mode 100644 index 000000000000..9827651295e2 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/gapic_metadata.json @@ -0,0 +1,66 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.devtools.cloudbuild.v2", + "libraryPackage": "google.devtools.cloudbuild.v2", + "services": { + "RepositoryManager": { + "clients": { + "grpc": { + "libraryClient": "RepositoryManagerClient", + "rpcs": { + "BatchCreateRepositories": { + "methods": ["batchCreateRepositoriesAsync", "batchCreateRepositoriesAsync", "batchCreateRepositoriesAsync", "batchCreateRepositoriesOperationCallable", "batchCreateRepositoriesCallable"] + }, + "CreateConnection": { + "methods": ["createConnectionAsync", "createConnectionAsync", "createConnectionAsync", "createConnectionOperationCallable", "createConnectionCallable"] + }, + "CreateRepository": { + "methods": ["createRepositoryAsync", "createRepositoryAsync", "createRepositoryAsync", "createRepositoryOperationCallable", "createRepositoryCallable"] + }, + "DeleteConnection": { + "methods": ["deleteConnectionAsync", "deleteConnectionAsync", "deleteConnectionAsync", "deleteConnectionOperationCallable", "deleteConnectionCallable"] + }, + "DeleteRepository": { + "methods": ["deleteRepositoryAsync", "deleteRepositoryAsync", "deleteRepositoryAsync", "deleteRepositoryOperationCallable", "deleteRepositoryCallable"] + }, + "FetchLinkableRepositories": { + "methods": ["fetchLinkableRepositories", "fetchLinkableRepositoriesPagedCallable", "fetchLinkableRepositoriesCallable"] + }, + "FetchReadToken": { + "methods": ["fetchReadToken", "fetchReadToken", "fetchReadToken", "fetchReadTokenCallable"] + }, + "FetchReadWriteToken": { + "methods": ["fetchReadWriteToken", "fetchReadWriteToken", "fetchReadWriteToken", "fetchReadWriteTokenCallable"] + }, + "GetConnection": { + "methods": ["getConnection", "getConnection", "getConnection", "getConnectionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetRepository": { + "methods": ["getRepository", "getRepository", "getRepository", "getRepositoryCallable"] + }, + "ListConnections": { + "methods": ["listConnections", "listConnections", "listConnections", "listConnectionsPagedCallable", "listConnectionsCallable"] + }, + "ListRepositories": { + "methods": ["listRepositories", "listRepositories", "listRepositories", "listRepositoriesPagedCallable", "listRepositoriesCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateConnection": { + "methods": ["updateConnectionAsync", "updateConnectionAsync", "updateConnectionOperationCallable", "updateConnectionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/package-info.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/package-info.java new file mode 100644 index 000000000000..9a2588e4c7f0 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Build API + * + *

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

======================= RepositoryManagerClient ======================= + * + *

Service Description: Manages connections to source code repostiories. + * + *

Sample for RepositoryManagerClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
+ *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+ *   Connection response = repositoryManagerClient.getConnection(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package google.devtools.cloudbuild.v2; + +import javax.annotation.Generated; diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/GrpcRepositoryManagerCallableFactory.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/GrpcRepositoryManagerCallableFactory.java new file mode 100644 index 000000000000..7b968175f3f5 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/GrpcRepositoryManagerCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.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 RepositoryManager service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcRepositoryManagerCallableFactory 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/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/GrpcRepositoryManagerStub.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/GrpcRepositoryManagerStub.java new file mode 100644 index 000000000000..b84035f8a8da --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/GrpcRepositoryManagerStub.java @@ -0,0 +1,785 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.stub; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.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.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse; +import google.devtools.cloudbuild.v2.FetchReadTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.GetConnectionRequest; +import google.devtools.cloudbuild.v2.GetRepositoryRequest; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.ListConnectionsResponse; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.ListRepositoriesResponse; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; +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 RepositoryManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcRepositoryManagerStub extends RepositoryManagerStub { + private static final MethodDescriptor + createConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/CreateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/GetConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/ListConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConnectionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/UpdateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/DeleteConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createRepositoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/CreateRepository") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateRepositoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + batchCreateRepositoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchCreateRepositoriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getRepositoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/GetRepository") + .setRequestMarshaller( + ProtoUtils.marshaller(GetRepositoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Repository.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRepositoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/ListRepositories") + .setRequestMarshaller( + ProtoUtils.marshaller(ListRepositoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRepositoriesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteRepositoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/DeleteRepository") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteRepositoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + fetchReadWriteTokenMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.cloudbuild.v2.RepositoryManager/FetchReadWriteToken") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchReadWriteTokenRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FetchReadWriteTokenResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + fetchReadTokenMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/FetchReadToken") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchReadTokenRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FetchReadTokenResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesResponse> + fetchLinkableRepositoriesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchLinkableRepositoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FetchLinkableRepositoriesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable createConnectionCallable; + private final OperationCallable + createConnectionOperationCallable; + private final UnaryCallable getConnectionCallable; + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable + listConnectionsPagedCallable; + private final UnaryCallable updateConnectionCallable; + private final OperationCallable + updateConnectionOperationCallable; + private final UnaryCallable deleteConnectionCallable; + private final OperationCallable + deleteConnectionOperationCallable; + private final UnaryCallable createRepositoryCallable; + private final OperationCallable + createRepositoryOperationCallable; + private final UnaryCallable + batchCreateRepositoriesCallable; + private final OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable; + private final UnaryCallable getRepositoryCallable; + private final UnaryCallable + listRepositoriesCallable; + private final UnaryCallable + listRepositoriesPagedCallable; + private final UnaryCallable deleteRepositoryCallable; + private final OperationCallable + deleteRepositoryOperationCallable; + private final UnaryCallable + fetchReadWriteTokenCallable; + private final UnaryCallable fetchReadTokenCallable; + private final UnaryCallable + fetchLinkableRepositoriesCallable; + private final UnaryCallable< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRepositoryManagerStub create(RepositoryManagerStubSettings settings) + throws IOException { + return new GrpcRepositoryManagerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRepositoryManagerStub create(ClientContext clientContext) + throws IOException { + return new GrpcRepositoryManagerStub( + RepositoryManagerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRepositoryManagerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRepositoryManagerStub( + RepositoryManagerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRepositoryManagerStub, 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 GrpcRepositoryManagerStub( + RepositoryManagerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcRepositoryManagerCallableFactory()); + } + + /** + * Constructs an instance of GrpcRepositoryManagerStub, 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 GrpcRepositoryManagerStub( + RepositoryManagerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("connection.name", String.valueOf(request.getConnection().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConnectionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createRepositoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRepositoryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + batchCreateRepositoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchCreateRepositoriesMethodDescriptor) + .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(); + 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 deleteRepositoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRepositoryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + fetchReadWriteTokenTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchReadWriteTokenMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("repository", String.valueOf(request.getRepository())); + return params.build(); + }) + .build(); + GrpcCallSettings + fetchReadTokenTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchReadTokenMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("repository", String.valueOf(request.getRepository())); + return params.build(); + }) + .build(); + GrpcCallSettings + fetchLinkableRepositoriesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(fetchLinkableRepositoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("connection", String.valueOf(request.getConnection())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.createConnectionCallable = + callableFactory.createUnaryCallable( + createConnectionTransportSettings, settings.createConnectionSettings(), clientContext); + this.createConnectionOperationCallable = + callableFactory.createOperationCallable( + createConnectionTransportSettings, + settings.createConnectionOperationSettings(), + clientContext, + operationsStub); + this.getConnectionCallable = + callableFactory.createUnaryCallable( + getConnectionTransportSettings, settings.getConnectionSettings(), clientContext); + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.listConnectionsPagedCallable = + callableFactory.createPagedCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.updateConnectionCallable = + callableFactory.createUnaryCallable( + updateConnectionTransportSettings, settings.updateConnectionSettings(), clientContext); + this.updateConnectionOperationCallable = + callableFactory.createOperationCallable( + updateConnectionTransportSettings, + settings.updateConnectionOperationSettings(), + clientContext, + operationsStub); + this.deleteConnectionCallable = + callableFactory.createUnaryCallable( + deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext); + this.deleteConnectionOperationCallable = + callableFactory.createOperationCallable( + deleteConnectionTransportSettings, + settings.deleteConnectionOperationSettings(), + clientContext, + operationsStub); + this.createRepositoryCallable = + callableFactory.createUnaryCallable( + createRepositoryTransportSettings, settings.createRepositorySettings(), clientContext); + this.createRepositoryOperationCallable = + callableFactory.createOperationCallable( + createRepositoryTransportSettings, + settings.createRepositoryOperationSettings(), + clientContext, + operationsStub); + this.batchCreateRepositoriesCallable = + callableFactory.createUnaryCallable( + batchCreateRepositoriesTransportSettings, + settings.batchCreateRepositoriesSettings(), + clientContext); + this.batchCreateRepositoriesOperationCallable = + callableFactory.createOperationCallable( + batchCreateRepositoriesTransportSettings, + settings.batchCreateRepositoriesOperationSettings(), + clientContext, + operationsStub); + this.getRepositoryCallable = + callableFactory.createUnaryCallable( + getRepositoryTransportSettings, settings.getRepositorySettings(), clientContext); + this.listRepositoriesCallable = + callableFactory.createUnaryCallable( + listRepositoriesTransportSettings, settings.listRepositoriesSettings(), clientContext); + this.listRepositoriesPagedCallable = + callableFactory.createPagedCallable( + listRepositoriesTransportSettings, settings.listRepositoriesSettings(), clientContext); + this.deleteRepositoryCallable = + callableFactory.createUnaryCallable( + deleteRepositoryTransportSettings, settings.deleteRepositorySettings(), clientContext); + this.deleteRepositoryOperationCallable = + callableFactory.createOperationCallable( + deleteRepositoryTransportSettings, + settings.deleteRepositoryOperationSettings(), + clientContext, + operationsStub); + this.fetchReadWriteTokenCallable = + callableFactory.createUnaryCallable( + fetchReadWriteTokenTransportSettings, + settings.fetchReadWriteTokenSettings(), + clientContext); + this.fetchReadTokenCallable = + callableFactory.createUnaryCallable( + fetchReadTokenTransportSettings, settings.fetchReadTokenSettings(), clientContext); + this.fetchLinkableRepositoriesCallable = + callableFactory.createUnaryCallable( + fetchLinkableRepositoriesTransportSettings, + settings.fetchLinkableRepositoriesSettings(), + clientContext); + this.fetchLinkableRepositoriesPagedCallable = + callableFactory.createPagedCallable( + fetchLinkableRepositoriesTransportSettings, + settings.fetchLinkableRepositoriesSettings(), + clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createConnectionCallable() { + return createConnectionCallable; + } + + @Override + public OperationCallable + createConnectionOperationCallable() { + return createConnectionOperationCallable; + } + + @Override + public UnaryCallable getConnectionCallable() { + return getConnectionCallable; + } + + @Override + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + @Override + public UnaryCallable + listConnectionsPagedCallable() { + return listConnectionsPagedCallable; + } + + @Override + public UnaryCallable updateConnectionCallable() { + return updateConnectionCallable; + } + + @Override + public OperationCallable + updateConnectionOperationCallable() { + return updateConnectionOperationCallable; + } + + @Override + public UnaryCallable deleteConnectionCallable() { + return deleteConnectionCallable; + } + + @Override + public OperationCallable + deleteConnectionOperationCallable() { + return deleteConnectionOperationCallable; + } + + @Override + public UnaryCallable createRepositoryCallable() { + return createRepositoryCallable; + } + + @Override + public OperationCallable + createRepositoryOperationCallable() { + return createRepositoryOperationCallable; + } + + @Override + public UnaryCallable + batchCreateRepositoriesCallable() { + return batchCreateRepositoriesCallable; + } + + @Override + public OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable() { + return batchCreateRepositoriesOperationCallable; + } + + @Override + public UnaryCallable getRepositoryCallable() { + return getRepositoryCallable; + } + + @Override + public UnaryCallable + listRepositoriesCallable() { + return listRepositoriesCallable; + } + + @Override + public UnaryCallable + listRepositoriesPagedCallable() { + return listRepositoriesPagedCallable; + } + + @Override + public UnaryCallable deleteRepositoryCallable() { + return deleteRepositoryCallable; + } + + @Override + public OperationCallable + deleteRepositoryOperationCallable() { + return deleteRepositoryOperationCallable; + } + + @Override + public UnaryCallable + fetchReadWriteTokenCallable() { + return fetchReadWriteTokenCallable; + } + + @Override + public UnaryCallable fetchReadTokenCallable() { + return fetchReadTokenCallable; + } + + @Override + public UnaryCallable + fetchLinkableRepositoriesCallable() { + return fetchLinkableRepositoriesCallable; + } + + @Override + public UnaryCallable + fetchLinkableRepositoriesPagedCallable() { + return fetchLinkableRepositoriesPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/HttpJsonRepositoryManagerCallableFactory.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/HttpJsonRepositoryManagerCallableFactory.java new file mode 100644 index 000000000000..e0a84a309369 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/HttpJsonRepositoryManagerCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the RepositoryManager service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRepositoryManagerCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/HttpJsonRepositoryManagerStub.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/HttpJsonRepositoryManagerStub.java new file mode 100644 index 000000000000..da47dd13fc99 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/HttpJsonRepositoryManagerStub.java @@ -0,0 +1,1194 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.stub; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListRepositoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse; +import google.devtools.cloudbuild.v2.FetchReadTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.GetConnectionRequest; +import google.devtools.cloudbuild.v2.GetRepositoryRequest; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.ListConnectionsResponse; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.ListRepositoriesResponse; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the RepositoryManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRepositoryManagerStub extends RepositoryManagerStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Repository.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(BatchCreateRepositoriesResponse.getDescriptor()) + .add(Connection.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/CreateConnection") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/connections", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "connectionId", request.getConnectionId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("connection", request.getConnection(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateConnectionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/GetConnection") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/connections/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Connection.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listConnectionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/ListConnections") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/connections", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListConnectionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/UpdateConnection") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{connection.name=projects/*/locations/*/connections/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "connection.name", request.getConnection().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("connection", request.getConnection(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateConnectionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/DeleteConnection") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/connections/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteConnectionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createRepositoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/CreateRepository") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*/connections/*}/repositories", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "repositoryId", request.getRepositoryId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("repository", request.getRepository(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateRepositoryRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + batchCreateRepositoriesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*/connections/*}/repositories:batchCreate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (BatchCreateRepositoriesRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getRepositoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/GetRepository") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/connections/*/repositories/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Repository.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRepositoriesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/ListRepositories") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*/connections/*}/repositories", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRepositoriesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteRepositoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/DeleteRepository") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/connections/*/repositories/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteRepositoryRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + fetchReadWriteTokenMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.devtools.cloudbuild.v2.RepositoryManager/FetchReadWriteToken") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{repository=projects/*/locations/*/connections/*/repositories/*}:accessReadWriteToken", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "repository", request.getRepository()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearRepository().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchReadWriteTokenResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + fetchReadTokenMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.devtools.cloudbuild.v2.RepositoryManager/FetchReadToken") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{repository=projects/*/locations/*/connections/*/repositories/*}:accessReadToken", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "repository", request.getRepository()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearRepository().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchReadTokenResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesResponse> + fetchLinkableRepositoriesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{connection=projects/*/locations/*/connections/*}:fetchLinkableRepositories", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "connection", request.getConnection()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FetchLinkableRepositoriesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{resource=projects/*/locations/*/connections/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{resource=projects/*/locations/*/connections/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{resource=projects/*/locations/*/connections/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createConnectionCallable; + private final OperationCallable + createConnectionOperationCallable; + private final UnaryCallable getConnectionCallable; + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable + listConnectionsPagedCallable; + private final UnaryCallable updateConnectionCallable; + private final OperationCallable + updateConnectionOperationCallable; + private final UnaryCallable deleteConnectionCallable; + private final OperationCallable + deleteConnectionOperationCallable; + private final UnaryCallable createRepositoryCallable; + private final OperationCallable + createRepositoryOperationCallable; + private final UnaryCallable + batchCreateRepositoriesCallable; + private final OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable; + private final UnaryCallable getRepositoryCallable; + private final UnaryCallable + listRepositoriesCallable; + private final UnaryCallable + listRepositoriesPagedCallable; + private final UnaryCallable deleteRepositoryCallable; + private final OperationCallable + deleteRepositoryOperationCallable; + private final UnaryCallable + fetchReadWriteTokenCallable; + private final UnaryCallable fetchReadTokenCallable; + private final UnaryCallable + fetchLinkableRepositoriesCallable; + private final UnaryCallable< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRepositoryManagerStub create(RepositoryManagerStubSettings settings) + throws IOException { + return new HttpJsonRepositoryManagerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRepositoryManagerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRepositoryManagerStub( + RepositoryManagerStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRepositoryManagerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRepositoryManagerStub( + RepositoryManagerStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonRepositoryManagerStub, 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 HttpJsonRepositoryManagerStub( + RepositoryManagerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonRepositoryManagerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRepositoryManagerStub, 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 HttpJsonRepositoryManagerStub( + RepositoryManagerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listConnectionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createRepositoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRepositoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + batchCreateRepositoriesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(batchCreateRepositoriesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRepositoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRepositoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listRepositoriesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRepositoriesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteRepositoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRepositoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + fetchReadWriteTokenTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(fetchReadWriteTokenMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + fetchReadTokenTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(fetchReadTokenMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + fetchLinkableRepositoriesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(fetchLinkableRepositoriesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createConnectionCallable = + callableFactory.createUnaryCallable( + createConnectionTransportSettings, settings.createConnectionSettings(), clientContext); + this.createConnectionOperationCallable = + callableFactory.createOperationCallable( + createConnectionTransportSettings, + settings.createConnectionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getConnectionCallable = + callableFactory.createUnaryCallable( + getConnectionTransportSettings, settings.getConnectionSettings(), clientContext); + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.listConnectionsPagedCallable = + callableFactory.createPagedCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.updateConnectionCallable = + callableFactory.createUnaryCallable( + updateConnectionTransportSettings, settings.updateConnectionSettings(), clientContext); + this.updateConnectionOperationCallable = + callableFactory.createOperationCallable( + updateConnectionTransportSettings, + settings.updateConnectionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteConnectionCallable = + callableFactory.createUnaryCallable( + deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext); + this.deleteConnectionOperationCallable = + callableFactory.createOperationCallable( + deleteConnectionTransportSettings, + settings.deleteConnectionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createRepositoryCallable = + callableFactory.createUnaryCallable( + createRepositoryTransportSettings, settings.createRepositorySettings(), clientContext); + this.createRepositoryOperationCallable = + callableFactory.createOperationCallable( + createRepositoryTransportSettings, + settings.createRepositoryOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.batchCreateRepositoriesCallable = + callableFactory.createUnaryCallable( + batchCreateRepositoriesTransportSettings, + settings.batchCreateRepositoriesSettings(), + clientContext); + this.batchCreateRepositoriesOperationCallable = + callableFactory.createOperationCallable( + batchCreateRepositoriesTransportSettings, + settings.batchCreateRepositoriesOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getRepositoryCallable = + callableFactory.createUnaryCallable( + getRepositoryTransportSettings, settings.getRepositorySettings(), clientContext); + this.listRepositoriesCallable = + callableFactory.createUnaryCallable( + listRepositoriesTransportSettings, settings.listRepositoriesSettings(), clientContext); + this.listRepositoriesPagedCallable = + callableFactory.createPagedCallable( + listRepositoriesTransportSettings, settings.listRepositoriesSettings(), clientContext); + this.deleteRepositoryCallable = + callableFactory.createUnaryCallable( + deleteRepositoryTransportSettings, settings.deleteRepositorySettings(), clientContext); + this.deleteRepositoryOperationCallable = + callableFactory.createOperationCallable( + deleteRepositoryTransportSettings, + settings.deleteRepositoryOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.fetchReadWriteTokenCallable = + callableFactory.createUnaryCallable( + fetchReadWriteTokenTransportSettings, + settings.fetchReadWriteTokenSettings(), + clientContext); + this.fetchReadTokenCallable = + callableFactory.createUnaryCallable( + fetchReadTokenTransportSettings, settings.fetchReadTokenSettings(), clientContext); + this.fetchLinkableRepositoriesCallable = + callableFactory.createUnaryCallable( + fetchLinkableRepositoriesTransportSettings, + settings.fetchLinkableRepositoriesSettings(), + clientContext); + this.fetchLinkableRepositoriesPagedCallable = + callableFactory.createPagedCallable( + fetchLinkableRepositoriesTransportSettings, + settings.fetchLinkableRepositoriesSettings(), + clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createConnectionMethodDescriptor); + methodDescriptors.add(getConnectionMethodDescriptor); + methodDescriptors.add(listConnectionsMethodDescriptor); + methodDescriptors.add(updateConnectionMethodDescriptor); + methodDescriptors.add(deleteConnectionMethodDescriptor); + methodDescriptors.add(createRepositoryMethodDescriptor); + methodDescriptors.add(batchCreateRepositoriesMethodDescriptor); + methodDescriptors.add(getRepositoryMethodDescriptor); + methodDescriptors.add(listRepositoriesMethodDescriptor); + methodDescriptors.add(deleteRepositoryMethodDescriptor); + methodDescriptors.add(fetchReadWriteTokenMethodDescriptor); + methodDescriptors.add(fetchReadTokenMethodDescriptor); + methodDescriptors.add(fetchLinkableRepositoriesMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createConnectionCallable() { + return createConnectionCallable; + } + + @Override + public OperationCallable + createConnectionOperationCallable() { + return createConnectionOperationCallable; + } + + @Override + public UnaryCallable getConnectionCallable() { + return getConnectionCallable; + } + + @Override + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + @Override + public UnaryCallable + listConnectionsPagedCallable() { + return listConnectionsPagedCallable; + } + + @Override + public UnaryCallable updateConnectionCallable() { + return updateConnectionCallable; + } + + @Override + public OperationCallable + updateConnectionOperationCallable() { + return updateConnectionOperationCallable; + } + + @Override + public UnaryCallable deleteConnectionCallable() { + return deleteConnectionCallable; + } + + @Override + public OperationCallable + deleteConnectionOperationCallable() { + return deleteConnectionOperationCallable; + } + + @Override + public UnaryCallable createRepositoryCallable() { + return createRepositoryCallable; + } + + @Override + public OperationCallable + createRepositoryOperationCallable() { + return createRepositoryOperationCallable; + } + + @Override + public UnaryCallable + batchCreateRepositoriesCallable() { + return batchCreateRepositoriesCallable; + } + + @Override + public OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable() { + return batchCreateRepositoriesOperationCallable; + } + + @Override + public UnaryCallable getRepositoryCallable() { + return getRepositoryCallable; + } + + @Override + public UnaryCallable + listRepositoriesCallable() { + return listRepositoriesCallable; + } + + @Override + public UnaryCallable + listRepositoriesPagedCallable() { + return listRepositoriesPagedCallable; + } + + @Override + public UnaryCallable deleteRepositoryCallable() { + return deleteRepositoryCallable; + } + + @Override + public OperationCallable + deleteRepositoryOperationCallable() { + return deleteRepositoryOperationCallable; + } + + @Override + public UnaryCallable + fetchReadWriteTokenCallable() { + return fetchReadWriteTokenCallable; + } + + @Override + public UnaryCallable fetchReadTokenCallable() { + return fetchReadTokenCallable; + } + + @Override + public UnaryCallable + fetchLinkableRepositoriesCallable() { + return fetchLinkableRepositoriesCallable; + } + + @Override + public UnaryCallable + fetchLinkableRepositoriesPagedCallable() { + return fetchLinkableRepositoriesPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/RepositoryManagerStub.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/RepositoryManagerStub.java new file mode 100644 index 000000000000..ebfd8f18ee0a --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/RepositoryManagerStub.java @@ -0,0 +1,194 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.stub; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListRepositoriesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse; +import google.devtools.cloudbuild.v2.FetchReadTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.GetConnectionRequest; +import google.devtools.cloudbuild.v2.GetRepositoryRequest; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.ListConnectionsResponse; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.ListRepositoriesResponse; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RepositoryManager service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class RepositoryManagerStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable + createConnectionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createConnectionOperationCallable()"); + } + + public UnaryCallable createConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: createConnectionCallable()"); + } + + public UnaryCallable getConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectionCallable()"); + } + + public UnaryCallable + listConnectionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsPagedCallable()"); + } + + public UnaryCallable listConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsCallable()"); + } + + public OperationCallable + updateConnectionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateConnectionOperationCallable()"); + } + + public UnaryCallable updateConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: updateConnectionCallable()"); + } + + public OperationCallable + deleteConnectionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConnectionOperationCallable()"); + } + + public UnaryCallable deleteConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()"); + } + + public OperationCallable + createRepositoryOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createRepositoryOperationCallable()"); + } + + public UnaryCallable createRepositoryCallable() { + throw new UnsupportedOperationException("Not implemented: createRepositoryCallable()"); + } + + public OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchCreateRepositoriesOperationCallable()"); + } + + public UnaryCallable + batchCreateRepositoriesCallable() { + throw new UnsupportedOperationException("Not implemented: batchCreateRepositoriesCallable()"); + } + + public UnaryCallable getRepositoryCallable() { + throw new UnsupportedOperationException("Not implemented: getRepositoryCallable()"); + } + + public UnaryCallable + listRepositoriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRepositoriesPagedCallable()"); + } + + public UnaryCallable + listRepositoriesCallable() { + throw new UnsupportedOperationException("Not implemented: listRepositoriesCallable()"); + } + + public OperationCallable + deleteRepositoryOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRepositoryOperationCallable()"); + } + + public UnaryCallable deleteRepositoryCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRepositoryCallable()"); + } + + public UnaryCallable + fetchReadWriteTokenCallable() { + throw new UnsupportedOperationException("Not implemented: fetchReadWriteTokenCallable()"); + } + + public UnaryCallable fetchReadTokenCallable() { + throw new UnsupportedOperationException("Not implemented: fetchReadTokenCallable()"); + } + + public UnaryCallable + fetchLinkableRepositoriesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: fetchLinkableRepositoriesPagedCallable()"); + } + + public UnaryCallable + fetchLinkableRepositoriesCallable() { + throw new UnsupportedOperationException("Not implemented: fetchLinkableRepositoriesCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/RepositoryManagerStubSettings.java b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/RepositoryManagerStubSettings.java new file mode 100644 index 000000000000..a01f866ce5e0 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/main/java/google/devtools/cloudbuild/v2/stub/RepositoryManagerStubSettings.java @@ -0,0 +1,1238 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.stub; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.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.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +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.OperationCallSettings; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse; +import google.devtools.cloudbuild.v2.FetchReadTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.GetConnectionRequest; +import google.devtools.cloudbuild.v2.GetRepositoryRequest; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.ListConnectionsResponse; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.ListRepositoriesResponse; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; +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 RepositoryManagerStub}. + * + *

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

    + *
  • The default service address (cloudbuild.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 getConnection to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RepositoryManagerStubSettings.Builder repositoryManagerSettingsBuilder =
+ *     RepositoryManagerStubSettings.newBuilder();
+ * repositoryManagerSettingsBuilder
+ *     .getConnectionSettings()
+ *     .setRetrySettings(
+ *         repositoryManagerSettingsBuilder
+ *             .getConnectionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RepositoryManagerStubSettings repositoryManagerSettings =
+ *     repositoryManagerSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RepositoryManagerStubSettings 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").build(); + + private final UnaryCallSettings createConnectionSettings; + private final OperationCallSettings + createConnectionOperationSettings; + private final UnaryCallSettings getConnectionSettings; + private final PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private final UnaryCallSettings updateConnectionSettings; + private final OperationCallSettings + updateConnectionOperationSettings; + private final UnaryCallSettings deleteConnectionSettings; + private final OperationCallSettings + deleteConnectionOperationSettings; + private final UnaryCallSettings createRepositorySettings; + private final OperationCallSettings + createRepositoryOperationSettings; + private final UnaryCallSettings + batchCreateRepositoriesSettings; + private final OperationCallSettings< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationSettings; + private final UnaryCallSettings getRepositorySettings; + private final PagedCallSettings< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings; + private final UnaryCallSettings deleteRepositorySettings; + private final OperationCallSettings + deleteRepositoryOperationSettings; + private final UnaryCallSettings + fetchReadWriteTokenSettings; + private final UnaryCallSettings + fetchReadTokenSettings; + private final PagedCallSettings< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor< + ListConnectionsRequest, ListConnectionsResponse, Connection> + LIST_CONNECTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConnectionsRequest injectToken( + ListConnectionsRequest payload, String token) { + return ListConnectionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConnectionsRequest injectPageSize( + ListConnectionsRequest payload, int pageSize) { + return ListConnectionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConnectionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConnectionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListConnectionsResponse payload) { + return payload.getConnectionsList() == null + ? ImmutableList.of() + : payload.getConnectionsList(); + } + }; + + 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 PagedListDescriptor< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesResponse, Repository> + FETCH_LINKABLE_REPOSITORIES_PAGE_STR_DESC = + new PagedListDescriptor< + FetchLinkableRepositoriesRequest, FetchLinkableRepositoriesResponse, Repository>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public FetchLinkableRepositoriesRequest injectToken( + FetchLinkableRepositoriesRequest payload, String token) { + return FetchLinkableRepositoriesRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public FetchLinkableRepositoriesRequest injectPageSize( + FetchLinkableRepositoriesRequest payload, int pageSize) { + return FetchLinkableRepositoriesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(FetchLinkableRepositoriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(FetchLinkableRepositoriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + FetchLinkableRepositoriesResponse payload) { + return payload.getRepositoriesList() == null + ? ImmutableList.of() + : payload.getRepositoriesList(); + } + }; + + private static final PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + LIST_CONNECTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConnectionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CONNECTIONS_PAGE_STR_DESC, request, context); + return ListConnectionsPagedResponse.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); + } + }; + + private static final PagedListResponseFactory< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + FETCH_LINKABLE_REPOSITORIES_PAGE_STR_FACT = + new PagedListResponseFactory< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + FetchLinkableRepositoriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + Repository> + pageContext = + PageContext.create( + callable, FETCH_LINKABLE_REPOSITORIES_PAGE_STR_DESC, request, context); + return FetchLinkableRepositoriesPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the object with the settings used for calls to createConnection. */ + public OperationCallSettings + createConnectionOperationSettings() { + return createConnectionOperationSettings; + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public OperationCallSettings + updateConnectionOperationSettings() { + return updateConnectionOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public OperationCallSettings + deleteConnectionOperationSettings() { + return deleteConnectionOperationSettings; + } + + /** Returns the object with the settings used for calls to createRepository. */ + public UnaryCallSettings createRepositorySettings() { + return createRepositorySettings; + } + + /** Returns the object with the settings used for calls to createRepository. */ + public OperationCallSettings + createRepositoryOperationSettings() { + return createRepositoryOperationSettings; + } + + /** Returns the object with the settings used for calls to batchCreateRepositories. */ + public UnaryCallSettings + batchCreateRepositoriesSettings() { + return batchCreateRepositoriesSettings; + } + + /** Returns the object with the settings used for calls to batchCreateRepositories. */ + public OperationCallSettings< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationSettings() { + return batchCreateRepositoriesOperationSettings; + } + + /** Returns the object with the settings used for calls to getRepository. */ + public UnaryCallSettings getRepositorySettings() { + return getRepositorySettings; + } + + /** 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 deleteRepository. */ + public UnaryCallSettings deleteRepositorySettings() { + return deleteRepositorySettings; + } + + /** Returns the object with the settings used for calls to deleteRepository. */ + public OperationCallSettings + deleteRepositoryOperationSettings() { + return deleteRepositoryOperationSettings; + } + + /** Returns the object with the settings used for calls to fetchReadWriteToken. */ + public UnaryCallSettings + fetchReadWriteTokenSettings() { + return fetchReadWriteTokenSettings; + } + + /** Returns the object with the settings used for calls to fetchReadToken. */ + public UnaryCallSettings fetchReadTokenSettings() { + return fetchReadTokenSettings; + } + + /** Returns the object with the settings used for calls to fetchLinkableRepositories. */ + public PagedCallSettings< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesSettings() { + return fetchLinkableRepositoriesSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public RepositoryManagerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRepositoryManagerStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRepositoryManagerStub.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 "cloudbuild.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudbuild.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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RepositoryManagerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RepositoryManagerStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RepositoryManagerStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RepositoryManagerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createConnectionSettings = settingsBuilder.createConnectionSettings().build(); + createConnectionOperationSettings = settingsBuilder.createConnectionOperationSettings().build(); + getConnectionSettings = settingsBuilder.getConnectionSettings().build(); + listConnectionsSettings = settingsBuilder.listConnectionsSettings().build(); + updateConnectionSettings = settingsBuilder.updateConnectionSettings().build(); + updateConnectionOperationSettings = settingsBuilder.updateConnectionOperationSettings().build(); + deleteConnectionSettings = settingsBuilder.deleteConnectionSettings().build(); + deleteConnectionOperationSettings = settingsBuilder.deleteConnectionOperationSettings().build(); + createRepositorySettings = settingsBuilder.createRepositorySettings().build(); + createRepositoryOperationSettings = settingsBuilder.createRepositoryOperationSettings().build(); + batchCreateRepositoriesSettings = settingsBuilder.batchCreateRepositoriesSettings().build(); + batchCreateRepositoriesOperationSettings = + settingsBuilder.batchCreateRepositoriesOperationSettings().build(); + getRepositorySettings = settingsBuilder.getRepositorySettings().build(); + listRepositoriesSettings = settingsBuilder.listRepositoriesSettings().build(); + deleteRepositorySettings = settingsBuilder.deleteRepositorySettings().build(); + deleteRepositoryOperationSettings = settingsBuilder.deleteRepositoryOperationSettings().build(); + fetchReadWriteTokenSettings = settingsBuilder.fetchReadWriteTokenSettings().build(); + fetchReadTokenSettings = settingsBuilder.fetchReadTokenSettings().build(); + fetchLinkableRepositoriesSettings = settingsBuilder.fetchLinkableRepositoriesSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for RepositoryManagerStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createConnectionSettings; + private final OperationCallSettings.Builder< + CreateConnectionRequest, Connection, OperationMetadata> + createConnectionOperationSettings; + private final UnaryCallSettings.Builder getConnectionSettings; + private final PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private final UnaryCallSettings.Builder + updateConnectionSettings; + private final OperationCallSettings.Builder< + UpdateConnectionRequest, Connection, OperationMetadata> + updateConnectionOperationSettings; + private final UnaryCallSettings.Builder + deleteConnectionSettings; + private final OperationCallSettings.Builder + deleteConnectionOperationSettings; + private final UnaryCallSettings.Builder + createRepositorySettings; + private final OperationCallSettings.Builder< + CreateRepositoryRequest, Repository, OperationMetadata> + createRepositoryOperationSettings; + private final UnaryCallSettings.Builder + batchCreateRepositoriesSettings; + private final OperationCallSettings.Builder< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationSettings; + private final UnaryCallSettings.Builder getRepositorySettings; + private final PagedCallSettings.Builder< + ListRepositoriesRequest, ListRepositoriesResponse, ListRepositoriesPagedResponse> + listRepositoriesSettings; + private final UnaryCallSettings.Builder + deleteRepositorySettings; + private final OperationCallSettings.Builder + deleteRepositoryOperationSettings; + private final UnaryCallSettings.Builder + fetchReadWriteTokenSettings; + private final UnaryCallSettings.Builder + fetchReadTokenSettings; + private final PagedCallSettings.Builder< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_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_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createConnectionOperationSettings = OperationCallSettings.newBuilder(); + getConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listConnectionsSettings = PagedCallSettings.newBuilder(LIST_CONNECTIONS_PAGE_STR_FACT); + updateConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateConnectionOperationSettings = OperationCallSettings.newBuilder(); + deleteConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteConnectionOperationSettings = OperationCallSettings.newBuilder(); + createRepositorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createRepositoryOperationSettings = OperationCallSettings.newBuilder(); + batchCreateRepositoriesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchCreateRepositoriesOperationSettings = OperationCallSettings.newBuilder(); + getRepositorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRepositoriesSettings = PagedCallSettings.newBuilder(LIST_REPOSITORIES_PAGE_STR_FACT); + deleteRepositorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRepositoryOperationSettings = OperationCallSettings.newBuilder(); + fetchReadWriteTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + fetchReadTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + fetchLinkableRepositoriesSettings = + PagedCallSettings.newBuilder(FETCH_LINKABLE_REPOSITORIES_PAGE_STR_FACT); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + deleteConnectionSettings, + createRepositorySettings, + batchCreateRepositoriesSettings, + getRepositorySettings, + listRepositoriesSettings, + deleteRepositorySettings, + fetchReadWriteTokenSettings, + fetchReadTokenSettings, + fetchLinkableRepositoriesSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(RepositoryManagerStubSettings settings) { + super(settings); + + createConnectionSettings = settings.createConnectionSettings.toBuilder(); + createConnectionOperationSettings = settings.createConnectionOperationSettings.toBuilder(); + getConnectionSettings = settings.getConnectionSettings.toBuilder(); + listConnectionsSettings = settings.listConnectionsSettings.toBuilder(); + updateConnectionSettings = settings.updateConnectionSettings.toBuilder(); + updateConnectionOperationSettings = settings.updateConnectionOperationSettings.toBuilder(); + deleteConnectionSettings = settings.deleteConnectionSettings.toBuilder(); + deleteConnectionOperationSettings = settings.deleteConnectionOperationSettings.toBuilder(); + createRepositorySettings = settings.createRepositorySettings.toBuilder(); + createRepositoryOperationSettings = settings.createRepositoryOperationSettings.toBuilder(); + batchCreateRepositoriesSettings = settings.batchCreateRepositoriesSettings.toBuilder(); + batchCreateRepositoriesOperationSettings = + settings.batchCreateRepositoriesOperationSettings.toBuilder(); + getRepositorySettings = settings.getRepositorySettings.toBuilder(); + listRepositoriesSettings = settings.listRepositoriesSettings.toBuilder(); + deleteRepositorySettings = settings.deleteRepositorySettings.toBuilder(); + deleteRepositoryOperationSettings = settings.deleteRepositoryOperationSettings.toBuilder(); + fetchReadWriteTokenSettings = settings.fetchReadWriteTokenSettings.toBuilder(); + fetchReadTokenSettings = settings.fetchReadTokenSettings.toBuilder(); + fetchLinkableRepositoriesSettings = settings.fetchLinkableRepositoriesSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + deleteConnectionSettings, + createRepositorySettings, + batchCreateRepositoriesSettings, + getRepositorySettings, + listRepositoriesSettings, + deleteRepositorySettings, + fetchReadWriteTokenSettings, + fetchReadTokenSettings, + fetchLinkableRepositoriesSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createRepositorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .batchCreateRepositoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getRepositorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listRepositoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteRepositorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .fetchReadWriteTokenSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .fetchReadTokenSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .fetchLinkableRepositoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createConnectionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Connection.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateConnectionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Connection.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteConnectionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createRepositoryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Repository.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .batchCreateRepositoriesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + BatchCreateRepositoriesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteRepositoryOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + 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 createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the builder for the settings used for calls to createConnection. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createConnectionOperationSettings() { + return createConnectionOperationSettings; + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateConnectionOperationSettings() { + return updateConnectionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder + deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteConnectionOperationSettings() { + return deleteConnectionOperationSettings; + } + + /** Returns the builder for the settings used for calls to createRepository. */ + public UnaryCallSettings.Builder + createRepositorySettings() { + return createRepositorySettings; + } + + /** Returns the builder for the settings used for calls to createRepository. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createRepositoryOperationSettings() { + return createRepositoryOperationSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateRepositories. */ + public UnaryCallSettings.Builder + batchCreateRepositoriesSettings() { + return batchCreateRepositoriesSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateRepositories. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationSettings() { + return batchCreateRepositoriesOperationSettings; + } + + /** Returns the builder for the settings used for calls to getRepository. */ + public UnaryCallSettings.Builder getRepositorySettings() { + return getRepositorySettings; + } + + /** 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 deleteRepository. */ + public UnaryCallSettings.Builder + deleteRepositorySettings() { + return deleteRepositorySettings; + } + + /** Returns the builder for the settings used for calls to deleteRepository. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteRepositoryOperationSettings() { + return deleteRepositoryOperationSettings; + } + + /** Returns the builder for the settings used for calls to fetchReadWriteToken. */ + public UnaryCallSettings.Builder + fetchReadWriteTokenSettings() { + return fetchReadWriteTokenSettings; + } + + /** Returns the builder for the settings used for calls to fetchReadToken. */ + public UnaryCallSettings.Builder + fetchReadTokenSettings() { + return fetchReadTokenSettings; + } + + /** Returns the builder for the settings used for calls to fetchLinkableRepositories. */ + public PagedCallSettings.Builder< + FetchLinkableRepositoriesRequest, + FetchLinkableRepositoriesResponse, + FetchLinkableRepositoriesPagedResponse> + fetchLinkableRepositoriesSettings() { + return fetchLinkableRepositoriesSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public RepositoryManagerStubSettings build() throws IOException { + return new RepositoryManagerStubSettings(this); + } + } +} diff --git a/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockIAMPolicy.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockIAMPolicy.java new file mode 100644 index 000000000000..1f406c594bc0 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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 MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockIAMPolicyImpl.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockIAMPolicyImpl.java new file mode 100644 index 000000000000..5351e967dc1d --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) 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 TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) 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 SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) 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 GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockLocations.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockLocations.java new file mode 100644 index 000000000000..2e124ea40bc5 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockLocationsImpl.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockLocationsImpl.java new file mode 100644 index 000000000000..1b206bf696b1 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockLocationsImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +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 MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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<>(); + } +} diff --git a/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockRepositoryManager.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockRepositoryManager.java new file mode 100644 index 000000000000..803b54506df7 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockRepositoryManager.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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 MockRepositoryManager implements MockGrpcService { + private final MockRepositoryManagerImpl serviceImpl; + + public MockRepositoryManager() { + serviceImpl = new MockRepositoryManagerImpl(); + } + + @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/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockRepositoryManagerImpl.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockRepositoryManagerImpl.java new file mode 100644 index 000000000000..7f51c937c050 --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/MockRepositoryManagerImpl.java @@ -0,0 +1,336 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import google.devtools.cloudbuild.v2.RepositoryManagerGrpc.RepositoryManagerImplBase; +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 MockRepositoryManagerImpl extends RepositoryManagerImplBase { + private List requests; + private Queue responses; + + public MockRepositoryManagerImpl() { + 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 createConnection( + CreateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 CreateConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getConnection( + GetConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext(((Connection) 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 GetConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Connection.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listConnections( + ListConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListConnectionsResponse) { + requests.add(request); + responseObserver.onNext(((ListConnectionsResponse) 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 ListConnections, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListConnectionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateConnection( + UpdateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 UpdateConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteConnection( + DeleteConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 DeleteConnection, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createRepository( + CreateRepositoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 CreateRepository, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void batchCreateRepositories( + BatchCreateRepositoriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 BatchCreateRepositories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.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()))); + } + } + + @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 deleteRepository( + DeleteRepositoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 DeleteRepository, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void fetchReadWriteToken( + FetchReadWriteTokenRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FetchReadWriteTokenResponse) { + requests.add(request); + responseObserver.onNext(((FetchReadWriteTokenResponse) 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 FetchReadWriteToken, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FetchReadWriteTokenResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void fetchReadToken( + FetchReadTokenRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FetchReadTokenResponse) { + requests.add(request); + responseObserver.onNext(((FetchReadTokenResponse) 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 FetchReadToken, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FetchReadTokenResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void fetchLinkableRepositories( + FetchLinkableRepositoriesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FetchLinkableRepositoriesResponse) { + requests.add(request); + responseObserver.onNext(((FetchLinkableRepositoriesResponse) 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 FetchLinkableRepositories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FetchLinkableRepositoriesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/RepositoryManagerClientHttpJsonTest.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/RepositoryManagerClientHttpJsonTest.java new file mode 100644 index 000000000000..86d906651e5d --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/RepositoryManagerClientHttpJsonTest.java @@ -0,0 +1,1526 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListRepositoriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import google.devtools.cloudbuild.v2.stub.HttpJsonRepositoryManagerStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +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 RepositoryManagerClientHttpJsonTest { + private static MockHttpService mockService; + private static RepositoryManagerClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRepositoryManagerStub.getMethodDescriptors(), + RepositoryManagerSettings.getDefaultEndpoint()); + RepositoryManagerSettings settings = + RepositoryManagerSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RepositoryManagerSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RepositoryManagerClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createConnectionTest() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + + Connection actualResponse = + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createConnectionTest2() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + + Connection actualResponse = + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createConnectionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getConnectionTest() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionTest2() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-7851/locations/location-7851/connections/connection-7851"; + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getConnectionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-7851/locations/location-7851/connections/connection-7851"; + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConnectionsTest() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConnectionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConnectionsTest2() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConnectionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConnectionTest() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Connection connection = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Connection actualResponse = client.updateConnectionAsync(connection, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Connection connection = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConnectionAsync(connection, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteConnectionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnectionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + client.deleteConnectionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteConnectionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-7851/locations/location-7851/connections/connection-7851"; + + client.deleteConnectionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteConnectionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-7851/locations/location-7851/connections/connection-7851"; + client.deleteConnectionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createRepositoryTest() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + + Repository actualResponse = + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRepositoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createRepositoryTest2() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-7002/locations/location-7002/connections/connection-7002"; + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + + Repository actualResponse = + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRepositoryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-7002/locations/location-7002/connections/connection-7002"; + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void batchCreateRepositoriesTest() throws Exception { + BatchCreateRepositoriesResponse expectedResponse = + BatchCreateRepositoriesResponse.newBuilder() + .addAllRepositories(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateRepositoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List requests = new ArrayList<>(); + + BatchCreateRepositoriesResponse actualResponse = + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchCreateRepositoriesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List requests = new ArrayList<>(); + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void batchCreateRepositoriesTest2() throws Exception { + BatchCreateRepositoriesResponse expectedResponse = + BatchCreateRepositoriesResponse.newBuilder() + .addAllRepositories(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateRepositoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-7002/locations/location-7002/connections/connection-7002"; + List requests = new ArrayList<>(); + + BatchCreateRepositoriesResponse actualResponse = + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchCreateRepositoriesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-7002/locations/location-7002/connections/connection-7002"; + List requests = new ArrayList<>(); + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getRepositoryTest() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + Repository actualResponse = client.getRepository(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRepositoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + 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]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-5305/locations/location-5305/connections/connection-5305/repositories/repositorie-5305"; + + Repository actualResponse = client.getRepository(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRepositoryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-5305/locations/location-5305/connections/connection-5305/repositories/repositorie-5305"; + client.getRepository(name); + 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(); + mockService.addResponse(expectedResponse); + + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRepositoriesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + 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(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-7002/locations/location-7002/connections/connection-7002"; + + 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 = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRepositoriesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-7002/locations/location-7002/connections/connection-7002"; + client.listRepositories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRepositoryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + client.deleteRepositoryAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRepositoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + client.deleteRepositoryAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteRepositoryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-5305/locations/location-5305/connections/connection-5305/repositories/repositorie-5305"; + + client.deleteRepositoryAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRepositoryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-5305/locations/location-5305/connections/connection-5305/repositories/repositorie-5305"; + client.deleteRepositoryAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void fetchReadWriteTokenTest() throws Exception { + FetchReadWriteTokenResponse expectedResponse = + FetchReadWriteTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + FetchReadWriteTokenResponse actualResponse = client.fetchReadWriteToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchReadWriteTokenExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + client.fetchReadWriteToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchReadWriteTokenTest2() throws Exception { + FetchReadWriteTokenResponse expectedResponse = + FetchReadWriteTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String repository = + "projects/project-6024/locations/location-6024/connections/connection-6024/repositories/repositorie-6024"; + + FetchReadWriteTokenResponse actualResponse = client.fetchReadWriteToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchReadWriteTokenExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String repository = + "projects/project-6024/locations/location-6024/connections/connection-6024/repositories/repositorie-6024"; + client.fetchReadWriteToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchReadTokenTest() throws Exception { + FetchReadTokenResponse expectedResponse = + FetchReadTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + FetchReadTokenResponse actualResponse = client.fetchReadToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchReadTokenExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + client.fetchReadToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchReadTokenTest2() throws Exception { + FetchReadTokenResponse expectedResponse = + FetchReadTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String repository = + "projects/project-6024/locations/location-6024/connections/connection-6024/repositories/repositorie-6024"; + + FetchReadTokenResponse actualResponse = client.fetchReadToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchReadTokenExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String repository = + "projects/project-6024/locations/location-6024/connections/connection-6024/repositories/repositorie-6024"; + client.fetchReadToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchLinkableRepositoriesTest() throws Exception { + Repository responsesElement = Repository.newBuilder().build(); + FetchLinkableRepositoriesResponse expectedResponse = + FetchLinkableRepositoriesResponse.newBuilder() + .setNextPageToken("") + .addAllRepositories(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + FetchLinkableRepositoriesPagedResponse pagedListResponse = + client.fetchLinkableRepositories(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRepositoriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void fetchLinkableRepositoriesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection( + ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.fetchLinkableRepositories(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/RepositoryManagerClientTest.java b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/RepositoryManagerClientTest.java new file mode 100644 index 000000000000..92ac004947de --- /dev/null +++ b/java-cloudbuild/google-cloud-build/src/test/java/google/devtools/cloudbuild/v2/RepositoryManagerClientTest.java @@ -0,0 +1,1398 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.ListConnectionsPagedResponse; +import static google.devtools.cloudbuild.v2.RepositoryManagerClient.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.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +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 RepositoryManagerClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockRepositoryManager mockRepositoryManager; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RepositoryManagerClient client; + + @BeforeClass + public static void startStaticServer() { + mockRepositoryManager = new MockRepositoryManager(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockRepositoryManager, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RepositoryManagerSettings settings = + RepositoryManagerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RepositoryManagerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createConnectionTest() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + + Connection actualResponse = + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConnectionRequest actualRequest = ((CreateConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(connectionId, actualRequest.getConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createConnectionTest2() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + + Connection actualResponse = + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConnectionRequest actualRequest = ((CreateConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(connectionId, actualRequest.getConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConnectionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String parent = "parent-995424086"; + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + client.createConnectionAsync(parent, connection, connectionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getConnectionTest() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionRequest actualRequest = ((GetConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConnectionTest2() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + String name = "name3373707"; + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionRequest actualRequest = ((GetConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConnectionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String name = "name3373707"; + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConnectionsTest() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = ((ListConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConnectionsTest2() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = ((ListConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConnectionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String parent = "parent-995424086"; + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConnectionTest() throws Exception { + Connection expectedResponse = + Connection.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setInstallationState(InstallationState.newBuilder().build()) + .setDisabled(true) + .setReconciling(true) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Connection actualResponse = client.updateConnectionAsync(connection, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConnectionRequest actualRequest = ((UpdateConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConnectionAsync(connection, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteConnectionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnectionAsync(name).get(); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConnectionRequest actualRequest = ((DeleteConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + client.deleteConnectionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteConnectionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteConnectionAsync(name).get(); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConnectionRequest actualRequest = ((DeleteConnectionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConnectionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String name = "name3373707"; + client.deleteConnectionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createRepositoryTest() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + + Repository actualResponse = + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRepositoryRequest actualRequest = ((CreateRepositoryRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(repository, actualRequest.getRepository()); + Assert.assertEquals(repositoryId, actualRequest.getRepositoryId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRepositoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createRepositoryTest2() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + + Repository actualResponse = + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRepositoryRequest actualRequest = ((CreateRepositoryRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(repository, actualRequest.getRepository()); + Assert.assertEquals(repositoryId, actualRequest.getRepositoryId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRepositoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String parent = "parent-995424086"; + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + client.createRepositoryAsync(parent, repository, repositoryId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchCreateRepositoriesTest() throws Exception { + BatchCreateRepositoriesResponse expectedResponse = + BatchCreateRepositoriesResponse.newBuilder() + .addAllRepositories(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateRepositoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List requests = new ArrayList<>(); + + BatchCreateRepositoriesResponse actualResponse = + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateRepositoriesRequest actualRequest = + ((BatchCreateRepositoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchCreateRepositoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List requests = new ArrayList<>(); + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void batchCreateRepositoriesTest2() throws Exception { + BatchCreateRepositoriesResponse expectedResponse = + BatchCreateRepositoriesResponse.newBuilder() + .addAllRepositories(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("batchCreateRepositoriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + String parent = "parent-995424086"; + List requests = new ArrayList<>(); + + BatchCreateRepositoriesResponse actualResponse = + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateRepositoriesRequest actualRequest = + ((BatchCreateRepositoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(requests, actualRequest.getRequestsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchCreateRepositoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String parent = "parent-995424086"; + List requests = new ArrayList<>(); + client.batchCreateRepositoriesAsync(parent, requests).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getRepositoryTest() throws Exception { + Repository expectedResponse = + Repository.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + Repository actualResponse = client.getRepository(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.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); + mockRepositoryManager.addException(exception); + + try { + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + 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]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setRemoteUri("remoteUri1280517958") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllAnnotations(new HashMap()) + .setEtag("etag3123477") + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + String name = "name3373707"; + + Repository actualResponse = client.getRepository(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.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); + mockRepositoryManager.addException(exception); + + try { + String name = "name3373707"; + client.getRepository(name); + 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(); + mockRepositoryManager.addResponse(expectedResponse); + + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + 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 = mockRepositoryManager.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); + mockRepositoryManager.addException(exception); + + try { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + 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(); + mockRepositoryManager.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 = mockRepositoryManager.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); + mockRepositoryManager.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRepositories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRepositoryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + client.deleteRepositoryAsync(name).get(); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRepositoryRequest actualRequest = ((DeleteRepositoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRepositoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + client.deleteRepositoryAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteRepositoryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteRepositoryTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRepositoryManager.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteRepositoryAsync(name).get(); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRepositoryRequest actualRequest = ((DeleteRepositoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRepositoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String name = "name3373707"; + client.deleteRepositoryAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void fetchReadWriteTokenTest() throws Exception { + FetchReadWriteTokenResponse expectedResponse = + FetchReadWriteTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + FetchReadWriteTokenResponse actualResponse = client.fetchReadWriteToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchReadWriteTokenRequest actualRequest = ((FetchReadWriteTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(repository.toString(), actualRequest.getRepository()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchReadWriteTokenExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + client.fetchReadWriteToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchReadWriteTokenTest2() throws Exception { + FetchReadWriteTokenResponse expectedResponse = + FetchReadWriteTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + String repository = "repository1950800714"; + + FetchReadWriteTokenResponse actualResponse = client.fetchReadWriteToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchReadWriteTokenRequest actualRequest = ((FetchReadWriteTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(repository, actualRequest.getRepository()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchReadWriteTokenExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String repository = "repository1950800714"; + client.fetchReadWriteToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchReadTokenTest() throws Exception { + FetchReadTokenResponse expectedResponse = + FetchReadTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + + FetchReadTokenResponse actualResponse = client.fetchReadToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchReadTokenRequest actualRequest = ((FetchReadTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(repository.toString(), actualRequest.getRepository()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchReadTokenExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + client.fetchReadToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchReadTokenTest2() throws Exception { + FetchReadTokenResponse expectedResponse = + FetchReadTokenResponse.newBuilder() + .setToken("token110541305") + .setExpirationTime(Timestamp.newBuilder().build()) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + String repository = "repository1950800714"; + + FetchReadTokenResponse actualResponse = client.fetchReadToken(repository); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchReadTokenRequest actualRequest = ((FetchReadTokenRequest) actualRequests.get(0)); + + Assert.assertEquals(repository, actualRequest.getRepository()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchReadTokenExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + String repository = "repository1950800714"; + client.fetchReadToken(repository); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchLinkableRepositoriesTest() throws Exception { + Repository responsesElement = Repository.newBuilder().build(); + FetchLinkableRepositoriesResponse expectedResponse = + FetchLinkableRepositoriesResponse.newBuilder() + .setNextPageToken("") + .addAllRepositories(Arrays.asList(responsesElement)) + .build(); + mockRepositoryManager.addResponse(expectedResponse); + + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + FetchLinkableRepositoriesPagedResponse pagedListResponse = + client.fetchLinkableRepositories(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRepositoriesList().get(0), resources.get(0)); + + List actualRequests = mockRepositoryManager.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchLinkableRepositoriesRequest actualRequest = + ((FetchLinkableRepositoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getConnection(), actualRequest.getConnection()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchLinkableRepositoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRepositoryManager.addException(exception); + + try { + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection( + ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.fetchLinkableRepositories(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudbuild/grpc-google-cloud-build-v2/pom.xml b/java-cloudbuild/grpc-google-cloud-build-v2/pom.xml new file mode 100644 index 000000000000..fe7d400c17ac --- /dev/null +++ b/java-cloudbuild/grpc-google-cloud-build-v2/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-build-v2 + 3.13.0-SNAPSHOT + grpc-google-cloud-build-v2 + GRPC library for google-cloud-build + + com.google.cloud + google-cloud-build-parent + 3.13.0-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-build-v2 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-cloudbuild/grpc-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerGrpc.java b/java-cloudbuild/grpc-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerGrpc.java new file mode 100644 index 000000000000..fd69605ee053 --- /dev/null +++ b/java-cloudbuild/grpc-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerGrpc.java @@ -0,0 +1,1780 @@ +/* + * 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 google.devtools.cloudbuild.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages connections to source code repostiories.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/devtools/cloudbuild/v2/repositories.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RepositoryManagerGrpc { + + private RepositoryManagerGrpc() {} + + public static final String SERVICE_NAME = "google.devtools.cloudbuild.v2.RepositoryManager"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.CreateConnectionRequest, com.google.longrunning.Operation> + getCreateConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateConnection", + requestType = google.devtools.cloudbuild.v2.CreateConnectionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.CreateConnectionRequest, com.google.longrunning.Operation> + getCreateConnectionMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.CreateConnectionRequest, com.google.longrunning.Operation> + getCreateConnectionMethod; + if ((getCreateConnectionMethod = RepositoryManagerGrpc.getCreateConnectionMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getCreateConnectionMethod = RepositoryManagerGrpc.getCreateConnectionMethod) == null) { + RepositoryManagerGrpc.getCreateConnectionMethod = + getCreateConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.CreateConnectionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("CreateConnection")) + .build(); + } + } + } + return getCreateConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.GetConnectionRequest, + google.devtools.cloudbuild.v2.Connection> + getGetConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnection", + requestType = google.devtools.cloudbuild.v2.GetConnectionRequest.class, + responseType = google.devtools.cloudbuild.v2.Connection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.GetConnectionRequest, + google.devtools.cloudbuild.v2.Connection> + getGetConnectionMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.GetConnectionRequest, + google.devtools.cloudbuild.v2.Connection> + getGetConnectionMethod; + if ((getGetConnectionMethod = RepositoryManagerGrpc.getGetConnectionMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getGetConnectionMethod = RepositoryManagerGrpc.getGetConnectionMethod) == null) { + RepositoryManagerGrpc.getGetConnectionMethod = + getGetConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.GetConnectionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.Connection.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("GetConnection")) + .build(); + } + } + } + return getGetConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.ListConnectionsRequest, + google.devtools.cloudbuild.v2.ListConnectionsResponse> + getListConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConnections", + requestType = google.devtools.cloudbuild.v2.ListConnectionsRequest.class, + responseType = google.devtools.cloudbuild.v2.ListConnectionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.ListConnectionsRequest, + google.devtools.cloudbuild.v2.ListConnectionsResponse> + getListConnectionsMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.ListConnectionsRequest, + google.devtools.cloudbuild.v2.ListConnectionsResponse> + getListConnectionsMethod; + if ((getListConnectionsMethod = RepositoryManagerGrpc.getListConnectionsMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getListConnectionsMethod = RepositoryManagerGrpc.getListConnectionsMethod) == null) { + RepositoryManagerGrpc.getListConnectionsMethod = + getListConnectionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.ListConnectionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.ListConnectionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("ListConnections")) + .build(); + } + } + } + return getListConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.UpdateConnectionRequest, com.google.longrunning.Operation> + getUpdateConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConnection", + requestType = google.devtools.cloudbuild.v2.UpdateConnectionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.UpdateConnectionRequest, com.google.longrunning.Operation> + getUpdateConnectionMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.UpdateConnectionRequest, com.google.longrunning.Operation> + getUpdateConnectionMethod; + if ((getUpdateConnectionMethod = RepositoryManagerGrpc.getUpdateConnectionMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getUpdateConnectionMethod = RepositoryManagerGrpc.getUpdateConnectionMethod) == null) { + RepositoryManagerGrpc.getUpdateConnectionMethod = + getUpdateConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.UpdateConnectionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("UpdateConnection")) + .build(); + } + } + } + return getUpdateConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.DeleteConnectionRequest, com.google.longrunning.Operation> + getDeleteConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConnection", + requestType = google.devtools.cloudbuild.v2.DeleteConnectionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.DeleteConnectionRequest, com.google.longrunning.Operation> + getDeleteConnectionMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.DeleteConnectionRequest, com.google.longrunning.Operation> + getDeleteConnectionMethod; + if ((getDeleteConnectionMethod = RepositoryManagerGrpc.getDeleteConnectionMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getDeleteConnectionMethod = RepositoryManagerGrpc.getDeleteConnectionMethod) == null) { + RepositoryManagerGrpc.getDeleteConnectionMethod = + getDeleteConnectionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.DeleteConnectionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("DeleteConnection")) + .build(); + } + } + } + return getDeleteConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, com.google.longrunning.Operation> + getCreateRepositoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRepository", + requestType = google.devtools.cloudbuild.v2.CreateRepositoryRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, com.google.longrunning.Operation> + getCreateRepositoryMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, com.google.longrunning.Operation> + getCreateRepositoryMethod; + if ((getCreateRepositoryMethod = RepositoryManagerGrpc.getCreateRepositoryMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getCreateRepositoryMethod = RepositoryManagerGrpc.getCreateRepositoryMethod) == null) { + RepositoryManagerGrpc.getCreateRepositoryMethod = + getCreateRepositoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRepository")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.CreateRepositoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("CreateRepository")) + .build(); + } + } + } + return getCreateRepositoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest, + com.google.longrunning.Operation> + getBatchCreateRepositoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchCreateRepositories", + requestType = google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest, + com.google.longrunning.Operation> + getBatchCreateRepositoriesMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest, + com.google.longrunning.Operation> + getBatchCreateRepositoriesMethod; + if ((getBatchCreateRepositoriesMethod = RepositoryManagerGrpc.getBatchCreateRepositoriesMethod) + == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getBatchCreateRepositoriesMethod = + RepositoryManagerGrpc.getBatchCreateRepositoriesMethod) + == null) { + RepositoryManagerGrpc.getBatchCreateRepositoriesMethod = + getBatchCreateRepositoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchCreateRepositories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("BatchCreateRepositories")) + .build(); + } + } + } + return getBatchCreateRepositoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.GetRepositoryRequest, + google.devtools.cloudbuild.v2.Repository> + getGetRepositoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRepository", + requestType = google.devtools.cloudbuild.v2.GetRepositoryRequest.class, + responseType = google.devtools.cloudbuild.v2.Repository.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.GetRepositoryRequest, + google.devtools.cloudbuild.v2.Repository> + getGetRepositoryMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.GetRepositoryRequest, + google.devtools.cloudbuild.v2.Repository> + getGetRepositoryMethod; + if ((getGetRepositoryMethod = RepositoryManagerGrpc.getGetRepositoryMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getGetRepositoryMethod = RepositoryManagerGrpc.getGetRepositoryMethod) == null) { + RepositoryManagerGrpc.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( + google.devtools.cloudbuild.v2.GetRepositoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.Repository.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("GetRepository")) + .build(); + } + } + } + return getGetRepositoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.ListRepositoriesRequest, + google.devtools.cloudbuild.v2.ListRepositoriesResponse> + getListRepositoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRepositories", + requestType = google.devtools.cloudbuild.v2.ListRepositoriesRequest.class, + responseType = google.devtools.cloudbuild.v2.ListRepositoriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.ListRepositoriesRequest, + google.devtools.cloudbuild.v2.ListRepositoriesResponse> + getListRepositoriesMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.ListRepositoriesRequest, + google.devtools.cloudbuild.v2.ListRepositoriesResponse> + getListRepositoriesMethod; + if ((getListRepositoriesMethod = RepositoryManagerGrpc.getListRepositoriesMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getListRepositoriesMethod = RepositoryManagerGrpc.getListRepositoriesMethod) == null) { + RepositoryManagerGrpc.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( + google.devtools.cloudbuild.v2.ListRepositoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.ListRepositoriesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("ListRepositories")) + .build(); + } + } + } + return getListRepositoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.DeleteRepositoryRequest, com.google.longrunning.Operation> + getDeleteRepositoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRepository", + requestType = google.devtools.cloudbuild.v2.DeleteRepositoryRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.DeleteRepositoryRequest, com.google.longrunning.Operation> + getDeleteRepositoryMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.DeleteRepositoryRequest, com.google.longrunning.Operation> + getDeleteRepositoryMethod; + if ((getDeleteRepositoryMethod = RepositoryManagerGrpc.getDeleteRepositoryMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getDeleteRepositoryMethod = RepositoryManagerGrpc.getDeleteRepositoryMethod) == null) { + RepositoryManagerGrpc.getDeleteRepositoryMethod = + getDeleteRepositoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRepository")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("DeleteRepository")) + .build(); + } + } + } + return getDeleteRepositoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest, + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse> + getFetchReadWriteTokenMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchReadWriteToken", + requestType = google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.class, + responseType = google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest, + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse> + getFetchReadWriteTokenMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest, + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse> + getFetchReadWriteTokenMethod; + if ((getFetchReadWriteTokenMethod = RepositoryManagerGrpc.getFetchReadWriteTokenMethod) + == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getFetchReadWriteTokenMethod = RepositoryManagerGrpc.getFetchReadWriteTokenMethod) + == null) { + RepositoryManagerGrpc.getFetchReadWriteTokenMethod = + getFetchReadWriteTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FetchReadWriteToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("FetchReadWriteToken")) + .build(); + } + } + } + return getFetchReadWriteTokenMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchReadTokenRequest, + google.devtools.cloudbuild.v2.FetchReadTokenResponse> + getFetchReadTokenMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchReadToken", + requestType = google.devtools.cloudbuild.v2.FetchReadTokenRequest.class, + responseType = google.devtools.cloudbuild.v2.FetchReadTokenResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchReadTokenRequest, + google.devtools.cloudbuild.v2.FetchReadTokenResponse> + getFetchReadTokenMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchReadTokenRequest, + google.devtools.cloudbuild.v2.FetchReadTokenResponse> + getFetchReadTokenMethod; + if ((getFetchReadTokenMethod = RepositoryManagerGrpc.getFetchReadTokenMethod) == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getFetchReadTokenMethod = RepositoryManagerGrpc.getFetchReadTokenMethod) == null) { + RepositoryManagerGrpc.getFetchReadTokenMethod = + getFetchReadTokenMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchReadToken")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.FetchReadTokenRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.FetchReadTokenResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier("FetchReadToken")) + .build(); + } + } + } + return getFetchReadTokenMethod; + } + + private static volatile io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse> + getFetchLinkableRepositoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchLinkableRepositories", + requestType = google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.class, + responseType = google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse> + getFetchLinkableRepositoriesMethod() { + io.grpc.MethodDescriptor< + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse> + getFetchLinkableRepositoriesMethod; + if ((getFetchLinkableRepositoriesMethod = + RepositoryManagerGrpc.getFetchLinkableRepositoriesMethod) + == null) { + synchronized (RepositoryManagerGrpc.class) { + if ((getFetchLinkableRepositoriesMethod = + RepositoryManagerGrpc.getFetchLinkableRepositoriesMethod) + == null) { + RepositoryManagerGrpc.getFetchLinkableRepositoriesMethod = + getFetchLinkableRepositoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FetchLinkableRepositories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RepositoryManagerMethodDescriptorSupplier( + "FetchLinkableRepositories")) + .build(); + } + } + } + return getFetchLinkableRepositoriesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RepositoryManagerStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RepositoryManagerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RepositoryManagerStub(channel, callOptions); + } + }; + return RepositoryManagerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RepositoryManagerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RepositoryManagerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RepositoryManagerBlockingStub(channel, callOptions); + } + }; + return RepositoryManagerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RepositoryManagerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RepositoryManagerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RepositoryManagerFutureStub(channel, callOptions); + } + }; + return RepositoryManagerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Manages connections to source code repostiories.
+   * 
+ */ + public abstract static class RepositoryManagerImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a Connection.
+     * 
+ */ + public void createConnection( + google.devtools.cloudbuild.v2.CreateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single connection.
+     * 
+ */ + public void getConnection( + google.devtools.cloudbuild.v2.GetConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Connections in a given project and location.
+     * 
+ */ + public void listConnections( + google.devtools.cloudbuild.v2.ListConnectionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListConnectionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a single connection.
+     * 
+ */ + public void updateConnection( + google.devtools.cloudbuild.v2.UpdateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single connection.
+     * 
+ */ + public void deleteConnection( + google.devtools.cloudbuild.v2.DeleteConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteConnectionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Repository.
+     * 
+ */ + public void createRepository( + google.devtools.cloudbuild.v2.CreateRepositoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateRepositoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates multiple repositories inside a connection.
+     * 
+ */ + public void batchCreateRepositories( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchCreateRepositoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single repository.
+     * 
+ */ + public void getRepository( + google.devtools.cloudbuild.v2.GetRepositoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetRepositoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Repositories in a given connection.
+     * 
+ */ + public void listRepositories( + google.devtools.cloudbuild.v2.ListRepositoriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRepositoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single repository.
+     * 
+ */ + public void deleteRepository( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteRepositoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches read/write token of a given repository.
+     * 
+ */ + public void fetchReadWriteToken( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchReadWriteTokenMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches read token of a given repository.
+     * 
+ */ + public void fetchReadToken( + google.devtools.cloudbuild.v2.FetchReadTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchReadTokenMethod(), responseObserver); + } + + /** + * + * + *
+     * FetchLinkableRepositories get repositories from SCM that are
+     * accessible and could be added to the connection.
+     * 
+ */ + public void fetchLinkableRepositories( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchLinkableRepositoriesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.CreateConnectionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_CONNECTION))) + .addMethod( + getGetConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.GetConnectionRequest, + google.devtools.cloudbuild.v2.Connection>(this, METHODID_GET_CONNECTION))) + .addMethod( + getListConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.ListConnectionsRequest, + google.devtools.cloudbuild.v2.ListConnectionsResponse>( + this, METHODID_LIST_CONNECTIONS))) + .addMethod( + getUpdateConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.UpdateConnectionRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_CONNECTION))) + .addMethod( + getDeleteConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.DeleteConnectionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_CONNECTION))) + .addMethod( + getCreateRepositoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_REPOSITORY))) + .addMethod( + getBatchCreateRepositoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest, + com.google.longrunning.Operation>(this, METHODID_BATCH_CREATE_REPOSITORIES))) + .addMethod( + getGetRepositoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.GetRepositoryRequest, + google.devtools.cloudbuild.v2.Repository>(this, METHODID_GET_REPOSITORY))) + .addMethod( + getListRepositoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.ListRepositoriesRequest, + google.devtools.cloudbuild.v2.ListRepositoriesResponse>( + this, METHODID_LIST_REPOSITORIES))) + .addMethod( + getDeleteRepositoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.DeleteRepositoryRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_REPOSITORY))) + .addMethod( + getFetchReadWriteTokenMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest, + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse>( + this, METHODID_FETCH_READ_WRITE_TOKEN))) + .addMethod( + getFetchReadTokenMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.FetchReadTokenRequest, + google.devtools.cloudbuild.v2.FetchReadTokenResponse>( + this, METHODID_FETCH_READ_TOKEN))) + .addMethod( + getFetchLinkableRepositoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse>( + this, METHODID_FETCH_LINKABLE_REPOSITORIES))) + .build(); + } + } + + /** + * + * + *
+   * Manages connections to source code repostiories.
+   * 
+ */ + public static final class RepositoryManagerStub + extends io.grpc.stub.AbstractAsyncStub { + private RepositoryManagerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RepositoryManagerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RepositoryManagerStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Connection.
+     * 
+ */ + public void createConnection( + google.devtools.cloudbuild.v2.CreateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single connection.
+     * 
+ */ + public void getConnection( + google.devtools.cloudbuild.v2.GetConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Connections in a given project and location.
+     * 
+ */ + public void listConnections( + google.devtools.cloudbuild.v2.ListConnectionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a single connection.
+     * 
+ */ + public void updateConnection( + google.devtools.cloudbuild.v2.UpdateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single connection.
+     * 
+ */ + public void deleteConnection( + google.devtools.cloudbuild.v2.DeleteConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteConnectionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Repository.
+     * 
+ */ + public void createRepository( + google.devtools.cloudbuild.v2.CreateRepositoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRepositoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates multiple repositories inside a connection.
+     * 
+ */ + public void batchCreateRepositories( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchCreateRepositoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single repository.
+     * 
+ */ + public void getRepository( + google.devtools.cloudbuild.v2.GetRepositoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRepositoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Repositories in a given connection.
+     * 
+ */ + public void listRepositories( + google.devtools.cloudbuild.v2.ListRepositoriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRepositoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single repository.
+     * 
+ */ + public void deleteRepository( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRepositoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches read/write token of a given repository.
+     * 
+ */ + public void fetchReadWriteToken( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchReadWriteTokenMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches read token of a given repository.
+     * 
+ */ + public void fetchReadToken( + google.devtools.cloudbuild.v2.FetchReadTokenRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchReadTokenMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * FetchLinkableRepositories get repositories from SCM that are
+     * accessible and could be added to the connection.
+     * 
+ */ + public void fetchLinkableRepositories( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchLinkableRepositoriesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages connections to source code repostiories.
+   * 
+ */ + public static final class RepositoryManagerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RepositoryManagerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RepositoryManagerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RepositoryManagerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Connection.
+     * 
+ */ + public com.google.longrunning.Operation createConnection( + google.devtools.cloudbuild.v2.CreateConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single connection.
+     * 
+ */ + public google.devtools.cloudbuild.v2.Connection getConnection( + google.devtools.cloudbuild.v2.GetConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Connections in a given project and location.
+     * 
+ */ + public google.devtools.cloudbuild.v2.ListConnectionsResponse listConnections( + google.devtools.cloudbuild.v2.ListConnectionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConnectionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a single connection.
+     * 
+ */ + public com.google.longrunning.Operation updateConnection( + google.devtools.cloudbuild.v2.UpdateConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single connection.
+     * 
+ */ + public com.google.longrunning.Operation deleteConnection( + google.devtools.cloudbuild.v2.DeleteConnectionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteConnectionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Repository.
+     * 
+ */ + public com.google.longrunning.Operation createRepository( + google.devtools.cloudbuild.v2.CreateRepositoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRepositoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates multiple repositories inside a connection.
+     * 
+ */ + public com.google.longrunning.Operation batchCreateRepositories( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchCreateRepositoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single repository.
+     * 
+ */ + public google.devtools.cloudbuild.v2.Repository getRepository( + google.devtools.cloudbuild.v2.GetRepositoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRepositoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Repositories in a given connection.
+     * 
+ */ + public google.devtools.cloudbuild.v2.ListRepositoriesResponse listRepositories( + google.devtools.cloudbuild.v2.ListRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRepositoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single repository.
+     * 
+ */ + public com.google.longrunning.Operation deleteRepository( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRepositoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches read/write token of a given repository.
+     * 
+ */ + public google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse fetchReadWriteToken( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchReadWriteTokenMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches read token of a given repository.
+     * 
+ */ + public google.devtools.cloudbuild.v2.FetchReadTokenResponse fetchReadToken( + google.devtools.cloudbuild.v2.FetchReadTokenRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchReadTokenMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * FetchLinkableRepositories get repositories from SCM that are
+     * accessible and could be added to the connection.
+     * 
+ */ + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse + fetchLinkableRepositories( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchLinkableRepositoriesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages connections to source code repostiories.
+   * 
+ */ + public static final class RepositoryManagerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RepositoryManagerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RepositoryManagerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RepositoryManagerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a Connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createConnection(google.devtools.cloudbuild.v2.CreateConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.Connection> + getConnection(google.devtools.cloudbuild.v2.GetConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Connections in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.ListConnectionsResponse> + listConnections(google.devtools.cloudbuild.v2.ListConnectionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a single connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateConnection(google.devtools.cloudbuild.v2.UpdateConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteConnection(google.devtools.cloudbuild.v2.DeleteConnectionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteConnectionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Repository.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createRepository(google.devtools.cloudbuild.v2.CreateRepositoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRepositoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates multiple repositories inside a connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + batchCreateRepositories( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchCreateRepositoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single repository.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.Repository> + getRepository(google.devtools.cloudbuild.v2.GetRepositoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRepositoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Repositories in a given connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.ListRepositoriesResponse> + listRepositories(google.devtools.cloudbuild.v2.ListRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRepositoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single repository.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteRepository(google.devtools.cloudbuild.v2.DeleteRepositoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRepositoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fetches read/write token of a given repository.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse> + fetchReadWriteToken(google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchReadWriteTokenMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fetches read token of a given repository.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.FetchReadTokenResponse> + fetchReadToken(google.devtools.cloudbuild.v2.FetchReadTokenRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchReadTokenMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * FetchLinkableRepositories get repositories from SCM that are
+     * accessible and could be added to the connection.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse> + fetchLinkableRepositories( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchLinkableRepositoriesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_CONNECTION = 0; + private static final int METHODID_GET_CONNECTION = 1; + private static final int METHODID_LIST_CONNECTIONS = 2; + private static final int METHODID_UPDATE_CONNECTION = 3; + private static final int METHODID_DELETE_CONNECTION = 4; + private static final int METHODID_CREATE_REPOSITORY = 5; + private static final int METHODID_BATCH_CREATE_REPOSITORIES = 6; + private static final int METHODID_GET_REPOSITORY = 7; + private static final int METHODID_LIST_REPOSITORIES = 8; + private static final int METHODID_DELETE_REPOSITORY = 9; + private static final int METHODID_FETCH_READ_WRITE_TOKEN = 10; + private static final int METHODID_FETCH_READ_TOKEN = 11; + private static final int METHODID_FETCH_LINKABLE_REPOSITORIES = 12; + + 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 RepositoryManagerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RepositoryManagerImplBase 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_CREATE_CONNECTION: + serviceImpl.createConnection( + (google.devtools.cloudbuild.v2.CreateConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CONNECTION: + serviceImpl.getConnection( + (google.devtools.cloudbuild.v2.GetConnectionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CONNECTIONS: + serviceImpl.listConnections( + (google.devtools.cloudbuild.v2.ListConnectionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_CONNECTION: + serviceImpl.updateConnection( + (google.devtools.cloudbuild.v2.UpdateConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CONNECTION: + serviceImpl.deleteConnection( + (google.devtools.cloudbuild.v2.DeleteConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_REPOSITORY: + serviceImpl.createRepository( + (google.devtools.cloudbuild.v2.CreateRepositoryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_CREATE_REPOSITORIES: + serviceImpl.batchCreateRepositories( + (google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_REPOSITORY: + serviceImpl.getRepository( + (google.devtools.cloudbuild.v2.GetRepositoryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_REPOSITORIES: + serviceImpl.listRepositories( + (google.devtools.cloudbuild.v2.ListRepositoriesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_REPOSITORY: + serviceImpl.deleteRepository( + (google.devtools.cloudbuild.v2.DeleteRepositoryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FETCH_READ_WRITE_TOKEN: + serviceImpl.fetchReadWriteToken( + (google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) request, + (io.grpc.stub.StreamObserver< + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse>) + responseObserver); + break; + case METHODID_FETCH_READ_TOKEN: + serviceImpl.fetchReadToken( + (google.devtools.cloudbuild.v2.FetchReadTokenRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FETCH_LINKABLE_REPOSITORIES: + serviceImpl.fetchLinkableRepositories( + (google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) request, + (io.grpc.stub.StreamObserver< + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse>) + 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 RepositoryManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RepositoryManagerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RepositoryManager"); + } + } + + private static final class RepositoryManagerFileDescriptorSupplier + extends RepositoryManagerBaseDescriptorSupplier { + RepositoryManagerFileDescriptorSupplier() {} + } + + private static final class RepositoryManagerMethodDescriptorSupplier + extends RepositoryManagerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RepositoryManagerMethodDescriptorSupplier(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 (RepositoryManagerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RepositoryManagerFileDescriptorSupplier()) + .addMethod(getCreateConnectionMethod()) + .addMethod(getGetConnectionMethod()) + .addMethod(getListConnectionsMethod()) + .addMethod(getUpdateConnectionMethod()) + .addMethod(getDeleteConnectionMethod()) + .addMethod(getCreateRepositoryMethod()) + .addMethod(getBatchCreateRepositoriesMethod()) + .addMethod(getGetRepositoryMethod()) + .addMethod(getListRepositoriesMethod()) + .addMethod(getDeleteRepositoryMethod()) + .addMethod(getFetchReadWriteTokenMethod()) + .addMethod(getFetchReadTokenMethod()) + .addMethod(getFetchLinkableRepositoriesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudbuild/pom.xml b/java-cloudbuild/pom.xml index ed8042c1a2f6..187c33ccce72 100644 --- a/java-cloudbuild/pom.xml +++ b/java-cloudbuild/pom.xml @@ -31,6 +31,16 @@ proto-google-cloud-build-v1 3.13.0-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-build-v2 + 3.13.0-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-build-v2 + 3.13.0-SNAPSHOT + com.google.cloud google-cloud-build @@ -47,7 +57,9 @@ google-cloud-build grpc-google-cloud-build-v1 + grpc-google-cloud-build-v2 proto-google-cloud-build-v1 + proto-google-cloud-build-v2 google-cloud-build-bom diff --git a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptions.java b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptions.java index 8a35c45f6987..035fa3fd8f24 100644 --- a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptions.java +++ b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptions.java @@ -1941,7 +1941,7 @@ public com.google.cloudbuild.v1.BuildOptions.LogStreamingOption getLogStreamingO * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return The workerPool. */ @java.lang.Override @@ -1967,7 +1967,7 @@ public java.lang.String getWorkerPool() { * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return The bytes for workerPool. */ @java.lang.Override @@ -3873,7 +3873,7 @@ public Builder clearLogStreamingOption() { * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return The workerPool. */ @java.lang.Deprecated @@ -3898,7 +3898,7 @@ public java.lang.String getWorkerPool() { * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return The bytes for workerPool. */ @java.lang.Deprecated @@ -3923,7 +3923,7 @@ public com.google.protobuf.ByteString getWorkerPoolBytes() { * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @param value The workerPool to set. * @return This builder for chaining. */ @@ -3947,7 +3947,7 @@ public Builder setWorkerPool(java.lang.String value) { * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return This builder for chaining. */ @java.lang.Deprecated @@ -3967,7 +3967,7 @@ public Builder clearWorkerPool() { * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @param value The bytes for workerPool to set. * @return This builder for chaining. */ diff --git a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptionsOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptionsOrBuilder.java index bd7cec36610a..0b42887be9f9 100644 --- a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptionsOrBuilder.java +++ b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildOptionsOrBuilder.java @@ -244,7 +244,7 @@ public interface BuildOptionsOrBuilder * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return The workerPool. */ @java.lang.Deprecated @@ -259,7 +259,7 @@ public interface BuildOptionsOrBuilder * string worker_pool = 7 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.BuildOptions.worker_pool is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1880 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1881 * @return The bytes for workerPool. */ @java.lang.Deprecated diff --git a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java index a0a8f7a1aabc..e36b8debc52c 100644 --- a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java +++ b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Cloudbuild.java @@ -847,27 +847,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "arent=projects/*/locations/*}/workerPool" + "s\332A\006parent\032M\312A\031cloudbuild.googleapis.com" + "\322A.https://www.googleapis.com/auth/cloud" - + "-platformB\222\006\n\030com.google.cloudbuild.v1P\001" + + "-platformB\252\006\n\030com.google.cloudbuild.v1P\001" + "ZGgoogle.golang.org/genproto/googleapis/" + "devtools/cloudbuild/v1;cloudbuild\242\002\003GCB\252" - + "\002\032Google.Cloud.CloudBuild.V1\352\002\030Google::C" - + "loud::Build::V1\352AN\n\036compute.googleapis.c" - + "om/Network\022,projects/{project}/global/ne" - + "tworks/{network}\352AY\n!iam.googleapis.com/" - + "ServiceAccount\0224projects/{project}/servi" - + "ceAccounts/{service_account}\352AJ\n#secretm" - + "anager.googleapis.com/Secret\022#projects/{" - + "project}/secrets/{secret}\352Ad\n*secretmana" - + "ger.googleapis.com/SecretVersion\0226projec" - + "ts/{project}/secrets/{secret}/versions/{" - + "version}\352Ap\n!cloudkms.googleapis.com/Cry" - + "ptoKey\022Kprojects/{project}/locations/{lo" - + "cation}/keyRings/{keyring}/cryptoKeys/{k" - + "ey}\352AU\n\"pubsub.googleapis.com/Subscripti" - + "on\022/projects/{project}/subscriptions/{su" - + "bscription}\352A@\n\033pubsub.googleapis.com/To" - + "pic\022!projects/{project}/topics/{topic}b\006" - + "proto3" + + "\002\032Google.Cloud.CloudBuild.V1\312\002\025Google\\Cl" + + "oud\\Build\\V1\352\002\030Google::Cloud::Build::V1\352" + + "AN\n\036compute.googleapis.com/Network\022,proj" + + "ects/{project}/global/networks/{network}" + + "\352AY\n!iam.googleapis.com/ServiceAccount\0224" + + "projects/{project}/serviceAccounts/{serv" + + "ice_account}\352AJ\n#secretmanager.googleapi" + + "s.com/Secret\022#projects/{project}/secrets" + + "/{secret}\352Ad\n*secretmanager.googleapis.c" + + "om/SecretVersion\0226projects/{project}/sec" + + "rets/{secret}/versions/{version}\352Ap\n!clo" + + "udkms.googleapis.com/CryptoKey\022Kprojects" + + "/{project}/locations/{location}/keyRings" + + "/{keyring}/cryptoKeys/{key}\352AU\n\"pubsub.g" + + "oogleapis.com/Subscription\022/projects/{pr" + + "oject}/subscriptions/{subscription}\352A@\n\033" + + "pubsub.googleapis.com/Topic\022!projects/{p" + + "roject}/topics/{topic}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfig.java b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfig.java index 5dff94b21dc6..227da448ad1a 100644 --- a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfig.java +++ b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfig.java @@ -129,7 +129,7 @@ public EventCase getEventCase() { * int64 installation_id = 1 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.GitHubEventsConfig.installation_id is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1507 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1508 * @return The installationId. */ @java.lang.Override @@ -849,7 +849,7 @@ public Builder clearEvent() { * int64 installation_id = 1 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.GitHubEventsConfig.installation_id is deprecated. - * See google/devtools/cloudbuild/v1/cloudbuild.proto;l=1507 + * See google/devtools/cloudbuild/v1/cloudbuild.proto;l=1508 * @return The installationId. */ @java.lang.Override @@ -867,7 +867,7 @@ public long getInstallationId() { * int64 installation_id = 1 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.GitHubEventsConfig.installation_id is deprecated. - * See google/devtools/cloudbuild/v1/cloudbuild.proto;l=1507 + * See google/devtools/cloudbuild/v1/cloudbuild.proto;l=1508 * @param value The installationId to set. * @return This builder for chaining. */ @@ -889,7 +889,7 @@ public Builder setInstallationId(long value) { * int64 installation_id = 1 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.GitHubEventsConfig.installation_id is deprecated. - * See google/devtools/cloudbuild/v1/cloudbuild.proto;l=1507 + * See google/devtools/cloudbuild/v1/cloudbuild.proto;l=1508 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfigOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfigOrBuilder.java index 012bbfe1ae3a..68a1fe71fea8 100644 --- a/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfigOrBuilder.java +++ b/java-cloudbuild/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/GitHubEventsConfigOrBuilder.java @@ -33,7 +33,7 @@ public interface GitHubEventsConfigOrBuilder * int64 installation_id = 1 [deprecated = true]; * * @deprecated google.devtools.cloudbuild.v1.GitHubEventsConfig.installation_id is deprecated. See - * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1507 + * google/devtools/cloudbuild/v1/cloudbuild.proto;l=1508 * @return The installationId. */ @java.lang.Deprecated diff --git a/java-cloudbuild/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto b/java-cloudbuild/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto index c007e65b4411..fdf0bdf7fb20 100644 --- a/java-cloudbuild/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto +++ b/java-cloudbuild/proto-google-cloud-build-v1/src/main/proto/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -33,6 +33,7 @@ option java_multiple_files = true; option java_package = "com.google.cloudbuild.v1"; option objc_class_prefix = "GCB"; option ruby_package = "Google::Cloud::Build::V1"; +option php_namespace = "Google\\Cloud\\Build\\V1"; option (google.api.resource_definition) = { type: "compute.googleapis.com/Network" pattern: "projects/{project}/global/networks/{network}" diff --git a/java-cloudbuild/proto-google-cloud-build-v2/clirr-ignored-differences.xml b/java-cloudbuild/proto-google-cloud-build-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..63b02b3375dd --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + google/devtools/cloudbuild/v2/*OrBuilder + * get*(*) + + + 7012 + google/devtools/cloudbuild/v2/*OrBuilder + boolean contains*(*) + + + 7012 + google/devtools/cloudbuild/v2/*OrBuilder + boolean has*(*) + + diff --git a/java-cloudbuild/proto-google-cloud-build-v2/pom.xml b/java-cloudbuild/proto-google-cloud-build-v2/pom.xml new file mode 100644 index 000000000000..f22d2eb450b9 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-build-v2 + 3.13.0-SNAPSHOT + proto-google-cloud-build-v2 + Proto library for google-cloud-build + + com.google.cloud + google-cloud-build-parent + 3.13.0-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 + + + diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesRequest.java new file mode 100644 index 000000000000..34081ab691f0 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesRequest.java @@ -0,0 +1,1221 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for creating repositoritories in batch.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest} + */ +public final class BatchCreateRepositoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) + BatchCreateRepositoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateRepositoriesRequest.newBuilder() to construct. + private BatchCreateRepositoriesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateRepositoriesRequest() { + parent_ = ""; + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateRepositoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.class, + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The connection to contain all the repositories being created.
+   * Format: projects/*/locations/*/connections/*
+   * The parent field in the CreateRepositoryRequest messages
+   * must either be empty or match this field.
+   * 
+ * + * + * 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 connection to contain all the repositories being created.
+   * Format: projects/*/locations/*/connections/*
+   * The parent field in the CreateRepositoryRequest messages
+   * must either be empty or match this field.
+   * 
+ * + * + * 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 REQUESTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List requests_; + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getRequestsList() { + return requests_; + } + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getRequestsCount() { + return requests_.size(); + } + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateRepositoryRequest getRequests(int index) { + return requests_.get(index); + } + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder getRequestsOrBuilder( + int index) { + return requests_.get(index); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(2, requests_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, requests_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest other = + (google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getRequestsList().equals(other.getRequestsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest 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 google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest 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 google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest 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( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest 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; + } + /** + * + * + *
+   * Message for creating repositoritories in batch.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.class, + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + } else { + requests_ = null; + requestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest + getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest build() { + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest buildPartial() { + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest result = + new google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest result) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + } + + private void buildPartial0( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @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 google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest other) { + if (other + == google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000002); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRequestsFieldBuilder() + : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + google.devtools.cloudbuild.v2.CreateRepositoryRequest m = + input.readMessage( + google.devtools.cloudbuild.v2.CreateRepositoryRequest.parser(), + extensionRegistry); + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(m); + } else { + requestsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The connection to contain all the repositories being created.
+     * Format: projects/*/locations/*/connections/*
+     * The parent field in the CreateRepositoryRequest messages
+     * must either be empty or match this field.
+     * 
+ * + * + * 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 connection to contain all the repositories being created.
+     * Format: projects/*/locations/*/connections/*
+     * The parent field in the CreateRepositoryRequest messages
+     * must either be empty or match this field.
+     * 
+ * + * + * 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 connection to contain all the repositories being created.
+     * Format: projects/*/locations/*/connections/*
+     * The parent field in the CreateRepositoryRequest messages
+     * must either be empty or match this field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The connection to contain all the repositories being created.
+     * Format: projects/*/locations/*/connections/*
+     * The parent field in the CreateRepositoryRequest messages
+     * must either be empty or match this field.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The connection to contain all the repositories being created.
+     * Format: projects/*/locations/*/connections/*
+     * The parent field in the CreateRepositoryRequest messages
+     * must either be empty or match this field.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List requests_ = + java.util.Collections.emptyList(); + + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + requests_ = + new java.util.ArrayList( + requests_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, + google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder, + google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder> + requestsBuilder_; + + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.CreateRepositoryRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + int index, google.devtools.cloudbuild.v2.CreateRepositoryRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRequests( + int index, google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests(google.devtools.cloudbuild.v2.CreateRepositoryRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests( + int index, google.devtools.cloudbuild.v2.CreateRepositoryRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests( + google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRequests( + int index, google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllRequests( + java.lang.Iterable + values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder getRequestsBuilder( + int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder getRequestsOrBuilder( + int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder(google.devtools.cloudbuild.v2.CreateRepositoryRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder addRequestsBuilder( + int index) { + return getRequestsFieldBuilder() + .addBuilder( + index, google.devtools.cloudbuild.v2.CreateRepositoryRequest.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The request messages specifying the repositories to create.
+     * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, + google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder, + google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.CreateRepositoryRequest, + google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder, + google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder>( + requests_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + @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.cloudbuild.v2.BatchCreateRepositoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) + private static final google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest(); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateRepositoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesRequestOrBuilder.java new file mode 100644 index 000000000000..0988d1af54f3 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface BatchCreateRepositoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The connection to contain all the repositories being created.
+   * Format: projects/*/locations/*/connections/*
+   * The parent field in the CreateRepositoryRequest messages
+   * must either be empty or match this field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The connection to contain all the repositories being created.
+   * Format: projects/*/locations/*/connections/*
+   * The parent field in the CreateRepositoryRequest messages
+   * must either be empty or match this field.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getRequestsList(); + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + google.devtools.cloudbuild.v2.CreateRepositoryRequest getRequests(int index); + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getRequestsCount(); + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getRequestsOrBuilderList(); + /** + * + * + *
+   * Required. The request messages specifying the repositories to create.
+   * 
+ * + * + * repeated .google.devtools.cloudbuild.v2.CreateRepositoryRequest requests = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder getRequestsOrBuilder(int index); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesResponse.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesResponse.java new file mode 100644 index 000000000000..4477c8f06af6 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesResponse.java @@ -0,0 +1,948 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for response of creating repositories in batch.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse} + */ +public final class BatchCreateRepositoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) + BatchCreateRepositoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchCreateRepositoriesResponse.newBuilder() to construct. + private BatchCreateRepositoriesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchCreateRepositoriesResponse() { + repositories_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateRepositoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.class, + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.Builder.class); + } + + public static final int REPOSITORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List repositories_; + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List getRepositoriesList() { + return repositories_; + } + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List + getRepositoriesOrBuilderList() { + return repositories_; + } + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public int getRepositoriesCount() { + return repositories_.size(); + } + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository getRepositories(int index) { + return repositories_.get(index); + } + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index) { + return repositories_.get(index); + } + + 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)); + } + getUnknownFields().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)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse other = + (google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) obj; + + if (!getRepositoriesList().equals(other.getRepositoriesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse 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 google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse 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 google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse 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( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse 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; + } + /** + * + * + *
+   * Message for response of creating repositories in batch.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.class, + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + } else { + repositories_ = null; + repositoriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse + getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse build() { + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse buildPartial() { + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse result = + new google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse result) { + if (repositoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + repositories_ = java.util.Collections.unmodifiableList(repositories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.repositories_ = repositories_; + } else { + result.repositories_ = repositoriesBuilder_.build(); + } + } + + private void buildPartial0( + google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse result) { + int from_bitField0_ = bitField0_; + } + + @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 google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) { + return mergeFrom((google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse other) { + if (other + == google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse.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_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + google.devtools.cloudbuild.v2.Repository m = + input.readMessage( + google.devtools.cloudbuild.v2.Repository.parser(), extensionRegistry); + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(m); + } else { + repositoriesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + repositoriesBuilder_; + + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List getRepositoriesList() { + if (repositoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(repositories_); + } else { + return repositoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public int getRepositoriesCount() { + if (repositoriesBuilder_ == null) { + return repositories_.size(); + } else { + return repositoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository getRepositories(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder setRepositories(int index, google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.set(index, value); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder setRepositories( + int index, google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.set(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories(google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories(int index, google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(index, value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories( + google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories( + int index, google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.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; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder clearRepositories() { + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + repositoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder removeRepositories(int index) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.remove(index); + onChanged(); + } else { + repositoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder getRepositoriesBuilder(int index) { + return getRepositoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List + getRepositoriesOrBuilderList() { + if (repositoriesBuilder_ != null) { + return repositoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(repositories_); + } + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder addRepositoriesBuilder() { + return getRepositoriesFieldBuilder() + .addBuilder(google.devtools.cloudbuild.v2.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder addRepositoriesBuilder(int index) { + return getRepositoriesFieldBuilder() + .addBuilder(index, google.devtools.cloudbuild.v2.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * Repository resources created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List + getRepositoriesBuilderList() { + return getRepositoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + getRepositoriesFieldBuilder() { + if (repositoriesBuilder_ == null) { + repositoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder>( + repositories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + repositories_ = null; + } + return repositoriesBuilder_; + } + + @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.cloudbuild.v2.BatchCreateRepositoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) + private static final google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse(); + } + + public static google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateRepositoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesResponseOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesResponseOrBuilder.java new file mode 100644 index 000000000000..66a73d7c3261 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/BatchCreateRepositoriesResponseOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface BatchCreateRepositoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + java.util.List getRepositoriesList(); + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + google.devtools.cloudbuild.v2.Repository getRepositories(int index); + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + int getRepositoriesCount(); + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + java.util.List + getRepositoriesOrBuilderList(); + /** + * + * + *
+   * Repository resources created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CloudBuildProto.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CloudBuildProto.java new file mode 100644 index 000000000000..32b8c50c934d --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CloudBuildProto.java @@ -0,0 +1,137 @@ +/* + * 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/cloudbuild/v2/cloudbuild.proto + +package google.devtools.cloudbuild.v2; + +public final class CloudBuildProto { + private CloudBuildProto() {} + + 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_cloudbuild_v2_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/devtools/cloudbuild/v2/cloudbui" + + "ld.proto\022\035google.devtools.cloudbuild.v2\032" + + "\034google/api/annotations.proto\032\027google/ap" + + "i/client.proto\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032\037goog" + + "le/protobuf/timestamp.proto\"\200\002\n\021Operatio" + + "nMetadata\0224\n\013create_time\030\001 \001(\0132\032.google." + + "protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n\006ta" + + "rget\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016st" + + "atus_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_can" + + "cellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(" + + "\tB\003\340A\003\"\222\002\n\"RunWorkflowCustomOperationMet" + + "adata\0224\n\013create_time\030\001 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\022\021\n\004verb\030\003" + + " \001(\tB\003\340A\003\022#\n\026requested_cancellation\030\004 \001(" + + "\010B\003\340A\003\022\030\n\013api_version\030\005 \001(\tB\003\340A\003\022\023\n\006targ" + + "et\030\006 \001(\tB\003\340A\003\022\034\n\017pipeline_run_id\030\007 \001(\tB\003" + + "\340A\003B\261\005\n\035google.devtools.cloudbuild.v2B\017C" + + "loudBuildProtoP\001ZGgoogle.golang.org/genp" + + "roto/googleapis/devtools/cloudbuild/v2;c" + + "loudbuild\242\002\003GCB\252\002\032Google.Cloud.CloudBuil" + + "d.V2\312\002\025Google\\Cloud\\Build\\V2\352\002\030Google::C" + + "loud::Build::V2\352AN\n\036compute.googleapis.c" + + "om/Network\022,projects/{project}/global/ne" + + "tworks/{network}\352AY\n!iam.googleapis.com/" + + "ServiceAccount\0224projects/{project}/servi" + + "ceAccounts/{service_account}\352AJ\n#secretm" + + "anager.googleapis.com/Secret\022#projects/{" + + "project}/secrets/{secret}\352Ad\n*secretmana" + + "ger.googleapis.com/SecretVersion\0226projec" + + "ts/{project}/secrets/{secret}/versions/{" + + "version}\352A|\n0cloudbuild.googleapis.com/g" + + "ithubEnterpriseConfig\022Hprojects/{project" + + "}/locations/{location}/githubEnterpriseC" + + "onfigs/{config}b\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.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_devtools_cloudbuild_v2_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_devtools_cloudbuild_v2_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Verb", + "RequestedCancellation", + "ApiVersion", + "Target", + "PipelineRunId", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceDefinition); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/Connection.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/Connection.java new file mode 100644 index 000000000000..ad9dbf104500 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/Connection.java @@ -0,0 +1,2913 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Server or
+ * GitLab.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.Connection} + */ +public final class Connection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.Connection) + ConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Connection.newBuilder() to construct. + private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Connection() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Connection(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Connection_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 15: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Connection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.Connection.class, + google.devtools.cloudbuild.v2.Connection.Builder.class); + } + + private int connectionConfigCase_ = 0; + private java.lang.Object connectionConfig_; + + public enum ConnectionConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GITHUB_CONFIG(5), + GITHUB_ENTERPRISE_CONFIG(6), + CONNECTIONCONFIG_NOT_SET(0); + private final int value; + + private ConnectionConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConnectionConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConnectionConfigCase forNumber(int value) { + switch (value) { + case 5: + return GITHUB_CONFIG; + case 6: + return GITHUB_ENTERPRISE_CONFIG; + case 0: + return CONNECTIONCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConnectionConfigCase getConnectionConfigCase() { + return ConnectionConfigCase.forNumber(connectionConfigCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. The resource name of the connection, in the format
+   * `projects/{project}/locations/{location}/connections/{connection_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. The resource name of the connection, in the format
+   * `projects/{project}/locations/{location}/connections/{connection_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int GITHUB_CONFIG_FIELD_NUMBER = 5; + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + * + * @return Whether the githubConfig field is set. + */ + @java.lang.Override + public boolean hasGithubConfig() { + return connectionConfigCase_ == 5; + } + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + * + * @return The githubConfig. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfig getGithubConfig() { + if (connectionConfigCase_ == 5) { + return (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfigOrBuilder getGithubConfigOrBuilder() { + if (connectionConfigCase_ == 5) { + return (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } + + public static final int GITHUB_ENTERPRISE_CONFIG_FIELD_NUMBER = 6; + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + * + * @return Whether the githubEnterpriseConfig field is set. + */ + @java.lang.Override + public boolean hasGithubEnterpriseConfig() { + return connectionConfigCase_ == 6; + } + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + * + * @return The githubEnterpriseConfig. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig getGithubEnterpriseConfig() { + if (connectionConfigCase_ == 6) { + return (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder + getGithubEnterpriseConfigOrBuilder() { + if (connectionConfigCase_ == 6) { + return (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } + + public static final int INSTALLATION_STATE_FIELD_NUMBER = 12; + private google.devtools.cloudbuild.v2.InstallationState installationState_; + /** + * + * + *
+   * Output only. Installation state of the Connection.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the installationState field is set. + */ + @java.lang.Override + public boolean hasInstallationState() { + return installationState_ != null; + } + /** + * + * + *
+   * Output only. Installation state of the Connection.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The installationState. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState getInstallationState() { + return installationState_ == null + ? google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance() + : installationState_; + } + /** + * + * + *
+   * Output only. Installation state of the Connection.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationStateOrBuilder getInstallationStateOrBuilder() { + return installationState_ == null + ? google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance() + : installationState_; + } + + public static final int DISABLED_FIELD_NUMBER = 13; + private boolean disabled_ = false; + /** + * + * + *
+   * If disabled is set to true, functionality is disabled for this connection.
+   * Repository based API methods and webhooks processing for repositories in
+   * this connection will be disabled.
+   * 
+ * + * bool disabled = 13; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int RECONCILING_FIELD_NUMBER = 14; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Set to true when the connection is being set up or updated in
+   * the background.
+   * 
+ * + * bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 15; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Connection_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ETAG_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 16; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 16; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + if (connectionConfigCase_ == 5) { + output.writeMessage(5, (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_); + } + if (connectionConfigCase_ == 6) { + output.writeMessage( + 6, (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_); + } + if (installationState_ != null) { + output.writeMessage(12, getInstallationState()); + } + if (disabled_ != false) { + output.writeBool(13, disabled_); + } + if (reconciling_ != false) { + output.writeBool(14, reconciling_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 15); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (connectionConfigCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_); + } + if (connectionConfigCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_); + } + if (installationState_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getInstallationState()); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, disabled_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, reconciling_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, annotations__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.Connection)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.Connection other = (google.devtools.cloudbuild.v2.Connection) obj; + + if (!getName().equals(other.getName())) 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 (hasInstallationState() != other.hasInstallationState()) return false; + if (hasInstallationState()) { + if (!getInstallationState().equals(other.getInstallationState())) return false; + } + if (getDisabled() != other.getDisabled()) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getConnectionConfigCase().equals(other.getConnectionConfigCase())) return false; + switch (connectionConfigCase_) { + case 5: + if (!getGithubConfig().equals(other.getGithubConfig())) return false; + break; + case 6: + if (!getGithubEnterpriseConfig().equals(other.getGithubEnterpriseConfig())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + 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(); + } + if (hasInstallationState()) { + hash = (37 * hash) + INSTALLATION_STATE_FIELD_NUMBER; + hash = (53 * hash) + getInstallationState().hashCode(); + } + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + switch (connectionConfigCase_) { + case 5: + hash = (37 * hash) + GITHUB_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGithubConfig().hashCode(); + break; + case 6: + hash = (37 * hash) + GITHUB_ENTERPRISE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getGithubEnterpriseConfig().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.Connection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.Connection 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 google.devtools.cloudbuild.v2.Connection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.Connection 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 google.devtools.cloudbuild.v2.Connection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.Connection 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(google.devtools.cloudbuild.v2.Connection 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 connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Server or
+   * GitLab.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.Connection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.Connection) + google.devtools.cloudbuild.v2.ConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Connection_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 15: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 15: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Connection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.Connection.class, + google.devtools.cloudbuild.v2.Connection.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.Connection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + if (githubConfigBuilder_ != null) { + githubConfigBuilder_.clear(); + } + if (githubEnterpriseConfigBuilder_ != null) { + githubEnterpriseConfigBuilder_.clear(); + } + installationState_ = null; + if (installationStateBuilder_ != null) { + installationStateBuilder_.dispose(); + installationStateBuilder_ = null; + } + disabled_ = false; + reconciling_ = false; + internalGetMutableAnnotations().clear(); + etag_ = ""; + connectionConfigCase_ = 0; + connectionConfig_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Connection_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.Connection.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection build() { + google.devtools.cloudbuild.v2.Connection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection buildPartial() { + google.devtools.cloudbuild.v2.Connection result = + new google.devtools.cloudbuild.v2.Connection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.Connection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.installationState_ = + installationStateBuilder_ == null + ? installationState_ + : installationStateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.disabled_ = disabled_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.etag_ = etag_; + } + } + + private void buildPartialOneofs(google.devtools.cloudbuild.v2.Connection result) { + result.connectionConfigCase_ = connectionConfigCase_; + result.connectionConfig_ = this.connectionConfig_; + if (connectionConfigCase_ == 5 && githubConfigBuilder_ != null) { + result.connectionConfig_ = githubConfigBuilder_.build(); + } + if (connectionConfigCase_ == 6 && githubEnterpriseConfigBuilder_ != null) { + result.connectionConfig_ = githubEnterpriseConfigBuilder_.build(); + } + } + + @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 google.devtools.cloudbuild.v2.Connection) { + return mergeFrom((google.devtools.cloudbuild.v2.Connection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.Connection other) { + if (other == google.devtools.cloudbuild.v2.Connection.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasInstallationState()) { + mergeInstallationState(other.getInstallationState()); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000100; + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000200; + onChanged(); + } + switch (other.getConnectionConfigCase()) { + case GITHUB_CONFIG: + { + mergeGithubConfig(other.getGithubConfig()); + break; + } + case GITHUB_ENTERPRISE_CONFIG: + { + mergeGithubEnterpriseConfig(other.getGithubEnterpriseConfig()); + break; + } + case CONNECTIONCONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage(getGithubConfigFieldBuilder().getBuilder(), extensionRegistry); + connectionConfigCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + getGithubEnterpriseConfigFieldBuilder().getBuilder(), extensionRegistry); + connectionConfigCase_ = 6; + break; + } // case 50 + case 98: + { + input.readMessage( + getInstallationStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 98 + case 104: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 104 + case 112: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 112 + case 122: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 122 + case 130: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 130 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int connectionConfigCase_ = 0; + private java.lang.Object connectionConfig_; + + public ConnectionConfigCase getConnectionConfigCase() { + return ConnectionConfigCase.forNumber(connectionConfigCase_); + } + + public Builder clearConnectionConfig() { + connectionConfigCase_ = 0; + connectionConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The resource name of the connection, in the format
+     * `projects/{project}/locations/{location}/connections/{connection_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. The resource name of the connection, in the format
+     * `projects/{project}/locations/{location}/connections/{connection_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. The resource name of the connection, in the format
+     * `projects/{project}/locations/{location}/connections/{connection_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the connection, in the format
+     * `projects/{project}/locations/{location}/connections/{connection_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the connection, in the format
+     * `projects/{project}/locations/{location}/connections/{connection_id}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + 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_; + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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_; + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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 com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.GitHubConfig, + google.devtools.cloudbuild.v2.GitHubConfig.Builder, + google.devtools.cloudbuild.v2.GitHubConfigOrBuilder> + githubConfigBuilder_; + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + * + * @return Whether the githubConfig field is set. + */ + @java.lang.Override + public boolean hasGithubConfig() { + return connectionConfigCase_ == 5; + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + * + * @return The githubConfig. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfig getGithubConfig() { + if (githubConfigBuilder_ == null) { + if (connectionConfigCase_ == 5) { + return (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } else { + if (connectionConfigCase_ == 5) { + return githubConfigBuilder_.getMessage(); + } + return google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + public Builder setGithubConfig(google.devtools.cloudbuild.v2.GitHubConfig value) { + if (githubConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionConfig_ = value; + onChanged(); + } else { + githubConfigBuilder_.setMessage(value); + } + connectionConfigCase_ = 5; + return this; + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + public Builder setGithubConfig( + google.devtools.cloudbuild.v2.GitHubConfig.Builder builderForValue) { + if (githubConfigBuilder_ == null) { + connectionConfig_ = builderForValue.build(); + onChanged(); + } else { + githubConfigBuilder_.setMessage(builderForValue.build()); + } + connectionConfigCase_ = 5; + return this; + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + public Builder mergeGithubConfig(google.devtools.cloudbuild.v2.GitHubConfig value) { + if (githubConfigBuilder_ == null) { + if (connectionConfigCase_ == 5 + && connectionConfig_ + != google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance()) { + connectionConfig_ = + google.devtools.cloudbuild.v2.GitHubConfig.newBuilder( + (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + connectionConfig_ = value; + } + onChanged(); + } else { + if (connectionConfigCase_ == 5) { + githubConfigBuilder_.mergeFrom(value); + } else { + githubConfigBuilder_.setMessage(value); + } + } + connectionConfigCase_ = 5; + return this; + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + public Builder clearGithubConfig() { + if (githubConfigBuilder_ == null) { + if (connectionConfigCase_ == 5) { + connectionConfigCase_ = 0; + connectionConfig_ = null; + onChanged(); + } + } else { + if (connectionConfigCase_ == 5) { + connectionConfigCase_ = 0; + connectionConfig_ = null; + } + githubConfigBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + public google.devtools.cloudbuild.v2.GitHubConfig.Builder getGithubConfigBuilder() { + return getGithubConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfigOrBuilder getGithubConfigOrBuilder() { + if ((connectionConfigCase_ == 5) && (githubConfigBuilder_ != null)) { + return githubConfigBuilder_.getMessageOrBuilder(); + } else { + if (connectionConfigCase_ == 5) { + return (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * Configuration for connections to github.com.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.GitHubConfig, + google.devtools.cloudbuild.v2.GitHubConfig.Builder, + google.devtools.cloudbuild.v2.GitHubConfigOrBuilder> + getGithubConfigFieldBuilder() { + if (githubConfigBuilder_ == null) { + if (!(connectionConfigCase_ == 5)) { + connectionConfig_ = google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } + githubConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.GitHubConfig, + google.devtools.cloudbuild.v2.GitHubConfig.Builder, + google.devtools.cloudbuild.v2.GitHubConfigOrBuilder>( + (google.devtools.cloudbuild.v2.GitHubConfig) connectionConfig_, + getParentForChildren(), + isClean()); + connectionConfig_ = null; + } + connectionConfigCase_ = 5; + onChanged(); + return githubConfigBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder> + githubEnterpriseConfigBuilder_; + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + * + * @return Whether the githubEnterpriseConfig field is set. + */ + @java.lang.Override + public boolean hasGithubEnterpriseConfig() { + return connectionConfigCase_ == 6; + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + * + * @return The githubEnterpriseConfig. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig getGithubEnterpriseConfig() { + if (githubEnterpriseConfigBuilder_ == null) { + if (connectionConfigCase_ == 6) { + return (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } else { + if (connectionConfigCase_ == 6) { + return githubEnterpriseConfigBuilder_.getMessage(); + } + return google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + public Builder setGithubEnterpriseConfig( + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig value) { + if (githubEnterpriseConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionConfig_ = value; + onChanged(); + } else { + githubEnterpriseConfigBuilder_.setMessage(value); + } + connectionConfigCase_ = 6; + return this; + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + public Builder setGithubEnterpriseConfig( + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder builderForValue) { + if (githubEnterpriseConfigBuilder_ == null) { + connectionConfig_ = builderForValue.build(); + onChanged(); + } else { + githubEnterpriseConfigBuilder_.setMessage(builderForValue.build()); + } + connectionConfigCase_ = 6; + return this; + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + public Builder mergeGithubEnterpriseConfig( + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig value) { + if (githubEnterpriseConfigBuilder_ == null) { + if (connectionConfigCase_ == 6 + && connectionConfig_ + != google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance()) { + connectionConfig_ = + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.newBuilder( + (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + connectionConfig_ = value; + } + onChanged(); + } else { + if (connectionConfigCase_ == 6) { + githubEnterpriseConfigBuilder_.mergeFrom(value); + } else { + githubEnterpriseConfigBuilder_.setMessage(value); + } + } + connectionConfigCase_ = 6; + return this; + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + public Builder clearGithubEnterpriseConfig() { + if (githubEnterpriseConfigBuilder_ == null) { + if (connectionConfigCase_ == 6) { + connectionConfigCase_ = 0; + connectionConfig_ = null; + onChanged(); + } + } else { + if (connectionConfigCase_ == 6) { + connectionConfigCase_ = 0; + connectionConfig_ = null; + } + githubEnterpriseConfigBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder + getGithubEnterpriseConfigBuilder() { + return getGithubEnterpriseConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder + getGithubEnterpriseConfigOrBuilder() { + if ((connectionConfigCase_ == 6) && (githubEnterpriseConfigBuilder_ != null)) { + return githubEnterpriseConfigBuilder_.getMessageOrBuilder(); + } else { + if (connectionConfigCase_ == 6) { + return (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_; + } + return google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * Configuration for connections to an instance of GitHub Enterprise.
+     * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder> + getGithubEnterpriseConfigFieldBuilder() { + if (githubEnterpriseConfigBuilder_ == null) { + if (!(connectionConfigCase_ == 6)) { + connectionConfig_ = + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } + githubEnterpriseConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder>( + (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) connectionConfig_, + getParentForChildren(), + isClean()); + connectionConfig_ = null; + } + connectionConfigCase_ = 6; + onChanged(); + return githubEnterpriseConfigBuilder_; + } + + private google.devtools.cloudbuild.v2.InstallationState installationState_; + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.InstallationState, + google.devtools.cloudbuild.v2.InstallationState.Builder, + google.devtools.cloudbuild.v2.InstallationStateOrBuilder> + installationStateBuilder_; + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the installationState field is set. + */ + public boolean hasInstallationState() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The installationState. + */ + public google.devtools.cloudbuild.v2.InstallationState getInstallationState() { + if (installationStateBuilder_ == null) { + return installationState_ == null + ? google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance() + : installationState_; + } else { + return installationStateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstallationState(google.devtools.cloudbuild.v2.InstallationState value) { + if (installationStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + installationState_ = value; + } else { + installationStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setInstallationState( + google.devtools.cloudbuild.v2.InstallationState.Builder builderForValue) { + if (installationStateBuilder_ == null) { + installationState_ = builderForValue.build(); + } else { + installationStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeInstallationState(google.devtools.cloudbuild.v2.InstallationState value) { + if (installationStateBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && installationState_ != null + && installationState_ + != google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance()) { + getInstallationStateBuilder().mergeFrom(value); + } else { + installationState_ = value; + } + } else { + installationStateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearInstallationState() { + bitField0_ = (bitField0_ & ~0x00000020); + installationState_ = null; + if (installationStateBuilder_ != null) { + installationStateBuilder_.dispose(); + installationStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public google.devtools.cloudbuild.v2.InstallationState.Builder getInstallationStateBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getInstallationStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public google.devtools.cloudbuild.v2.InstallationStateOrBuilder + getInstallationStateOrBuilder() { + if (installationStateBuilder_ != null) { + return installationStateBuilder_.getMessageOrBuilder(); + } else { + return installationState_ == null + ? google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance() + : installationState_; + } + } + /** + * + * + *
+     * Output only. Installation state of the Connection.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.InstallationState, + google.devtools.cloudbuild.v2.InstallationState.Builder, + google.devtools.cloudbuild.v2.InstallationStateOrBuilder> + getInstallationStateFieldBuilder() { + if (installationStateBuilder_ == null) { + installationStateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.InstallationState, + google.devtools.cloudbuild.v2.InstallationState.Builder, + google.devtools.cloudbuild.v2.InstallationStateOrBuilder>( + getInstallationState(), getParentForChildren(), isClean()); + installationState_ = null; + } + return installationStateBuilder_; + } + + private boolean disabled_; + /** + * + * + *
+     * If disabled is set to true, functionality is disabled for this connection.
+     * Repository based API methods and webhooks processing for repositories in
+     * this connection will be disabled.
+     * 
+ * + * bool disabled = 13; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + /** + * + * + *
+     * If disabled is set to true, functionality is disabled for this connection.
+     * Repository based API methods and webhooks processing for repositories in
+     * this connection will be disabled.
+     * 
+ * + * bool disabled = 13; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * If disabled is set to true, functionality is disabled for this connection.
+     * Repository based API methods and webhooks processing for repositories in
+     * this connection will be disabled.
+     * 
+ * + * bool disabled = 13; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000040); + disabled_ = false; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Set to true when the connection is being set up or updated in
+     * the background.
+     * 
+ * + * bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Set to true when the connection is being set up or updated in
+     * the background.
+     * 
+ * + * bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Set to true when the connection is being set up or updated in
+     * the background.
+     * 
+ * + * bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000080); + reconciling_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000100; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000100; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 15; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 16; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 16; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 16; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 16; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 16; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000200; + 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.cloudbuild.v2.Connection) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.Connection) + private static final google.devtools.cloudbuild.v2.Connection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.Connection(); + } + + public static google.devtools.cloudbuild.v2.Connection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Connection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ConnectionName.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ConnectionName.java new file mode 100644 index 000000000000..ed9be7b77060 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ConnectionName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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 ConnectionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CONNECTION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/connections/{connection}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String connection; + + @Deprecated + protected ConnectionName() { + project = null; + location = null; + connection = null; + } + + private ConnectionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + connection = Preconditions.checkNotNull(builder.getConnection()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConnection() { + return connection; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ConnectionName of(String project, String location, String connection) { + return newBuilder().setProject(project).setLocation(location).setConnection(connection).build(); + } + + public static String format(String project, String location, String connection) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setConnection(connection) + .build() + .toString(); + } + + public static ConnectionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CONNECTION.validatedMatch( + formattedString, "ConnectionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("connection")); + } + + 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 (ConnectionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CONNECTION.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 (connection != null) { + fieldMapBuilder.put("connection", connection); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CONNECTION.instantiate( + "project", project, "location", location, "connection", connection); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ConnectionName that = ((ConnectionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.connection, that.connection); + } + 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(connection); + return h; + } + + /** Builder for projects/{project}/locations/{location}/connections/{connection}. */ + public static class Builder { + private String project; + private String location; + private String connection; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConnection() { + return connection; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setConnection(String connection) { + this.connection = connection; + return this; + } + + private Builder(ConnectionName connectionName) { + this.project = connectionName.project; + this.location = connectionName.location; + this.connection = connectionName.connection; + } + + public ConnectionName build() { + return new ConnectionName(this); + } + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ConnectionOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ConnectionOrBuilder.java new file mode 100644 index 000000000000..db1301c7aeab --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ConnectionOrBuilder.java @@ -0,0 +1,361 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface ConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.Connection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The resource name of the connection, in the format
+   * `projects/{project}/locations/{location}/connections/{connection_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The resource name of the connection, in the format
+   * `projects/{project}/locations/{location}/connections/{connection_id}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + * + * @return Whether the githubConfig field is set. + */ + boolean hasGithubConfig(); + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + * + * @return The githubConfig. + */ + google.devtools.cloudbuild.v2.GitHubConfig getGithubConfig(); + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubConfig github_config = 5; + */ + google.devtools.cloudbuild.v2.GitHubConfigOrBuilder getGithubConfigOrBuilder(); + + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + * + * @return Whether the githubEnterpriseConfig field is set. + */ + boolean hasGithubEnterpriseConfig(); + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + * + * @return The githubEnterpriseConfig. + */ + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig getGithubEnterpriseConfig(); + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * .google.devtools.cloudbuild.v2.GitHubEnterpriseConfig github_enterprise_config = 6; + * + */ + google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder + getGithubEnterpriseConfigOrBuilder(); + + /** + * + * + *
+   * Output only. Installation state of the Connection.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the installationState field is set. + */ + boolean hasInstallationState(); + /** + * + * + *
+   * Output only. Installation state of the Connection.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The installationState. + */ + google.devtools.cloudbuild.v2.InstallationState getInstallationState(); + /** + * + * + *
+   * Output only. Installation state of the Connection.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + google.devtools.cloudbuild.v2.InstallationStateOrBuilder getInstallationStateOrBuilder(); + + /** + * + * + *
+   * If disabled is set to true, functionality is disabled for this connection.
+   * Repository based API methods and webhooks processing for repositories in
+   * this connection will be disabled.
+   * 
+ * + * bool disabled = 13; + * + * @return The disabled. + */ + boolean getDisabled(); + + /** + * + * + *
+   * Output only. Set to true when the connection is being set up or updated in
+   * the background.
+   * 
+ * + * bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 15; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 16; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 16; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + public google.devtools.cloudbuild.v2.Connection.ConnectionConfigCase getConnectionConfigCase(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateConnectionRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateConnectionRequest.java new file mode 100644 index 000000000000..8ea074707727 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateConnectionRequest.java @@ -0,0 +1,1142 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for creating a Connection
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.CreateConnectionRequest} + */ +public final class CreateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.CreateConnectionRequest) + CreateConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateConnectionRequest.newBuilder() to construct. + private CreateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateConnectionRequest() { + parent_ = ""; + connectionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.CreateConnectionRequest.class, + google.devtools.cloudbuild.v2.CreateConnectionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Project and location where the connection will be created.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * 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. Project and location where the connection will be created.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * 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 CONNECTION_FIELD_NUMBER = 2; + private google.devtools.cloudbuild.v2.Connection connection_; + /** + * + * + *
+   * Required. The Connection to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + @java.lang.Override + public boolean hasConnection() { + return connection_ != null; + } + /** + * + * + *
+   * Required. The Connection to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection getConnection() { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } + /** + * + * + *
+   * Required. The Connection to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionOrBuilder() { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } + + public static final int CONNECTION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the Connection, which will become the final
+   * component of the Connection's resource name. Names must be unique
+   * per-project per-location. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The connectionId. + */ + @java.lang.Override + public java.lang.String getConnectionId() { + java.lang.Object ref = connectionId_; + 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(); + connectionId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the Connection, which will become the final
+   * component of the Connection's resource name. Names must be unique
+   * per-project per-location. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for connectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionIdBytes() { + java.lang.Object ref = connectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (connection_ != null) { + output.writeMessage(2, getConnection()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(connectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, connectionId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (connection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConnection()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(connectionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, connectionId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.CreateConnectionRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.CreateConnectionRequest other = + (google.devtools.cloudbuild.v2.CreateConnectionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasConnection() != other.hasConnection()) return false; + if (hasConnection()) { + if (!getConnection().equals(other.getConnection())) return false; + } + if (!getConnectionId().equals(other.getConnectionId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasConnection()) { + hash = (37 * hash) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().hashCode(); + } + hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest 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 google.devtools.cloudbuild.v2.CreateConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest 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 google.devtools.cloudbuild.v2.CreateConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest 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( + google.devtools.cloudbuild.v2.CreateConnectionRequest 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; + } + /** + * + * + *
+   * Message for creating a Connection
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.CreateConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.CreateConnectionRequest) + google.devtools.cloudbuild.v2.CreateConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.CreateConnectionRequest.class, + google.devtools.cloudbuild.v2.CreateConnectionRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.CreateConnectionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + connection_ = null; + if (connectionBuilder_ != null) { + connectionBuilder_.dispose(); + connectionBuilder_ = null; + } + connectionId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateConnectionRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.CreateConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateConnectionRequest build() { + google.devtools.cloudbuild.v2.CreateConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateConnectionRequest buildPartial() { + google.devtools.cloudbuild.v2.CreateConnectionRequest result = + new google.devtools.cloudbuild.v2.CreateConnectionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.CreateConnectionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.connection_ = connectionBuilder_ == null ? connection_ : connectionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.connectionId_ = connectionId_; + } + } + + @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 google.devtools.cloudbuild.v2.CreateConnectionRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.CreateConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.CreateConnectionRequest other) { + if (other == google.devtools.cloudbuild.v2.CreateConnectionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasConnection()) { + mergeConnection(other.getConnection()); + } + if (!other.getConnectionId().isEmpty()) { + connectionId_ = other.connectionId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getConnectionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + connectionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Project and location where the connection will be created.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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. Project and location where the connection will be created.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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. Project and location where the connection will be created.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Project and location where the connection will be created.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Project and location where the connection will be created.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private google.devtools.cloudbuild.v2.Connection connection_; + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder> + connectionBuilder_; + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public google.devtools.cloudbuild.v2.Connection getConnection() { + if (connectionBuilder_ == null) { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } else { + return connectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection(google.devtools.cloudbuild.v2.Connection value) { + if (connectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + } else { + connectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection(google.devtools.cloudbuild.v2.Connection.Builder builderForValue) { + if (connectionBuilder_ == null) { + connection_ = builderForValue.build(); + } else { + connectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConnection(google.devtools.cloudbuild.v2.Connection value) { + if (connectionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && connection_ != null + && connection_ != google.devtools.cloudbuild.v2.Connection.getDefaultInstance()) { + getConnectionBuilder().mergeFrom(value); + } else { + connection_ = value; + } + } else { + connectionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConnection() { + bitField0_ = (bitField0_ & ~0x00000002); + connection_ = null; + if (connectionBuilder_ != null) { + connectionBuilder_.dispose(); + connectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.Connection.Builder getConnectionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionOrBuilder() { + if (connectionBuilder_ != null) { + return connectionBuilder_.getMessageOrBuilder(); + } else { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } + } + /** + * + * + *
+     * Required. The Connection to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder> + getConnectionFieldBuilder() { + if (connectionBuilder_ == null) { + connectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder>( + getConnection(), getParentForChildren(), isClean()); + connection_ = null; + } + return connectionBuilder_; + } + + private java.lang.Object connectionId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the Connection, which will become the final
+     * component of the Connection's resource name. Names must be unique
+     * per-project per-location. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The connectionId. + */ + public java.lang.String getConnectionId() { + java.lang.Object ref = connectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Connection, which will become the final
+     * component of the Connection's resource name. Names must be unique
+     * per-project per-location. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for connectionId. + */ + public com.google.protobuf.ByteString getConnectionIdBytes() { + java.lang.Object ref = connectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the Connection, which will become the final
+     * component of the Connection's resource name. Names must be unique
+     * per-project per-location. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Connection, which will become the final
+     * component of the Connection's resource name. Names must be unique
+     * per-project per-location. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearConnectionId() { + connectionId_ = getDefaultInstance().getConnectionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the Connection, which will become the final
+     * component of the Connection's resource name. Names must be unique
+     * per-project per-location. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionId_ = value; + bitField0_ |= 0x00000004; + 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.cloudbuild.v2.CreateConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.CreateConnectionRequest) + private static final google.devtools.cloudbuild.v2.CreateConnectionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.CreateConnectionRequest(); + } + + public static google.devtools.cloudbuild.v2.CreateConnectionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateConnectionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateConnectionRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..4d9c1d75033c --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateConnectionRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface CreateConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.CreateConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Project and location where the connection will be created.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Project and location where the connection will be created.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Connection to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + boolean hasConnection(); + /** + * + * + *
+   * Required. The Connection to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + google.devtools.cloudbuild.v2.Connection getConnection(); + /** + * + * + *
+   * Required. The Connection to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the Connection, which will become the final
+   * component of the Connection's resource name. Names must be unique
+   * per-project per-location. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The connectionId. + */ + java.lang.String getConnectionId(); + /** + * + * + *
+   * Required. The ID to use for the Connection, which will become the final
+   * component of the Connection's resource name. Names must be unique
+   * per-project per-location. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for connectionId. + */ + com.google.protobuf.ByteString getConnectionIdBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateRepositoryRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateRepositoryRequest.java new file mode 100644 index 000000000000..ba3c62988e29 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateRepositoryRequest.java @@ -0,0 +1,1149 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for creating a Repository.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.CreateRepositoryRequest} + */ +public final class CreateRepositoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.CreateRepositoryRequest) + CreateRepositoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateRepositoryRequest.newBuilder() to construct. + private CreateRepositoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateRepositoryRequest() { + parent_ = ""; + repositoryId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateRepositoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.CreateRepositoryRequest.class, + google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The connection to contain the repository. If the request is part
+   * of a BatchCreateRepositoriesRequest, this field should be empty or match
+   * the parent specified there.
+   * 
+ * + * + * 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 connection to contain the repository. If the request is part
+   * of a BatchCreateRepositoriesRequest, this field should be empty or match
+   * the parent specified there.
+   * 
+ * + * + * 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 REPOSITORY_FIELD_NUMBER = 2; + private google.devtools.cloudbuild.v2.Repository repository_; + /** + * + * + *
+   * Required. The repository to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the repository field is set. + */ + @java.lang.Override + public boolean hasRepository() { + return repository_ != null; + } + /** + * + * + *
+   * Required. The repository to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The repository. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository getRepository() { + return repository_ == null + ? google.devtools.cloudbuild.v2.Repository.getDefaultInstance() + : repository_; + } + /** + * + * + *
+   * Required. The repository to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoryOrBuilder() { + return repository_ == null + ? google.devtools.cloudbuild.v2.Repository.getDefaultInstance() + : repository_; + } + + public static final int REPOSITORY_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object repositoryId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the repository, which will become the final
+   * component of the repository's resource name. This ID should be unique in
+   * the connection. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The repositoryId. + */ + @java.lang.Override + public java.lang.String getRepositoryId() { + java.lang.Object ref = repositoryId_; + 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(); + repositoryId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the repository, which will become the final
+   * component of the repository's resource name. This ID should be unique in
+   * the connection. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for repositoryId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepositoryIdBytes() { + java.lang.Object ref = repositoryId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repositoryId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (repository_ != null) { + output.writeMessage(2, getRepository()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repositoryId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, repositoryId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (repository_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRepository()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repositoryId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, repositoryId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.CreateRepositoryRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.CreateRepositoryRequest other = + (google.devtools.cloudbuild.v2.CreateRepositoryRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRepository() != other.hasRepository()) return false; + if (hasRepository()) { + if (!getRepository().equals(other.getRepository())) return false; + } + if (!getRepositoryId().equals(other.getRepositoryId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + if (hasRepository()) { + hash = (37 * hash) + REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getRepository().hashCode(); + } + hash = (37 * hash) + REPOSITORY_ID_FIELD_NUMBER; + hash = (53 * hash) + getRepositoryId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest 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 google.devtools.cloudbuild.v2.CreateRepositoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest 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 google.devtools.cloudbuild.v2.CreateRepositoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest 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( + google.devtools.cloudbuild.v2.CreateRepositoryRequest 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; + } + /** + * + * + *
+   * Message for creating a Repository.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.CreateRepositoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.CreateRepositoryRequest) + google.devtools.cloudbuild.v2.CreateRepositoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.CreateRepositoryRequest.class, + google.devtools.cloudbuild.v2.CreateRepositoryRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.CreateRepositoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + repository_ = null; + if (repositoryBuilder_ != null) { + repositoryBuilder_.dispose(); + repositoryBuilder_ = null; + } + repositoryId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateRepositoryRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.CreateRepositoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateRepositoryRequest build() { + google.devtools.cloudbuild.v2.CreateRepositoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateRepositoryRequest buildPartial() { + google.devtools.cloudbuild.v2.CreateRepositoryRequest result = + new google.devtools.cloudbuild.v2.CreateRepositoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.CreateRepositoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.repository_ = repositoryBuilder_ == null ? repository_ : repositoryBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.repositoryId_ = repositoryId_; + } + } + + @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 google.devtools.cloudbuild.v2.CreateRepositoryRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.CreateRepositoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.CreateRepositoryRequest other) { + if (other == google.devtools.cloudbuild.v2.CreateRepositoryRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRepository()) { + mergeRepository(other.getRepository()); + } + if (!other.getRepositoryId().isEmpty()) { + repositoryId_ = other.repositoryId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRepositoryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + repositoryId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The connection to contain the repository. If the request is part
+     * of a BatchCreateRepositoriesRequest, this field should be empty or match
+     * the parent specified there.
+     * 
+ * + * + * 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 connection to contain the repository. If the request is part
+     * of a BatchCreateRepositoriesRequest, this field should be empty or match
+     * the parent specified there.
+     * 
+ * + * + * 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 connection to contain the repository. If the request is part
+     * of a BatchCreateRepositoriesRequest, this field should be empty or match
+     * the parent specified there.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The connection to contain the repository. If the request is part
+     * of a BatchCreateRepositoriesRequest, this field should be empty or match
+     * the parent specified there.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The connection to contain the repository. If the request is part
+     * of a BatchCreateRepositoriesRequest, this field should be empty or match
+     * the parent specified there.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private google.devtools.cloudbuild.v2.Repository repository_; + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + repositoryBuilder_; + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the repository field is set. + */ + public boolean hasRepository() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The repository. + */ + public google.devtools.cloudbuild.v2.Repository getRepository() { + if (repositoryBuilder_ == null) { + return repository_ == null + ? google.devtools.cloudbuild.v2.Repository.getDefaultInstance() + : repository_; + } else { + return repositoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRepository(google.devtools.cloudbuild.v2.Repository value) { + if (repositoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + repository_ = value; + } else { + repositoryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRepository(google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoryBuilder_ == null) { + repository_ = builderForValue.build(); + } else { + repositoryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRepository(google.devtools.cloudbuild.v2.Repository value) { + if (repositoryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && repository_ != null + && repository_ != google.devtools.cloudbuild.v2.Repository.getDefaultInstance()) { + getRepositoryBuilder().mergeFrom(value); + } else { + repository_ = value; + } + } else { + repositoryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRepository() { + bitField0_ = (bitField0_ & ~0x00000002); + repository_ = null; + if (repositoryBuilder_ != null) { + repositoryBuilder_.dispose(); + repositoryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.Repository.Builder getRepositoryBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRepositoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoryOrBuilder() { + if (repositoryBuilder_ != null) { + return repositoryBuilder_.getMessageOrBuilder(); + } else { + return repository_ == null + ? google.devtools.cloudbuild.v2.Repository.getDefaultInstance() + : repository_; + } + } + /** + * + * + *
+     * Required. The repository to create.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + getRepositoryFieldBuilder() { + if (repositoryBuilder_ == null) { + repositoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder>( + getRepository(), getParentForChildren(), isClean()); + repository_ = null; + } + return repositoryBuilder_; + } + + private java.lang.Object repositoryId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the repository, which will become the final
+     * component of the repository's resource name. This ID should be unique in
+     * the connection. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The repositoryId. + */ + public java.lang.String getRepositoryId() { + java.lang.Object ref = repositoryId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repositoryId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the repository, which will become the final
+     * component of the repository's resource name. This ID should be unique in
+     * the connection. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for repositoryId. + */ + public com.google.protobuf.ByteString getRepositoryIdBytes() { + java.lang.Object ref = repositoryId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repositoryId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the repository, which will become the final
+     * component of the repository's resource name. This ID should be unique in
+     * the connection. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The repositoryId to set. + * @return This builder for chaining. + */ + public Builder setRepositoryId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + repositoryId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the repository, which will become the final
+     * component of the repository's resource name. This ID should be unique in
+     * the connection. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRepositoryId() { + repositoryId_ = getDefaultInstance().getRepositoryId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the repository, which will become the final
+     * component of the repository's resource name. This ID should be unique in
+     * the connection. Allows alphanumeric characters and any of
+     * -._~%!$&'()*+,;=@.
+     * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for repositoryId to set. + * @return This builder for chaining. + */ + public Builder setRepositoryIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + repositoryId_ = value; + bitField0_ |= 0x00000004; + 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.cloudbuild.v2.CreateRepositoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.CreateRepositoryRequest) + private static final google.devtools.cloudbuild.v2.CreateRepositoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.CreateRepositoryRequest(); + } + + public static google.devtools.cloudbuild.v2.CreateRepositoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRepositoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.CreateRepositoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateRepositoryRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateRepositoryRequestOrBuilder.java new file mode 100644 index 000000000000..babeb3b8fdaa --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/CreateRepositoryRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface CreateRepositoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.CreateRepositoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The connection to contain the repository. If the request is part
+   * of a BatchCreateRepositoriesRequest, this field should be empty or match
+   * the parent specified there.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The connection to contain the repository. If the request is part
+   * of a BatchCreateRepositoriesRequest, this field should be empty or match
+   * the parent specified there.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The repository to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the repository field is set. + */ + boolean hasRepository(); + /** + * + * + *
+   * Required. The repository to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The repository. + */ + google.devtools.cloudbuild.v2.Repository getRepository(); + /** + * + * + *
+   * Required. The repository to create.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoryOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the repository, which will become the final
+   * component of the repository's resource name. This ID should be unique in
+   * the connection. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The repositoryId. + */ + java.lang.String getRepositoryId(); + /** + * + * + *
+   * Required. The ID to use for the repository, which will become the final
+   * component of the repository's resource name. This ID should be unique in
+   * the connection. Allows alphanumeric characters and any of
+   * -._~%!$&'()*+,;=@.
+   * 
+ * + * string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for repositoryId. + */ + com.google.protobuf.ByteString getRepositoryIdBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteConnectionRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteConnectionRequest.java new file mode 100644 index 000000000000..8b9037aaec5d --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteConnectionRequest.java @@ -0,0 +1,940 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for deleting a Connection.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.DeleteConnectionRequest} + */ +public final class DeleteConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.DeleteConnectionRequest) + DeleteConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConnectionRequest.newBuilder() to construct. + private DeleteConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteConnectionRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.DeleteConnectionRequest.class, + google.devtools.cloudbuild.v2.DeleteConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Connection to delete.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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 Connection to delete.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request, but do not actually post it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.DeleteConnectionRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.DeleteConnectionRequest other = + (google.devtools.cloudbuild.v2.DeleteConnectionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest 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 google.devtools.cloudbuild.v2.DeleteConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest 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 google.devtools.cloudbuild.v2.DeleteConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest 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( + google.devtools.cloudbuild.v2.DeleteConnectionRequest 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; + } + /** + * + * + *
+   * Message for deleting a Connection.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.DeleteConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.DeleteConnectionRequest) + google.devtools.cloudbuild.v2.DeleteConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.DeleteConnectionRequest.class, + google.devtools.cloudbuild.v2.DeleteConnectionRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.DeleteConnectionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteConnectionRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.DeleteConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteConnectionRequest build() { + google.devtools.cloudbuild.v2.DeleteConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteConnectionRequest buildPartial() { + google.devtools.cloudbuild.v2.DeleteConnectionRequest result = + new google.devtools.cloudbuild.v2.DeleteConnectionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.DeleteConnectionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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 google.devtools.cloudbuild.v2.DeleteConnectionRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.DeleteConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.DeleteConnectionRequest other) { + if (other == google.devtools.cloudbuild.v2.DeleteConnectionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Connection to delete.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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 Connection to delete.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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 Connection to delete.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Connection to delete.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Connection to delete.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request, but do not actually post it.
+     * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request, but do not actually post it.
+     * 
+ * + * bool validate_only = 3; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request, but do not actually post it.
+     * 
+ * + * bool validate_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + 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.cloudbuild.v2.DeleteConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.DeleteConnectionRequest) + private static final google.devtools.cloudbuild.v2.DeleteConnectionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.DeleteConnectionRequest(); + } + + public static google.devtools.cloudbuild.v2.DeleteConnectionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteConnectionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteConnectionRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..199c0e75ab77 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteConnectionRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface DeleteConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.DeleteConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Connection to delete.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Connection to delete.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * If set, validate the request, but do not actually post it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteRepositoryRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteRepositoryRequest.java new file mode 100644 index 000000000000..df410a457aa0 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteRepositoryRequest.java @@ -0,0 +1,940 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for deleting a Repository.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.DeleteRepositoryRequest} + */ +public final class DeleteRepositoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.DeleteRepositoryRequest) + DeleteRepositoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteRepositoryRequest.newBuilder() to construct. + private DeleteRepositoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRepositoryRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteRepositoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest.class, + google.devtools.cloudbuild.v2.DeleteRepositoryRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Repository to delete.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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 delete.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * The current etag of the repository.
+   * If an etag is provided and does not match the current etag of the
+   * repository, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * The current etag of the repository.
+   * If an etag is provided and does not match the current etag of the
+   * repository, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + /** + * + * + *
+   * If set, validate the request, but do not actually post it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.DeleteRepositoryRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.DeleteRepositoryRequest other = + (google.devtools.cloudbuild.v2.DeleteRepositoryRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest 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 google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest 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 google.devtools.cloudbuild.v2.DeleteRepositoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest 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( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest 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; + } + /** + * + * + *
+   * Message for deleting a Repository.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.DeleteRepositoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.DeleteRepositoryRequest) + google.devtools.cloudbuild.v2.DeleteRepositoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.DeleteRepositoryRequest.class, + google.devtools.cloudbuild.v2.DeleteRepositoryRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.DeleteRepositoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteRepositoryRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.DeleteRepositoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteRepositoryRequest build() { + google.devtools.cloudbuild.v2.DeleteRepositoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteRepositoryRequest buildPartial() { + google.devtools.cloudbuild.v2.DeleteRepositoryRequest result = + new google.devtools.cloudbuild.v2.DeleteRepositoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.DeleteRepositoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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 google.devtools.cloudbuild.v2.DeleteRepositoryRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.DeleteRepositoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.DeleteRepositoryRequest other) { + if (other == google.devtools.cloudbuild.v2.DeleteRepositoryRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Repository to delete.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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 delete.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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 delete.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Repository to delete.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Repository to delete.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * The current etag of the repository.
+     * If an etag is provided and does not match the current etag of the
+     * repository, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current etag of the repository.
+     * If an etag is provided and does not match the current etag of the
+     * repository, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current etag of the repository.
+     * If an etag is provided and does not match the current etag of the
+     * repository, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the repository.
+     * If an etag is provided and does not match the current etag of the
+     * repository, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the repository.
+     * If an etag is provided and does not match the current etag of the
+     * repository, deletion will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 2; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * If set, validate the request, but do not actually post it.
+     * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * If set, validate the request, but do not actually post it.
+     * 
+ * + * bool validate_only = 3; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, validate the request, but do not actually post it.
+     * 
+ * + * bool validate_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + 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.cloudbuild.v2.DeleteRepositoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.DeleteRepositoryRequest) + private static final google.devtools.cloudbuild.v2.DeleteRepositoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.DeleteRepositoryRequest(); + } + + public static google.devtools.cloudbuild.v2.DeleteRepositoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRepositoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.DeleteRepositoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteRepositoryRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteRepositoryRequestOrBuilder.java new file mode 100644 index 000000000000..e30ad7ba65ff --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/DeleteRepositoryRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface DeleteRepositoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.DeleteRepositoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Repository to delete.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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 delete.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The current etag of the repository.
+   * If an etag is provided and does not match the current etag of the
+   * repository, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * The current etag of the repository.
+   * If an etag is provided and does not match the current etag of the
+   * repository, deletion will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 2; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * If set, validate the request, but do not actually post it.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesRequest.java new file mode 100644 index 000000000000..8fcff279292e --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesRequest.java @@ -0,0 +1,933 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Request message for FetchLinkableRepositories.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest} + */ +public final class FetchLinkableRepositoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) + FetchLinkableRepositoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchLinkableRepositoriesRequest.newBuilder() to construct. + private FetchLinkableRepositoriesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchLinkableRepositoriesRequest() { + connection_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchLinkableRepositoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.class, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.Builder.class); + } + + public static final int CONNECTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object connection_ = ""; + /** + * + * + *
+   * Required. The name of the Connection.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The connection. + */ + @java.lang.Override + public java.lang.String getConnection() { + java.lang.Object ref = connection_; + 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(); + connection_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Connection.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for connection. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionBytes() { + java.lang.Object ref = connection_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connection_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Number of results to return in the list. Default to 20.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Page start.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Page start.
+   * 
+ * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(connection_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, connection_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(connection_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, connection_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest other = + (google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) obj; + + if (!getConnection().equals(other.getConnection())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest 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 google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest 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 google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest 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( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest 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; + } + /** + * + * + *
+   * Request message for FetchLinkableRepositories.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.class, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + connection_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest + getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest build() { + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest buildPartial() { + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest result = + new google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connection_ = connection_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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 google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest other) { + if (other + == google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest.getDefaultInstance()) + return this; + if (!other.getConnection().isEmpty()) { + connection_ = other.connection_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + connection_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object connection_ = ""; + /** + * + * + *
+     * Required. The name of the Connection.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The connection. + */ + public java.lang.String getConnection() { + java.lang.Object ref = connection_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connection_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Connection.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for connection. + */ + public com.google.protobuf.ByteString getConnectionBytes() { + java.lang.Object ref = connection_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connection_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Connection.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The connection to set. + * @return This builder for chaining. + */ + public Builder setConnection(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Connection.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearConnection() { + connection_ = getDefaultInstance().getConnection(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Connection.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for connection to set. + * @return This builder for chaining. + */ + public Builder setConnectionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connection_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Number of results to return in the list. Default to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Number of results to return in the list. Default to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of results to return in the list. Default to 20.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.cloudbuild.v2.FetchLinkableRepositoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) + private static final google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest(); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchLinkableRepositoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesRequestOrBuilder.java new file mode 100644 index 000000000000..2a82a44973ee --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface FetchLinkableRepositoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Connection.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The connection. + */ + java.lang.String getConnection(); + /** + * + * + *
+   * Required. The name of the Connection.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for connection. + */ + com.google.protobuf.ByteString getConnectionBytes(); + + /** + * + * + *
+   * Number of results to return in the list. Default to 20.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page start.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page start.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesResponse.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesResponse.java new file mode 100644 index 000000000000..66515f78a081 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesResponse.java @@ -0,0 +1,1133 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Response message for FetchLinkableRepositories.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse} + */ +public final class FetchLinkableRepositoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) + FetchLinkableRepositoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchLinkableRepositoriesResponse.newBuilder() to construct. + private FetchLinkableRepositoriesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchLinkableRepositoriesResponse() { + repositories_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchLinkableRepositoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.class, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.Builder.class); + } + + public static final int REPOSITORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List repositories_; + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List getRepositoriesList() { + return repositories_; + } + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List + getRepositoriesOrBuilderList() { + return repositories_; + } + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public int getRepositoriesCount() { + return repositories_.size(); + } + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository getRepositories(int index) { + return repositories_.get(index); + } + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index) { + return repositories_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse other = + (google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) obj; + + if (!getRepositoriesList().equals(other.getRepositoriesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse 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 google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse 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 google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse 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( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse 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; + } + /** + * + * + *
+   * Response message for FetchLinkableRepositories.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.class, + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + } else { + repositories_ = null; + repositoriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse + getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse build() { + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse buildPartial() { + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse result = + new google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse result) { + if (repositoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + repositories_ = java.util.Collections.unmodifiableList(repositories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.repositories_ = repositories_; + } else { + result.repositories_ = repositoriesBuilder_.build(); + } + } + + private void buildPartial0( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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 google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) { + return mergeFrom((google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse other) { + if (other + == google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse.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_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + google.devtools.cloudbuild.v2.Repository m = + input.readMessage( + google.devtools.cloudbuild.v2.Repository.parser(), extensionRegistry); + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(m); + } else { + repositoriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + repositoriesBuilder_; + + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List getRepositoriesList() { + if (repositoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(repositories_); + } else { + return repositoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public int getRepositoriesCount() { + if (repositoriesBuilder_ == null) { + return repositories_.size(); + } else { + return repositoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository getRepositories(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder setRepositories(int index, google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.set(index, value); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder setRepositories( + int index, google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.set(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories(google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories(int index, google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(index, value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories( + google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories( + int index, google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.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; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder clearRepositories() { + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + repositoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder removeRepositories(int index) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.remove(index); + onChanged(); + } else { + repositoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder getRepositoriesBuilder(int index) { + return getRepositoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List + getRepositoriesOrBuilderList() { + if (repositoriesBuilder_ != null) { + return repositoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(repositories_); + } + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder addRepositoriesBuilder() { + return getRepositoriesFieldBuilder() + .addBuilder(google.devtools.cloudbuild.v2.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder addRepositoriesBuilder(int index) { + return getRepositoriesFieldBuilder() + .addBuilder(index, google.devtools.cloudbuild.v2.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * repositories ready to be created.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List + getRepositoriesBuilderList() { + return getRepositoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + getRepositoriesFieldBuilder() { + if (repositoriesBuilder_ == null) { + repositoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder>( + repositories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + repositories_ = null; + } + return repositoriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + bitField0_ |= 0x00000002; + 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.cloudbuild.v2.FetchLinkableRepositoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) + private static final google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse(); + } + + public static google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchLinkableRepositoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesResponseOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesResponseOrBuilder.java new file mode 100644 index 000000000000..ec85e46100b0 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchLinkableRepositoriesResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface FetchLinkableRepositoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + java.util.List getRepositoriesList(); + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + google.devtools.cloudbuild.v2.Repository getRepositories(int index); + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + int getRepositoriesCount(); + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + java.util.List + getRepositoriesOrBuilderList(); + /** + * + * + *
+   * repositories ready to be created.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenRequest.java new file mode 100644 index 000000000000..3c98246ae78c --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenRequest.java @@ -0,0 +1,650 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for fetching SCM read token.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadTokenRequest} + */ +public final class FetchReadTokenRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.FetchReadTokenRequest) + FetchReadTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchReadTokenRequest.newBuilder() to construct. + private FetchReadTokenRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchReadTokenRequest() { + repository_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchReadTokenRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadTokenRequest.class, + google.devtools.cloudbuild.v2.FetchReadTokenRequest.Builder.class); + } + + public static final int REPOSITORY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object repository_ = ""; + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The repository. + */ + @java.lang.Override + public java.lang.String getRepository() { + java.lang.Object ref = repository_; + 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(); + repository_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for repository. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepositoryBytes() { + java.lang.Object ref = repository_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repository_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repository_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, repository_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repository_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, repository_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.FetchReadTokenRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.FetchReadTokenRequest other = + (google.devtools.cloudbuild.v2.FetchReadTokenRequest) obj; + + if (!getRepository().equals(other.getRepository())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getRepository().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest 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 google.devtools.cloudbuild.v2.FetchReadTokenRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest 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 google.devtools.cloudbuild.v2.FetchReadTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest 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(google.devtools.cloudbuild.v2.FetchReadTokenRequest 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; + } + /** + * + * + *
+   * Message for fetching SCM read token.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadTokenRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.FetchReadTokenRequest) + google.devtools.cloudbuild.v2.FetchReadTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadTokenRequest.class, + google.devtools.cloudbuild.v2.FetchReadTokenRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.FetchReadTokenRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + repository_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.FetchReadTokenRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenRequest build() { + google.devtools.cloudbuild.v2.FetchReadTokenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenRequest buildPartial() { + google.devtools.cloudbuild.v2.FetchReadTokenRequest result = + new google.devtools.cloudbuild.v2.FetchReadTokenRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.FetchReadTokenRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.repository_ = repository_; + } + } + + @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 google.devtools.cloudbuild.v2.FetchReadTokenRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.FetchReadTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.FetchReadTokenRequest other) { + if (other == google.devtools.cloudbuild.v2.FetchReadTokenRequest.getDefaultInstance()) + return this; + if (!other.getRepository().isEmpty()) { + repository_ = other.repository_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + repository_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object repository_ = ""; + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The repository. + */ + public java.lang.String getRepository() { + java.lang.Object ref = repository_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repository_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for repository. + */ + public com.google.protobuf.ByteString getRepositoryBytes() { + java.lang.Object ref = repository_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The repository to set. + * @return This builder for chaining. + */ + public Builder setRepository(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + repository_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRepository() { + repository_ = getDefaultInstance().getRepository(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for repository to set. + * @return This builder for chaining. + */ + public Builder setRepositoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + repository_ = value; + bitField0_ |= 0x00000001; + 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.cloudbuild.v2.FetchReadTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.FetchReadTokenRequest) + private static final google.devtools.cloudbuild.v2.FetchReadTokenRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.FetchReadTokenRequest(); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchReadTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenRequestOrBuilder.java new file mode 100644 index 000000000000..635d3fc313cd --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface FetchReadTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.FetchReadTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The repository. + */ + java.lang.String getRepository(); + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for repository. + */ + com.google.protobuf.ByteString getRepositoryBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenResponse.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenResponse.java new file mode 100644 index 000000000000..2dc94247d6cb --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenResponse.java @@ -0,0 +1,894 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for responding to get read token.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadTokenResponse} + */ +public final class FetchReadTokenResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.FetchReadTokenResponse) + FetchReadTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchReadTokenResponse.newBuilder() to construct. + private FetchReadTokenResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchReadTokenResponse() { + token_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchReadTokenResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadTokenResponse.class, + google.devtools.cloudbuild.v2.FetchReadTokenResponse.Builder.class); + } + + public static final int TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object token_ = ""; + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The token. + */ + @java.lang.Override + public java.lang.String getToken() { + java.lang.Object ref = token_; + 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(); + token_ = s; + return s; + } + } + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The bytes for token. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expirationTime_; + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + @java.lang.Override + public boolean hasExpirationTime() { + return expirationTime_ != null; + } + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, token_); + } + if (expirationTime_ != null) { + output.writeMessage(2, getExpirationTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, token_); + } + if (expirationTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpirationTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.FetchReadTokenResponse)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.FetchReadTokenResponse other = + (google.devtools.cloudbuild.v2.FetchReadTokenResponse) obj; + + if (!getToken().equals(other.getToken())) return false; + if (hasExpirationTime() != other.hasExpirationTime()) return false; + if (hasExpirationTime()) { + if (!getExpirationTime().equals(other.getExpirationTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse 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 google.devtools.cloudbuild.v2.FetchReadTokenResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse 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 google.devtools.cloudbuild.v2.FetchReadTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse 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(google.devtools.cloudbuild.v2.FetchReadTokenResponse 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; + } + /** + * + * + *
+   * Message for responding to get read token.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadTokenResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.FetchReadTokenResponse) + google.devtools.cloudbuild.v2.FetchReadTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadTokenResponse.class, + google.devtools.cloudbuild.v2.FetchReadTokenResponse.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.FetchReadTokenResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + token_ = ""; + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenResponse getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.FetchReadTokenResponse.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenResponse build() { + google.devtools.cloudbuild.v2.FetchReadTokenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenResponse buildPartial() { + google.devtools.cloudbuild.v2.FetchReadTokenResponse result = + new google.devtools.cloudbuild.v2.FetchReadTokenResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.FetchReadTokenResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.token_ = token_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expirationTime_ = + expirationTimeBuilder_ == null ? expirationTime_ : expirationTimeBuilder_.build(); + } + } + + @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 google.devtools.cloudbuild.v2.FetchReadTokenResponse) { + return mergeFrom((google.devtools.cloudbuild.v2.FetchReadTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.FetchReadTokenResponse other) { + if (other == google.devtools.cloudbuild.v2.FetchReadTokenResponse.getDefaultInstance()) + return this; + if (!other.getToken().isEmpty()) { + token_ = other.token_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + token_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object token_ = ""; + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @return The token. + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @return The bytes for token. + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @return This builder for chaining. + */ + public Builder clearToken() { + token_ = getDefaultInstance().getToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @param value The bytes for token to set. + * @return This builder for chaining. + */ + public Builder setTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expirationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationTimeBuilder_; + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + } else { + expirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expirationTime_ != null + && expirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationTimeBuilder().mergeFrom(value); + } else { + expirationTime_ = value; + } + } else { + expirationTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder clearExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExpirationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), getParentForChildren(), isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + @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.cloudbuild.v2.FetchReadTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.FetchReadTokenResponse) + private static final google.devtools.cloudbuild.v2.FetchReadTokenResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.FetchReadTokenResponse(); + } + + public static google.devtools.cloudbuild.v2.FetchReadTokenResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchReadTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadTokenResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenResponseOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenResponseOrBuilder.java new file mode 100644 index 000000000000..075b105abfcf --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadTokenResponseOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface FetchReadTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.FetchReadTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The token. + */ + java.lang.String getToken(); + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The bytes for token. + */ + com.google.protobuf.ByteString getTokenBytes(); + + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + boolean hasExpirationTime(); + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + com.google.protobuf.Timestamp getExpirationTime(); + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenRequest.java new file mode 100644 index 000000000000..d2b7a5425744 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenRequest.java @@ -0,0 +1,651 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for fetching SCM read/write token.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest} + */ +public final class FetchReadWriteTokenRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) + FetchReadWriteTokenRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchReadWriteTokenRequest.newBuilder() to construct. + private FetchReadWriteTokenRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchReadWriteTokenRequest() { + repository_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchReadWriteTokenRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.class, + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.Builder.class); + } + + public static final int REPOSITORY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object repository_ = ""; + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The repository. + */ + @java.lang.Override + public java.lang.String getRepository() { + java.lang.Object ref = repository_; + 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(); + repository_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for repository. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepositoryBytes() { + java.lang.Object ref = repository_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repository_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repository_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, repository_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repository_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, repository_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest other = + (google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) obj; + + if (!getRepository().equals(other.getRepository())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getRepository().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest 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 google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest 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 google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest 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( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest 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; + } + /** + * + * + *
+   * Message for fetching SCM read/write token.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.class, + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + repository_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest build() { + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest buildPartial() { + google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest result = + new google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.repository_ = repository_; + } + } + + @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 google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest other) { + if (other == google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest.getDefaultInstance()) + return this; + if (!other.getRepository().isEmpty()) { + repository_ = other.repository_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + repository_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object repository_ = ""; + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The repository. + */ + public java.lang.String getRepository() { + java.lang.Object ref = repository_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repository_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for repository. + */ + public com.google.protobuf.ByteString getRepositoryBytes() { + java.lang.Object ref = repository_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The repository to set. + * @return This builder for chaining. + */ + public Builder setRepository(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + repository_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRepository() { + repository_ = getDefaultInstance().getRepository(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the repository in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for repository to set. + * @return This builder for chaining. + */ + public Builder setRepositoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + repository_ = value; + bitField0_ |= 0x00000001; + 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.cloudbuild.v2.FetchReadWriteTokenRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) + private static final google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest(); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchReadWriteTokenRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenRequestOrBuilder.java new file mode 100644 index 000000000000..d61c4a46d6cb --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface FetchReadWriteTokenRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The repository. + */ + java.lang.String getRepository(); + /** + * + * + *
+   * Required. The resource name of the repository in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for repository. + */ + com.google.protobuf.ByteString getRepositoryBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenResponse.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenResponse.java new file mode 100644 index 000000000000..513e5da03638 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenResponse.java @@ -0,0 +1,895 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for responding to get read/write token.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse} + */ +public final class FetchReadWriteTokenResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) + FetchReadWriteTokenResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use FetchReadWriteTokenResponse.newBuilder() to construct. + private FetchReadWriteTokenResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchReadWriteTokenResponse() { + token_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchReadWriteTokenResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.class, + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.Builder.class); + } + + public static final int TOKEN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object token_ = ""; + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The token. + */ + @java.lang.Override + public java.lang.String getToken() { + java.lang.Object ref = token_; + 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(); + token_ = s; + return s; + } + } + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The bytes for token. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expirationTime_; + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + @java.lang.Override + public boolean hasExpirationTime() { + return expirationTime_ != null; + } + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, token_); + } + if (expirationTime_ != null) { + output.writeMessage(2, getExpirationTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, token_); + } + if (expirationTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpirationTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse other = + (google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) obj; + + if (!getToken().equals(other.getToken())) return false; + if (hasExpirationTime() != other.hasExpirationTime()) return false; + if (hasExpirationTime()) { + if (!getExpirationTime().equals(other.getExpirationTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse 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 google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse 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 google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse 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( + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse 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; + } + /** + * + * + *
+   * Message for responding to get read/write token.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.class, + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + token_ = ""; + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse build() { + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse buildPartial() { + google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse result = + new google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.token_ = token_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expirationTime_ = + expirationTimeBuilder_ == null ? expirationTime_ : expirationTimeBuilder_.build(); + } + } + + @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 google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) { + return mergeFrom((google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse other) { + if (other == google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse.getDefaultInstance()) + return this; + if (!other.getToken().isEmpty()) { + token_ = other.token_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + token_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object token_ = ""; + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @return The token. + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @return The bytes for token. + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @return This builder for chaining. + */ + public Builder clearToken() { + token_ = getDefaultInstance().getToken(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The token content.
+     * 
+ * + * string token = 1; + * + * @param value The bytes for token to set. + * @return This builder for chaining. + */ + public Builder setTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + token_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expirationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationTimeBuilder_; + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + public boolean hasExpirationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + } else { + expirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expirationTime_ != null + && expirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationTimeBuilder().mergeFrom(value); + } else { + expirationTime_ = value; + } + } else { + expirationTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public Builder clearExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expirationTime_ = null; + if (expirationTimeBuilder_ != null) { + expirationTimeBuilder_.dispose(); + expirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExpirationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationTime_; + } + } + /** + * + * + *
+     * Expiration timestamp. Can be empty if unknown or non-expiring.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), getParentForChildren(), isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + @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.cloudbuild.v2.FetchReadWriteTokenResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) + private static final google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse(); + } + + public static google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchReadWriteTokenResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenResponseOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenResponseOrBuilder.java new file mode 100644 index 000000000000..0e117fe7106c --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/FetchReadWriteTokenResponseOrBuilder.java @@ -0,0 +1,85 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface FetchReadWriteTokenResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The token. + */ + java.lang.String getToken(); + /** + * + * + *
+   * The token content.
+   * 
+ * + * string token = 1; + * + * @return The bytes for token. + */ + com.google.protobuf.ByteString getTokenBytes(); + + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return Whether the expirationTime field is set. + */ + boolean hasExpirationTime(); + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + * + * @return The expirationTime. + */ + com.google.protobuf.Timestamp getExpirationTime(); + /** + * + * + *
+   * Expiration timestamp. Can be empty if unknown or non-expiring.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetConnectionRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetConnectionRequest.java new file mode 100644 index 000000000000..0a01274d8108 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetConnectionRequest.java @@ -0,0 +1,650 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for getting the details of a Connection.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GetConnectionRequest} + */ +public final class GetConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.GetConnectionRequest) + GetConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConnectionRequest.newBuilder() to construct. + private GetConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GetConnectionRequest.class, + google.devtools.cloudbuild.v2.GetConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Connection to retrieve.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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 Connection to retrieve.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.GetConnectionRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.GetConnectionRequest other = + (google.devtools.cloudbuild.v2.GetConnectionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest 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 google.devtools.cloudbuild.v2.GetConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest 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 google.devtools.cloudbuild.v2.GetConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest 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(google.devtools.cloudbuild.v2.GetConnectionRequest 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; + } + /** + * + * + *
+   * Message for getting the details of a Connection.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GetConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.GetConnectionRequest) + google.devtools.cloudbuild.v2.GetConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GetConnectionRequest.class, + google.devtools.cloudbuild.v2.GetConnectionRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.GetConnectionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetConnectionRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.GetConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetConnectionRequest build() { + google.devtools.cloudbuild.v2.GetConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetConnectionRequest buildPartial() { + google.devtools.cloudbuild.v2.GetConnectionRequest result = + new google.devtools.cloudbuild.v2.GetConnectionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.GetConnectionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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 google.devtools.cloudbuild.v2.GetConnectionRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.GetConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.GetConnectionRequest other) { + if (other == google.devtools.cloudbuild.v2.GetConnectionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Connection to retrieve.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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 Connection to retrieve.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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 Connection to retrieve.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Connection to retrieve.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Connection to retrieve.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.cloudbuild.v2.GetConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.GetConnectionRequest) + private static final google.devtools.cloudbuild.v2.GetConnectionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.GetConnectionRequest(); + } + + public static google.devtools.cloudbuild.v2.GetConnectionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetConnectionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetConnectionRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..e5c88fd47391 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetConnectionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface GetConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.GetConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Connection to retrieve.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Connection to retrieve.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetRepositoryRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetRepositoryRequest.java new file mode 100644 index 000000000000..f4c6284f3cf5 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetRepositoryRequest.java @@ -0,0 +1,650 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for getting the details of a Repository.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GetRepositoryRequest} + */ +public final class GetRepositoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GetRepositoryRequest.class, + google.devtools.cloudbuild.v2.GetRepositoryRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Repository to retrieve.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.GetRepositoryRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.GetRepositoryRequest other = + (google.devtools.cloudbuild.v2.GetRepositoryRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.GetRepositoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.GetRepositoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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(google.devtools.cloudbuild.v2.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; + } + /** + * + * + *
+   * Message for getting the details of a Repository.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GetRepositoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.GetRepositoryRequest) + google.devtools.cloudbuild.v2.GetRepositoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GetRepositoryRequest.class, + google.devtools.cloudbuild.v2.GetRepositoryRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.GetRepositoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetRepositoryRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.GetRepositoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetRepositoryRequest build() { + google.devtools.cloudbuild.v2.GetRepositoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetRepositoryRequest buildPartial() { + google.devtools.cloudbuild.v2.GetRepositoryRequest result = + new google.devtools.cloudbuild.v2.GetRepositoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.GetRepositoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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 google.devtools.cloudbuild.v2.GetRepositoryRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.GetRepositoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.GetRepositoryRequest other) { + if (other == google.devtools.cloudbuild.v2.GetRepositoryRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Repository to retrieve.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Repository to retrieve.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Repository to retrieve.
+     * Format: `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.cloudbuild.v2.GetRepositoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.GetRepositoryRequest) + private static final google.devtools.cloudbuild.v2.GetRepositoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.GetRepositoryRequest(); + } + + public static google.devtools.cloudbuild.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GetRepositoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetRepositoryRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetRepositoryRequestOrBuilder.java new file mode 100644 index 000000000000..ee12fec0943f --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GetRepositoryRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface GetRepositoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.GetRepositoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Repository to retrieve.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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.
+   * Format: `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * + * 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/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubConfig.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubConfig.java new file mode 100644 index 000000000000..5bb4ccab9f95 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubConfig.java @@ -0,0 +1,834 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Configuration for connections to github.com.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GitHubConfig} + */ +public final class GitHubConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.GitHubConfig) + GitHubConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use GitHubConfig.newBuilder() to construct. + private GitHubConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GitHubConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GitHubConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GitHubConfig.class, + google.devtools.cloudbuild.v2.GitHubConfig.Builder.class); + } + + public static final int AUTHORIZER_CREDENTIAL_FIELD_NUMBER = 1; + private google.devtools.cloudbuild.v2.OAuthCredential authorizerCredential_; + /** + * + * + *
+   * OAuth credential of the account that authorized the Cloud Build GitHub App.
+   * It is recommended to use a robot account instead of a human user account.
+   * The OAuth token must be tied to the Cloud Build GitHub App.
+   * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + * + * @return Whether the authorizerCredential field is set. + */ + @java.lang.Override + public boolean hasAuthorizerCredential() { + return authorizerCredential_ != null; + } + /** + * + * + *
+   * OAuth credential of the account that authorized the Cloud Build GitHub App.
+   * It is recommended to use a robot account instead of a human user account.
+   * The OAuth token must be tied to the Cloud Build GitHub App.
+   * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + * + * @return The authorizerCredential. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.OAuthCredential getAuthorizerCredential() { + return authorizerCredential_ == null + ? google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance() + : authorizerCredential_; + } + /** + * + * + *
+   * OAuth credential of the account that authorized the Cloud Build GitHub App.
+   * It is recommended to use a robot account instead of a human user account.
+   * The OAuth token must be tied to the Cloud Build GitHub App.
+   * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder getAuthorizerCredentialOrBuilder() { + return authorizerCredential_ == null + ? google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance() + : authorizerCredential_; + } + + public static final int APP_INSTALLATION_ID_FIELD_NUMBER = 2; + private long appInstallationId_ = 0L; + /** + * + * + *
+   * GitHub App installation id.
+   * 
+ * + * int64 app_installation_id = 2; + * + * @return The appInstallationId. + */ + @java.lang.Override + public long getAppInstallationId() { + return appInstallationId_; + } + + 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 (authorizerCredential_ != null) { + output.writeMessage(1, getAuthorizerCredential()); + } + if (appInstallationId_ != 0L) { + output.writeInt64(2, appInstallationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (authorizerCredential_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAuthorizerCredential()); + } + if (appInstallationId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, appInstallationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.GitHubConfig)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.GitHubConfig other = + (google.devtools.cloudbuild.v2.GitHubConfig) obj; + + if (hasAuthorizerCredential() != other.hasAuthorizerCredential()) return false; + if (hasAuthorizerCredential()) { + if (!getAuthorizerCredential().equals(other.getAuthorizerCredential())) return false; + } + if (getAppInstallationId() != other.getAppInstallationId()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAuthorizerCredential()) { + hash = (37 * hash) + AUTHORIZER_CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizerCredential().hashCode(); + } + hash = (37 * hash) + APP_INSTALLATION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAppInstallationId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig 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 google.devtools.cloudbuild.v2.GitHubConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig 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 google.devtools.cloudbuild.v2.GitHubConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig 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(google.devtools.cloudbuild.v2.GitHubConfig 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; + } + /** + * + * + *
+   * Configuration for connections to github.com.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GitHubConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.GitHubConfig) + google.devtools.cloudbuild.v2.GitHubConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GitHubConfig.class, + google.devtools.cloudbuild.v2.GitHubConfig.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.GitHubConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + authorizerCredential_ = null; + if (authorizerCredentialBuilder_ != null) { + authorizerCredentialBuilder_.dispose(); + authorizerCredentialBuilder_ = null; + } + appInstallationId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubConfig_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfig getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfig build() { + google.devtools.cloudbuild.v2.GitHubConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfig buildPartial() { + google.devtools.cloudbuild.v2.GitHubConfig result = + new google.devtools.cloudbuild.v2.GitHubConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.GitHubConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.authorizerCredential_ = + authorizerCredentialBuilder_ == null + ? authorizerCredential_ + : authorizerCredentialBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appInstallationId_ = appInstallationId_; + } + } + + @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 google.devtools.cloudbuild.v2.GitHubConfig) { + return mergeFrom((google.devtools.cloudbuild.v2.GitHubConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.GitHubConfig other) { + if (other == google.devtools.cloudbuild.v2.GitHubConfig.getDefaultInstance()) return this; + if (other.hasAuthorizerCredential()) { + mergeAuthorizerCredential(other.getAuthorizerCredential()); + } + if (other.getAppInstallationId() != 0L) { + setAppInstallationId(other.getAppInstallationId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getAuthorizerCredentialFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + appInstallationId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private google.devtools.cloudbuild.v2.OAuthCredential authorizerCredential_; + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.OAuthCredential, + google.devtools.cloudbuild.v2.OAuthCredential.Builder, + google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder> + authorizerCredentialBuilder_; + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + * + * @return Whether the authorizerCredential field is set. + */ + public boolean hasAuthorizerCredential() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + * + * @return The authorizerCredential. + */ + public google.devtools.cloudbuild.v2.OAuthCredential getAuthorizerCredential() { + if (authorizerCredentialBuilder_ == null) { + return authorizerCredential_ == null + ? google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance() + : authorizerCredential_; + } else { + return authorizerCredentialBuilder_.getMessage(); + } + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + public Builder setAuthorizerCredential(google.devtools.cloudbuild.v2.OAuthCredential value) { + if (authorizerCredentialBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authorizerCredential_ = value; + } else { + authorizerCredentialBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + public Builder setAuthorizerCredential( + google.devtools.cloudbuild.v2.OAuthCredential.Builder builderForValue) { + if (authorizerCredentialBuilder_ == null) { + authorizerCredential_ = builderForValue.build(); + } else { + authorizerCredentialBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + public Builder mergeAuthorizerCredential(google.devtools.cloudbuild.v2.OAuthCredential value) { + if (authorizerCredentialBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && authorizerCredential_ != null + && authorizerCredential_ + != google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance()) { + getAuthorizerCredentialBuilder().mergeFrom(value); + } else { + authorizerCredential_ = value; + } + } else { + authorizerCredentialBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + public Builder clearAuthorizerCredential() { + bitField0_ = (bitField0_ & ~0x00000001); + authorizerCredential_ = null; + if (authorizerCredentialBuilder_ != null) { + authorizerCredentialBuilder_.dispose(); + authorizerCredentialBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + public google.devtools.cloudbuild.v2.OAuthCredential.Builder getAuthorizerCredentialBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getAuthorizerCredentialFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + public google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder + getAuthorizerCredentialOrBuilder() { + if (authorizerCredentialBuilder_ != null) { + return authorizerCredentialBuilder_.getMessageOrBuilder(); + } else { + return authorizerCredential_ == null + ? google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance() + : authorizerCredential_; + } + } + /** + * + * + *
+     * OAuth credential of the account that authorized the Cloud Build GitHub App.
+     * It is recommended to use a robot account instead of a human user account.
+     * The OAuth token must be tied to the Cloud Build GitHub App.
+     * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.OAuthCredential, + google.devtools.cloudbuild.v2.OAuthCredential.Builder, + google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder> + getAuthorizerCredentialFieldBuilder() { + if (authorizerCredentialBuilder_ == null) { + authorizerCredentialBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.OAuthCredential, + google.devtools.cloudbuild.v2.OAuthCredential.Builder, + google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder>( + getAuthorizerCredential(), getParentForChildren(), isClean()); + authorizerCredential_ = null; + } + return authorizerCredentialBuilder_; + } + + private long appInstallationId_; + /** + * + * + *
+     * GitHub App installation id.
+     * 
+ * + * int64 app_installation_id = 2; + * + * @return The appInstallationId. + */ + @java.lang.Override + public long getAppInstallationId() { + return appInstallationId_; + } + /** + * + * + *
+     * GitHub App installation id.
+     * 
+ * + * int64 app_installation_id = 2; + * + * @param value The appInstallationId to set. + * @return This builder for chaining. + */ + public Builder setAppInstallationId(long value) { + + appInstallationId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * GitHub App installation id.
+     * 
+ * + * int64 app_installation_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppInstallationId() { + bitField0_ = (bitField0_ & ~0x00000002); + appInstallationId_ = 0L; + 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.cloudbuild.v2.GitHubConfig) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.GitHubConfig) + private static final google.devtools.cloudbuild.v2.GitHubConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.GitHubConfig(); + } + + public static google.devtools.cloudbuild.v2.GitHubConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GitHubConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubConfigOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubConfigOrBuilder.java new file mode 100644 index 000000000000..6376d053a113 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubConfigOrBuilder.java @@ -0,0 +1,79 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface GitHubConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.GitHubConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * OAuth credential of the account that authorized the Cloud Build GitHub App.
+   * It is recommended to use a robot account instead of a human user account.
+   * The OAuth token must be tied to the Cloud Build GitHub App.
+   * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + * + * @return Whether the authorizerCredential field is set. + */ + boolean hasAuthorizerCredential(); + /** + * + * + *
+   * OAuth credential of the account that authorized the Cloud Build GitHub App.
+   * It is recommended to use a robot account instead of a human user account.
+   * The OAuth token must be tied to the Cloud Build GitHub App.
+   * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + * + * @return The authorizerCredential. + */ + google.devtools.cloudbuild.v2.OAuthCredential getAuthorizerCredential(); + /** + * + * + *
+   * OAuth credential of the account that authorized the Cloud Build GitHub App.
+   * It is recommended to use a robot account instead of a human user account.
+   * The OAuth token must be tied to the Cloud Build GitHub App.
+   * 
+ * + * .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; + */ + google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder getAuthorizerCredentialOrBuilder(); + + /** + * + * + *
+   * GitHub App installation id.
+   * 
+ * + * int64 app_installation_id = 2; + * + * @return The appInstallationId. + */ + long getAppInstallationId(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubEnterpriseConfig.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubEnterpriseConfig.java new file mode 100644 index 000000000000..4e0213338cae --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubEnterpriseConfig.java @@ -0,0 +1,2271 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Configuration for connections to an instance of GitHub Enterprise.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GitHubEnterpriseConfig} + */ +public final class GitHubEnterpriseConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) + GitHubEnterpriseConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use GitHubEnterpriseConfig.newBuilder() to construct. + private GitHubEnterpriseConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GitHubEnterpriseConfig() { + hostUri_ = ""; + apiKey_ = ""; + appSlug_ = ""; + privateKeySecretVersion_ = ""; + webhookSecretSecretVersion_ = ""; + sslCa_ = ""; + serverVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GitHubEnterpriseConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.class, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder.class); + } + + public static final int HOST_URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object hostUri_ = ""; + /** + * + * + *
+   * Required. The URI of the GitHub Enterprise host this connection is for.
+   * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The hostUri. + */ + @java.lang.Override + public java.lang.String getHostUri() { + java.lang.Object ref = hostUri_; + 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(); + hostUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The URI of the GitHub Enterprise host this connection is for.
+   * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for hostUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHostUriBytes() { + java.lang.Object ref = hostUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int API_KEY_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiKey_ = ""; + /** + * + * + *
+   * Required. API Key used for authentication of webhook events.
+   * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The apiKey. + */ + @java.lang.Override + public java.lang.String getApiKey() { + java.lang.Object ref = apiKey_; + 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(); + apiKey_ = s; + return s; + } + } + /** + * + * + *
+   * Required. API Key used for authentication of webhook events.
+   * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for apiKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiKeyBytes() { + java.lang.Object ref = apiKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_ID_FIELD_NUMBER = 2; + private long appId_ = 0L; + /** + * + * + *
+   * Id of the GitHub App created from the manifest.
+   * 
+ * + * int64 app_id = 2; + * + * @return The appId. + */ + @java.lang.Override + public long getAppId() { + return appId_; + } + + public static final int APP_SLUG_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object appSlug_ = ""; + /** + * + * + *
+   * The URL-friendly name of the GitHub App.
+   * 
+ * + * string app_slug = 13; + * + * @return The appSlug. + */ + @java.lang.Override + public java.lang.String getAppSlug() { + java.lang.Object ref = appSlug_; + 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(); + appSlug_ = s; + return s; + } + } + /** + * + * + *
+   * The URL-friendly name of the GitHub App.
+   * 
+ * + * string app_slug = 13; + * + * @return The bytes for appSlug. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAppSlugBytes() { + java.lang.Object ref = appSlug_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appSlug_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRIVATE_KEY_SECRET_VERSION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object privateKeySecretVersion_ = ""; + /** + * + * + *
+   * SecretManager resource containing the private key of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * @return The privateKeySecretVersion. + */ + @java.lang.Override + public java.lang.String getPrivateKeySecretVersion() { + java.lang.Object ref = privateKeySecretVersion_; + 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(); + privateKeySecretVersion_ = s; + return s; + } + } + /** + * + * + *
+   * SecretManager resource containing the private key of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for privateKeySecretVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrivateKeySecretVersionBytes() { + java.lang.Object ref = privateKeySecretVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeySecretVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WEBHOOK_SECRET_SECRET_VERSION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object webhookSecretSecretVersion_ = ""; + /** + * + * + *
+   * SecretManager resource containing the webhook secret of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return The webhookSecretSecretVersion. + */ + @java.lang.Override + public java.lang.String getWebhookSecretSecretVersion() { + java.lang.Object ref = webhookSecretSecretVersion_; + 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(); + webhookSecretSecretVersion_ = s; + return s; + } + } + /** + * + * + *
+   * SecretManager resource containing the webhook secret of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for webhookSecretSecretVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWebhookSecretSecretVersionBytes() { + java.lang.Object ref = webhookSecretSecretVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + webhookSecretSecretVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_INSTALLATION_ID_FIELD_NUMBER = 9; + private long appInstallationId_ = 0L; + /** + * + * + *
+   * ID of the installation of the GitHub App.
+   * 
+ * + * int64 app_installation_id = 9; + * + * @return The appInstallationId. + */ + @java.lang.Override + public long getAppInstallationId() { + return appInstallationId_; + } + + public static final int SERVICE_DIRECTORY_CONFIG_FIELD_NUMBER = 10; + private google.devtools.cloudbuild.v2.ServiceDirectoryConfig serviceDirectoryConfig_; + /** + * + * + *
+   * Configuration for using Service Directory to privately connect to a GitHub
+   * Enterprise server. This should only be set if the GitHub Enterprise server
+   * is hosted on-premises and not reachable by public internet. If this field
+   * is left empty, calls to the GitHub Enterprise server will be made over the
+   * public internet.
+   * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + * + * @return Whether the serviceDirectoryConfig field is set. + */ + @java.lang.Override + public boolean hasServiceDirectoryConfig() { + return serviceDirectoryConfig_ != null; + } + /** + * + * + *
+   * Configuration for using Service Directory to privately connect to a GitHub
+   * Enterprise server. This should only be set if the GitHub Enterprise server
+   * is hosted on-premises and not reachable by public internet. If this field
+   * is left empty, calls to the GitHub Enterprise server will be made over the
+   * public internet.
+   * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + * + * @return The serviceDirectoryConfig. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig getServiceDirectoryConfig() { + return serviceDirectoryConfig_ == null + ? google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance() + : serviceDirectoryConfig_; + } + /** + * + * + *
+   * Configuration for using Service Directory to privately connect to a GitHub
+   * Enterprise server. This should only be set if the GitHub Enterprise server
+   * is hosted on-premises and not reachable by public internet. If this field
+   * is left empty, calls to the GitHub Enterprise server will be made over the
+   * public internet.
+   * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder + getServiceDirectoryConfigOrBuilder() { + return serviceDirectoryConfig_ == null + ? google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance() + : serviceDirectoryConfig_; + } + + public static final int SSL_CA_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object sslCa_ = ""; + /** + * + * + *
+   * SSL certificate to use for requests to GitHub Enterprise.
+   * 
+ * + * string ssl_ca = 11; + * + * @return The sslCa. + */ + @java.lang.Override + public java.lang.String getSslCa() { + java.lang.Object ref = sslCa_; + 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(); + sslCa_ = s; + return s; + } + } + /** + * + * + *
+   * SSL certificate to use for requests to GitHub Enterprise.
+   * 
+ * + * string ssl_ca = 11; + * + * @return The bytes for sslCa. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSslCaBytes() { + java.lang.Object ref = sslCa_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sslCa_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVER_VERSION_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object serverVersion_ = ""; + /** + * + * + *
+   * Output only. GitHub Enterprise version installed at the host_uri.
+   * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serverVersion. + */ + @java.lang.Override + public java.lang.String getServerVersion() { + java.lang.Object ref = serverVersion_; + 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(); + serverVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. GitHub Enterprise version installed at the host_uri.
+   * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serverVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServerVersionBytes() { + java.lang.Object ref = serverVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverVersion_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hostUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostUri_); + } + if (appId_ != 0L) { + output.writeInt64(2, appId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(privateKeySecretVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, privateKeySecretVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webhookSecretSecretVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, webhookSecretSecretVersion_); + } + if (appInstallationId_ != 0L) { + output.writeInt64(9, appInstallationId_); + } + if (serviceDirectoryConfig_ != null) { + output.writeMessage(10, getServiceDirectoryConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sslCa_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, sslCa_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, apiKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appSlug_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, appSlug_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, serverVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(hostUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostUri_); + } + if (appId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, appId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(privateKeySecretVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, privateKeySecretVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webhookSecretSecretVersion_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(5, webhookSecretSecretVersion_); + } + if (appInstallationId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, appInstallationId_); + } + if (serviceDirectoryConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(10, getServiceDirectoryConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sslCa_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, sslCa_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, apiKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appSlug_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, appSlug_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, serverVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.GitHubEnterpriseConfig)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig other = + (google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) obj; + + if (!getHostUri().equals(other.getHostUri())) return false; + if (!getApiKey().equals(other.getApiKey())) return false; + if (getAppId() != other.getAppId()) return false; + if (!getAppSlug().equals(other.getAppSlug())) return false; + if (!getPrivateKeySecretVersion().equals(other.getPrivateKeySecretVersion())) return false; + if (!getWebhookSecretSecretVersion().equals(other.getWebhookSecretSecretVersion())) + return false; + if (getAppInstallationId() != other.getAppInstallationId()) return false; + if (hasServiceDirectoryConfig() != other.hasServiceDirectoryConfig()) return false; + if (hasServiceDirectoryConfig()) { + if (!getServiceDirectoryConfig().equals(other.getServiceDirectoryConfig())) return false; + } + if (!getSslCa().equals(other.getSslCa())) return false; + if (!getServerVersion().equals(other.getServerVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + HOST_URI_FIELD_NUMBER; + hash = (53 * hash) + getHostUri().hashCode(); + hash = (37 * hash) + API_KEY_FIELD_NUMBER; + hash = (53 * hash) + getApiKey().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAppId()); + hash = (37 * hash) + APP_SLUG_FIELD_NUMBER; + hash = (53 * hash) + getAppSlug().hashCode(); + hash = (37 * hash) + PRIVATE_KEY_SECRET_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getPrivateKeySecretVersion().hashCode(); + hash = (37 * hash) + WEBHOOK_SECRET_SECRET_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getWebhookSecretSecretVersion().hashCode(); + hash = (37 * hash) + APP_INSTALLATION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAppInstallationId()); + if (hasServiceDirectoryConfig()) { + hash = (37 * hash) + SERVICE_DIRECTORY_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServiceDirectoryConfig().hashCode(); + } + hash = (37 * hash) + SSL_CA_FIELD_NUMBER; + hash = (53 * hash) + getSslCa().hashCode(); + hash = (37 * hash) + SERVER_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getServerVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig 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 google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig 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 google.devtools.cloudbuild.v2.GitHubEnterpriseConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig 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(google.devtools.cloudbuild.v2.GitHubEnterpriseConfig 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; + } + /** + * + * + *
+   * Configuration for connections to an instance of GitHub Enterprise.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.GitHubEnterpriseConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) + google.devtools.cloudbuild.v2.GitHubEnterpriseConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.class, + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + hostUri_ = ""; + apiKey_ = ""; + appId_ = 0L; + appSlug_ = ""; + privateKeySecretVersion_ = ""; + webhookSecretSecretVersion_ = ""; + appInstallationId_ = 0L; + serviceDirectoryConfig_ = null; + if (serviceDirectoryConfigBuilder_ != null) { + serviceDirectoryConfigBuilder_.dispose(); + serviceDirectoryConfigBuilder_ = null; + } + sslCa_ = ""; + serverVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig build() { + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig buildPartial() { + google.devtools.cloudbuild.v2.GitHubEnterpriseConfig result = + new google.devtools.cloudbuild.v2.GitHubEnterpriseConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.GitHubEnterpriseConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.hostUri_ = hostUri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.apiKey_ = apiKey_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appId_ = appId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.appSlug_ = appSlug_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.privateKeySecretVersion_ = privateKeySecretVersion_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.webhookSecretSecretVersion_ = webhookSecretSecretVersion_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.appInstallationId_ = appInstallationId_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.serviceDirectoryConfig_ = + serviceDirectoryConfigBuilder_ == null + ? serviceDirectoryConfig_ + : serviceDirectoryConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sslCa_ = sslCa_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.serverVersion_ = serverVersion_; + } + } + + @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 google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) { + return mergeFrom((google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.GitHubEnterpriseConfig other) { + if (other == google.devtools.cloudbuild.v2.GitHubEnterpriseConfig.getDefaultInstance()) + return this; + if (!other.getHostUri().isEmpty()) { + hostUri_ = other.hostUri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getApiKey().isEmpty()) { + apiKey_ = other.apiKey_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getAppId() != 0L) { + setAppId(other.getAppId()); + } + if (!other.getAppSlug().isEmpty()) { + appSlug_ = other.appSlug_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getPrivateKeySecretVersion().isEmpty()) { + privateKeySecretVersion_ = other.privateKeySecretVersion_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getWebhookSecretSecretVersion().isEmpty()) { + webhookSecretSecretVersion_ = other.webhookSecretSecretVersion_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.getAppInstallationId() != 0L) { + setAppInstallationId(other.getAppInstallationId()); + } + if (other.hasServiceDirectoryConfig()) { + mergeServiceDirectoryConfig(other.getServiceDirectoryConfig()); + } + if (!other.getSslCa().isEmpty()) { + sslCa_ = other.sslCa_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (!other.getServerVersion().isEmpty()) { + serverVersion_ = other.serverVersion_; + bitField0_ |= 0x00000200; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + hostUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + appId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 16 + case 34: + { + privateKeySecretVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + webhookSecretSecretVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 72: + { + appInstallationId_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 72 + case 82: + { + input.readMessage( + getServiceDirectoryConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + sslCa_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 90 + case 98: + { + apiKey_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 98 + case 106: + { + appSlug_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 106 + case 114: + { + serverVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object hostUri_ = ""; + /** + * + * + *
+     * Required. The URI of the GitHub Enterprise host this connection is for.
+     * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The hostUri. + */ + public java.lang.String getHostUri() { + java.lang.Object ref = hostUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The URI of the GitHub Enterprise host this connection is for.
+     * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for hostUri. + */ + public com.google.protobuf.ByteString getHostUriBytes() { + java.lang.Object ref = hostUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The URI of the GitHub Enterprise host this connection is for.
+     * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The hostUri to set. + * @return This builder for chaining. + */ + public Builder setHostUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + hostUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The URI of the GitHub Enterprise host this connection is for.
+     * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearHostUri() { + hostUri_ = getDefaultInstance().getHostUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The URI of the GitHub Enterprise host this connection is for.
+     * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for hostUri to set. + * @return This builder for chaining. + */ + public Builder setHostUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + hostUri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object apiKey_ = ""; + /** + * + * + *
+     * Required. API Key used for authentication of webhook events.
+     * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The apiKey. + */ + public java.lang.String getApiKey() { + java.lang.Object ref = apiKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. API Key used for authentication of webhook events.
+     * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for apiKey. + */ + public com.google.protobuf.ByteString getApiKeyBytes() { + java.lang.Object ref = apiKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. API Key used for authentication of webhook events.
+     * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The apiKey to set. + * @return This builder for chaining. + */ + public Builder setApiKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. API Key used for authentication of webhook events.
+     * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearApiKey() { + apiKey_ = getDefaultInstance().getApiKey(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. API Key used for authentication of webhook events.
+     * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for apiKey to set. + * @return This builder for chaining. + */ + public Builder setApiKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiKey_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long appId_; + /** + * + * + *
+     * Id of the GitHub App created from the manifest.
+     * 
+ * + * int64 app_id = 2; + * + * @return The appId. + */ + @java.lang.Override + public long getAppId() { + return appId_; + } + /** + * + * + *
+     * Id of the GitHub App created from the manifest.
+     * 
+ * + * int64 app_id = 2; + * + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId(long value) { + + appId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Id of the GitHub App created from the manifest.
+     * 
+ * + * int64 app_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearAppId() { + bitField0_ = (bitField0_ & ~0x00000004); + appId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object appSlug_ = ""; + /** + * + * + *
+     * The URL-friendly name of the GitHub App.
+     * 
+ * + * string app_slug = 13; + * + * @return The appSlug. + */ + public java.lang.String getAppSlug() { + java.lang.Object ref = appSlug_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appSlug_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URL-friendly name of the GitHub App.
+     * 
+ * + * string app_slug = 13; + * + * @return The bytes for appSlug. + */ + public com.google.protobuf.ByteString getAppSlugBytes() { + java.lang.Object ref = appSlug_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + appSlug_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URL-friendly name of the GitHub App.
+     * 
+ * + * string app_slug = 13; + * + * @param value The appSlug to set. + * @return This builder for chaining. + */ + public Builder setAppSlug(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + appSlug_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The URL-friendly name of the GitHub App.
+     * 
+ * + * string app_slug = 13; + * + * @return This builder for chaining. + */ + public Builder clearAppSlug() { + appSlug_ = getDefaultInstance().getAppSlug(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The URL-friendly name of the GitHub App.
+     * 
+ * + * string app_slug = 13; + * + * @param value The bytes for appSlug to set. + * @return This builder for chaining. + */ + public Builder setAppSlugBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + appSlug_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object privateKeySecretVersion_ = ""; + /** + * + * + *
+     * SecretManager resource containing the private key of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * + * @return The privateKeySecretVersion. + */ + public java.lang.String getPrivateKeySecretVersion() { + java.lang.Object ref = privateKeySecretVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + privateKeySecretVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * SecretManager resource containing the private key of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for privateKeySecretVersion. + */ + public com.google.protobuf.ByteString getPrivateKeySecretVersionBytes() { + java.lang.Object ref = privateKeySecretVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + privateKeySecretVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * SecretManager resource containing the private key of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * + * @param value The privateKeySecretVersion to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeySecretVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + privateKeySecretVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * SecretManager resource containing the private key of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearPrivateKeySecretVersion() { + privateKeySecretVersion_ = getDefaultInstance().getPrivateKeySecretVersion(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * SecretManager resource containing the private key of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for privateKeySecretVersion to set. + * @return This builder for chaining. + */ + public Builder setPrivateKeySecretVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + privateKeySecretVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object webhookSecretSecretVersion_ = ""; + /** + * + * + *
+     * SecretManager resource containing the webhook secret of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return The webhookSecretSecretVersion. + */ + public java.lang.String getWebhookSecretSecretVersion() { + java.lang.Object ref = webhookSecretSecretVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + webhookSecretSecretVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * SecretManager resource containing the webhook secret of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for webhookSecretSecretVersion. + */ + public com.google.protobuf.ByteString getWebhookSecretSecretVersionBytes() { + java.lang.Object ref = webhookSecretSecretVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + webhookSecretSecretVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * SecretManager resource containing the webhook secret of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @param value The webhookSecretSecretVersion to set. + * @return This builder for chaining. + */ + public Builder setWebhookSecretSecretVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + webhookSecretSecretVersion_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * SecretManager resource containing the webhook secret of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearWebhookSecretSecretVersion() { + webhookSecretSecretVersion_ = getDefaultInstance().getWebhookSecretSecretVersion(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * SecretManager resource containing the webhook secret of the GitHub App,
+     * formatted as `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for webhookSecretSecretVersion to set. + * @return This builder for chaining. + */ + public Builder setWebhookSecretSecretVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + webhookSecretSecretVersion_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private long appInstallationId_; + /** + * + * + *
+     * ID of the installation of the GitHub App.
+     * 
+ * + * int64 app_installation_id = 9; + * + * @return The appInstallationId. + */ + @java.lang.Override + public long getAppInstallationId() { + return appInstallationId_; + } + /** + * + * + *
+     * ID of the installation of the GitHub App.
+     * 
+ * + * int64 app_installation_id = 9; + * + * @param value The appInstallationId to set. + * @return This builder for chaining. + */ + public Builder setAppInstallationId(long value) { + + appInstallationId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the installation of the GitHub App.
+     * 
+ * + * int64 app_installation_id = 9; + * + * @return This builder for chaining. + */ + public Builder clearAppInstallationId() { + bitField0_ = (bitField0_ & ~0x00000040); + appInstallationId_ = 0L; + onChanged(); + return this; + } + + private google.devtools.cloudbuild.v2.ServiceDirectoryConfig serviceDirectoryConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.ServiceDirectoryConfig, + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder, + google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder> + serviceDirectoryConfigBuilder_; + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + * + * @return Whether the serviceDirectoryConfig field is set. + */ + public boolean hasServiceDirectoryConfig() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + * + * @return The serviceDirectoryConfig. + */ + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig getServiceDirectoryConfig() { + if (serviceDirectoryConfigBuilder_ == null) { + return serviceDirectoryConfig_ == null + ? google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance() + : serviceDirectoryConfig_; + } else { + return serviceDirectoryConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + public Builder setServiceDirectoryConfig( + google.devtools.cloudbuild.v2.ServiceDirectoryConfig value) { + if (serviceDirectoryConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceDirectoryConfig_ = value; + } else { + serviceDirectoryConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + public Builder setServiceDirectoryConfig( + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder builderForValue) { + if (serviceDirectoryConfigBuilder_ == null) { + serviceDirectoryConfig_ = builderForValue.build(); + } else { + serviceDirectoryConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + public Builder mergeServiceDirectoryConfig( + google.devtools.cloudbuild.v2.ServiceDirectoryConfig value) { + if (serviceDirectoryConfigBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && serviceDirectoryConfig_ != null + && serviceDirectoryConfig_ + != google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance()) { + getServiceDirectoryConfigBuilder().mergeFrom(value); + } else { + serviceDirectoryConfig_ = value; + } + } else { + serviceDirectoryConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + public Builder clearServiceDirectoryConfig() { + bitField0_ = (bitField0_ & ~0x00000080); + serviceDirectoryConfig_ = null; + if (serviceDirectoryConfigBuilder_ != null) { + serviceDirectoryConfigBuilder_.dispose(); + serviceDirectoryConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder + getServiceDirectoryConfigBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getServiceDirectoryConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + public google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder + getServiceDirectoryConfigOrBuilder() { + if (serviceDirectoryConfigBuilder_ != null) { + return serviceDirectoryConfigBuilder_.getMessageOrBuilder(); + } else { + return serviceDirectoryConfig_ == null + ? google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance() + : serviceDirectoryConfig_; + } + } + /** + * + * + *
+     * Configuration for using Service Directory to privately connect to a GitHub
+     * Enterprise server. This should only be set if the GitHub Enterprise server
+     * is hosted on-premises and not reachable by public internet. If this field
+     * is left empty, calls to the GitHub Enterprise server will be made over the
+     * public internet.
+     * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.ServiceDirectoryConfig, + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder, + google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder> + getServiceDirectoryConfigFieldBuilder() { + if (serviceDirectoryConfigBuilder_ == null) { + serviceDirectoryConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.ServiceDirectoryConfig, + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder, + google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder>( + getServiceDirectoryConfig(), getParentForChildren(), isClean()); + serviceDirectoryConfig_ = null; + } + return serviceDirectoryConfigBuilder_; + } + + private java.lang.Object sslCa_ = ""; + /** + * + * + *
+     * SSL certificate to use for requests to GitHub Enterprise.
+     * 
+ * + * string ssl_ca = 11; + * + * @return The sslCa. + */ + public java.lang.String getSslCa() { + java.lang.Object ref = sslCa_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sslCa_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * SSL certificate to use for requests to GitHub Enterprise.
+     * 
+ * + * string ssl_ca = 11; + * + * @return The bytes for sslCa. + */ + public com.google.protobuf.ByteString getSslCaBytes() { + java.lang.Object ref = sslCa_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sslCa_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * SSL certificate to use for requests to GitHub Enterprise.
+     * 
+ * + * string ssl_ca = 11; + * + * @param value The sslCa to set. + * @return This builder for chaining. + */ + public Builder setSslCa(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sslCa_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * SSL certificate to use for requests to GitHub Enterprise.
+     * 
+ * + * string ssl_ca = 11; + * + * @return This builder for chaining. + */ + public Builder clearSslCa() { + sslCa_ = getDefaultInstance().getSslCa(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * SSL certificate to use for requests to GitHub Enterprise.
+     * 
+ * + * string ssl_ca = 11; + * + * @param value The bytes for sslCa to set. + * @return This builder for chaining. + */ + public Builder setSslCaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sslCa_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object serverVersion_ = ""; + /** + * + * + *
+     * Output only. GitHub Enterprise version installed at the host_uri.
+     * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serverVersion. + */ + public java.lang.String getServerVersion() { + java.lang.Object ref = serverVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serverVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. GitHub Enterprise version installed at the host_uri.
+     * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serverVersion. + */ + public com.google.protobuf.ByteString getServerVersionBytes() { + java.lang.Object ref = serverVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serverVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. GitHub Enterprise version installed at the host_uri.
+     * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The serverVersion to set. + * @return This builder for chaining. + */ + public Builder setServerVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serverVersion_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. GitHub Enterprise version installed at the host_uri.
+     * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearServerVersion() { + serverVersion_ = getDefaultInstance().getServerVersion(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. GitHub Enterprise version installed at the host_uri.
+     * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for serverVersion to set. + * @return This builder for chaining. + */ + public Builder setServerVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serverVersion_ = value; + bitField0_ |= 0x00000200; + 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.cloudbuild.v2.GitHubEnterpriseConfig) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) + private static final google.devtools.cloudbuild.v2.GitHubEnterpriseConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.GitHubEnterpriseConfig(); + } + + public static google.devtools.cloudbuild.v2.GitHubEnterpriseConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GitHubEnterpriseConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.GitHubEnterpriseConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubEnterpriseConfigOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubEnterpriseConfigOrBuilder.java new file mode 100644 index 000000000000..5e9672154f05 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/GitHubEnterpriseConfigOrBuilder.java @@ -0,0 +1,283 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface GitHubEnterpriseConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.GitHubEnterpriseConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The URI of the GitHub Enterprise host this connection is for.
+   * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The hostUri. + */ + java.lang.String getHostUri(); + /** + * + * + *
+   * Required. The URI of the GitHub Enterprise host this connection is for.
+   * 
+ * + * string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for hostUri. + */ + com.google.protobuf.ByteString getHostUriBytes(); + + /** + * + * + *
+   * Required. API Key used for authentication of webhook events.
+   * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The apiKey. + */ + java.lang.String getApiKey(); + /** + * + * + *
+   * Required. API Key used for authentication of webhook events.
+   * 
+ * + * string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for apiKey. + */ + com.google.protobuf.ByteString getApiKeyBytes(); + + /** + * + * + *
+   * Id of the GitHub App created from the manifest.
+   * 
+ * + * int64 app_id = 2; + * + * @return The appId. + */ + long getAppId(); + + /** + * + * + *
+   * The URL-friendly name of the GitHub App.
+   * 
+ * + * string app_slug = 13; + * + * @return The appSlug. + */ + java.lang.String getAppSlug(); + /** + * + * + *
+   * The URL-friendly name of the GitHub App.
+   * 
+ * + * string app_slug = 13; + * + * @return The bytes for appSlug. + */ + com.google.protobuf.ByteString getAppSlugBytes(); + + /** + * + * + *
+   * SecretManager resource containing the private key of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * @return The privateKeySecretVersion. + */ + java.lang.String getPrivateKeySecretVersion(); + /** + * + * + *
+   * SecretManager resource containing the private key of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string private_key_secret_version = 4 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for privateKeySecretVersion. + */ + com.google.protobuf.ByteString getPrivateKeySecretVersionBytes(); + + /** + * + * + *
+   * SecretManager resource containing the webhook secret of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return The webhookSecretSecretVersion. + */ + java.lang.String getWebhookSecretSecretVersion(); + /** + * + * + *
+   * SecretManager resource containing the webhook secret of the GitHub App,
+   * formatted as `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for webhookSecretSecretVersion. + */ + com.google.protobuf.ByteString getWebhookSecretSecretVersionBytes(); + + /** + * + * + *
+   * ID of the installation of the GitHub App.
+   * 
+ * + * int64 app_installation_id = 9; + * + * @return The appInstallationId. + */ + long getAppInstallationId(); + + /** + * + * + *
+   * Configuration for using Service Directory to privately connect to a GitHub
+   * Enterprise server. This should only be set if the GitHub Enterprise server
+   * is hosted on-premises and not reachable by public internet. If this field
+   * is left empty, calls to the GitHub Enterprise server will be made over the
+   * public internet.
+   * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + * + * @return Whether the serviceDirectoryConfig field is set. + */ + boolean hasServiceDirectoryConfig(); + /** + * + * + *
+   * Configuration for using Service Directory to privately connect to a GitHub
+   * Enterprise server. This should only be set if the GitHub Enterprise server
+   * is hosted on-premises and not reachable by public internet. If this field
+   * is left empty, calls to the GitHub Enterprise server will be made over the
+   * public internet.
+   * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + * + * @return The serviceDirectoryConfig. + */ + google.devtools.cloudbuild.v2.ServiceDirectoryConfig getServiceDirectoryConfig(); + /** + * + * + *
+   * Configuration for using Service Directory to privately connect to a GitHub
+   * Enterprise server. This should only be set if the GitHub Enterprise server
+   * is hosted on-premises and not reachable by public internet. If this field
+   * is left empty, calls to the GitHub Enterprise server will be made over the
+   * public internet.
+   * 
+ * + * .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; + * + */ + google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder + getServiceDirectoryConfigOrBuilder(); + + /** + * + * + *
+   * SSL certificate to use for requests to GitHub Enterprise.
+   * 
+ * + * string ssl_ca = 11; + * + * @return The sslCa. + */ + java.lang.String getSslCa(); + /** + * + * + *
+   * SSL certificate to use for requests to GitHub Enterprise.
+   * 
+ * + * string ssl_ca = 11; + * + * @return The bytes for sslCa. + */ + com.google.protobuf.ByteString getSslCaBytes(); + + /** + * + * + *
+   * Output only. GitHub Enterprise version installed at the host_uri.
+   * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serverVersion. + */ + java.lang.String getServerVersion(); + /** + * + * + *
+   * Output only. GitHub Enterprise version installed at the host_uri.
+   * 
+ * + * string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serverVersion. + */ + com.google.protobuf.ByteString getServerVersionBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/InstallationState.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/InstallationState.java new file mode 100644 index 000000000000..9214154eaa3f --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/InstallationState.java @@ -0,0 +1,1200 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Describes stage and necessary actions to be taken by the
+ * user to complete the installation. Used for GitHub and GitHub Enterprise
+ * based connections.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.InstallationState} + */ +public final class InstallationState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.InstallationState) + InstallationStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstallationState.newBuilder() to construct. + private InstallationState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InstallationState() { + stage_ = 0; + message_ = ""; + actionUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InstallationState(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_InstallationState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_InstallationState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.InstallationState.class, + google.devtools.cloudbuild.v2.InstallationState.Builder.class); + } + + /** + * + * + *
+   * Stage of the installation process.
+   * 
+ * + * Protobuf enum {@code google.devtools.cloudbuild.v2.InstallationState.Stage} + */ + public enum Stage implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No stage specified.
+     * 
+ * + * STAGE_UNSPECIFIED = 0; + */ + STAGE_UNSPECIFIED(0), + /** + * + * + *
+     * Only for GitHub Enterprise. An App creation has been requested.
+     * The user needs to confirm the creation in their GitHub enterprise host.
+     * 
+ * + * PENDING_CREATE_APP = 1; + */ + PENDING_CREATE_APP(1), + /** + * + * + *
+     * User needs to authorize the GitHub (or Enterprise) App via OAuth.
+     * 
+ * + * PENDING_USER_OAUTH = 2; + */ + PENDING_USER_OAUTH(2), + /** + * + * + *
+     * User needs to follow the link to install the GitHub (or Enterprise) App.
+     * 
+ * + * PENDING_INSTALL_APP = 3; + */ + PENDING_INSTALL_APP(3), + /** + * + * + *
+     * Installation process has been completed.
+     * 
+ * + * COMPLETE = 10; + */ + COMPLETE(10), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No stage specified.
+     * 
+ * + * STAGE_UNSPECIFIED = 0; + */ + public static final int STAGE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Only for GitHub Enterprise. An App creation has been requested.
+     * The user needs to confirm the creation in their GitHub enterprise host.
+     * 
+ * + * PENDING_CREATE_APP = 1; + */ + public static final int PENDING_CREATE_APP_VALUE = 1; + /** + * + * + *
+     * User needs to authorize the GitHub (or Enterprise) App via OAuth.
+     * 
+ * + * PENDING_USER_OAUTH = 2; + */ + public static final int PENDING_USER_OAUTH_VALUE = 2; + /** + * + * + *
+     * User needs to follow the link to install the GitHub (or Enterprise) App.
+     * 
+ * + * PENDING_INSTALL_APP = 3; + */ + public static final int PENDING_INSTALL_APP_VALUE = 3; + /** + * + * + *
+     * Installation process has been completed.
+     * 
+ * + * COMPLETE = 10; + */ + public static final int COMPLETE_VALUE = 10; + + 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 Stage 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 Stage forNumber(int value) { + switch (value) { + case 0: + return STAGE_UNSPECIFIED; + case 1: + return PENDING_CREATE_APP; + case 2: + return PENDING_USER_OAUTH; + case 3: + return PENDING_INSTALL_APP; + case 10: + return COMPLETE; + 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 Stage findValueByNumber(int number) { + return Stage.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 google.devtools.cloudbuild.v2.InstallationState.getDescriptor().getEnumTypes().get(0); + } + + private static final Stage[] VALUES = values(); + + public static Stage 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 Stage(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.devtools.cloudbuild.v2.InstallationState.Stage) + } + + public static final int STAGE_FIELD_NUMBER = 1; + private int stage_ = 0; + /** + * + * + *
+   * Output only. Current step of the installation process.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+   * Output only. Current step of the installation process.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stage. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState.Stage getStage() { + google.devtools.cloudbuild.v2.InstallationState.Stage result = + google.devtools.cloudbuild.v2.InstallationState.Stage.forNumber(stage_); + return result == null + ? google.devtools.cloudbuild.v2.InstallationState.Stage.UNRECOGNIZED + : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + /** + * + * + *
+   * Output only. Message of what the user should do next to continue the
+   * installation. Empty string if the installation is already complete.
+   * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Message of what the user should do next to continue the
+   * installation. Empty string if the installation is already complete.
+   * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_URI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object actionUri_ = ""; + /** + * + * + *
+   * Output only. Link to follow for next action. Empty string if the
+   * installation is already complete.
+   * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The actionUri. + */ + @java.lang.Override + public java.lang.String getActionUri() { + java.lang.Object ref = actionUri_; + 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(); + actionUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Link to follow for next action. Empty string if the
+   * installation is already complete.
+   * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for actionUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActionUriBytes() { + java.lang.Object ref = actionUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionUri_ = 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 (stage_ + != google.devtools.cloudbuild.v2.InstallationState.Stage.STAGE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, stage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, actionUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (stage_ + != google.devtools.cloudbuild.v2.InstallationState.Stage.STAGE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, stage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(actionUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, actionUri_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.InstallationState)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.InstallationState other = + (google.devtools.cloudbuild.v2.InstallationState) obj; + + if (stage_ != other.stage_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!getActionUri().equals(other.getActionUri())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + STAGE_FIELD_NUMBER; + hash = (53 * hash) + stage_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + ACTION_URI_FIELD_NUMBER; + hash = (53 * hash) + getActionUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.InstallationState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.InstallationState 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 google.devtools.cloudbuild.v2.InstallationState parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.InstallationState 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 google.devtools.cloudbuild.v2.InstallationState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.InstallationState 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(google.devtools.cloudbuild.v2.InstallationState 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; + } + /** + * + * + *
+   * Describes stage and necessary actions to be taken by the
+   * user to complete the installation. Used for GitHub and GitHub Enterprise
+   * based connections.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.InstallationState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.InstallationState) + google.devtools.cloudbuild.v2.InstallationStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_InstallationState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_InstallationState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.InstallationState.class, + google.devtools.cloudbuild.v2.InstallationState.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.InstallationState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + stage_ = 0; + message_ = ""; + actionUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_InstallationState_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState build() { + google.devtools.cloudbuild.v2.InstallationState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState buildPartial() { + google.devtools.cloudbuild.v2.InstallationState result = + new google.devtools.cloudbuild.v2.InstallationState(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.InstallationState result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.stage_ = stage_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.actionUri_ = actionUri_; + } + } + + @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 google.devtools.cloudbuild.v2.InstallationState) { + return mergeFrom((google.devtools.cloudbuild.v2.InstallationState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.InstallationState other) { + if (other == google.devtools.cloudbuild.v2.InstallationState.getDefaultInstance()) + return this; + if (other.stage_ != 0) { + setStageValue(other.getStageValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getActionUri().isEmpty()) { + actionUri_ = other.actionUri_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + stage_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + actionUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int stage_ = 0; + /** + * + * + *
+     * Output only. Current step of the installation process.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+     * Output only. Current step of the installation process.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for stage to set. + * @return This builder for chaining. + */ + public Builder setStageValue(int value) { + stage_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current step of the installation process.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stage. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState.Stage getStage() { + google.devtools.cloudbuild.v2.InstallationState.Stage result = + google.devtools.cloudbuild.v2.InstallationState.Stage.forNumber(stage_); + return result == null + ? google.devtools.cloudbuild.v2.InstallationState.Stage.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current step of the installation process.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The stage to set. + * @return This builder for chaining. + */ + public Builder setStage(google.devtools.cloudbuild.v2.InstallationState.Stage value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + stage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current step of the installation process.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearStage() { + bitField0_ = (bitField0_ & ~0x00000001); + stage_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * Output only. Message of what the user should do next to continue the
+     * installation. Empty string if the installation is already complete.
+     * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Message of what the user should do next to continue the
+     * installation. Empty string if the installation is already complete.
+     * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Message of what the user should do next to continue the
+     * installation. Empty string if the installation is already complete.
+     * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message of what the user should do next to continue the
+     * installation. Empty string if the installation is already complete.
+     * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Message of what the user should do next to continue the
+     * installation. Empty string if the installation is already complete.
+     * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object actionUri_ = ""; + /** + * + * + *
+     * Output only. Link to follow for next action. Empty string if the
+     * installation is already complete.
+     * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The actionUri. + */ + public java.lang.String getActionUri() { + java.lang.Object ref = actionUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Link to follow for next action. Empty string if the
+     * installation is already complete.
+     * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for actionUri. + */ + public com.google.protobuf.ByteString getActionUriBytes() { + java.lang.Object ref = actionUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Link to follow for next action. Empty string if the
+     * installation is already complete.
+     * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The actionUri to set. + * @return This builder for chaining. + */ + public Builder setActionUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + actionUri_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Link to follow for next action. Empty string if the
+     * installation is already complete.
+     * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearActionUri() { + actionUri_ = getDefaultInstance().getActionUri(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Link to follow for next action. Empty string if the
+     * installation is already complete.
+     * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for actionUri to set. + * @return This builder for chaining. + */ + public Builder setActionUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + actionUri_ = value; + bitField0_ |= 0x00000004; + 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.cloudbuild.v2.InstallationState) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.InstallationState) + private static final google.devtools.cloudbuild.v2.InstallationState DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.InstallationState(); + } + + public static google.devtools.cloudbuild.v2.InstallationState getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstallationState parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.InstallationState getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/InstallationStateOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/InstallationStateOrBuilder.java new file mode 100644 index 000000000000..3d6710479e1f --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/InstallationStateOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface InstallationStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.InstallationState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Current step of the installation process.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for stage. + */ + int getStageValue(); + /** + * + * + *
+   * Output only. Current step of the installation process.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stage. + */ + google.devtools.cloudbuild.v2.InstallationState.Stage getStage(); + + /** + * + * + *
+   * Output only. Message of what the user should do next to continue the
+   * installation. Empty string if the installation is already complete.
+   * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * Output only. Message of what the user should do next to continue the
+   * installation. Empty string if the installation is already complete.
+   * 
+ * + * string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Output only. Link to follow for next action. Empty string if the
+   * installation is already complete.
+   * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The actionUri. + */ + java.lang.String getActionUri(); + /** + * + * + *
+   * Output only. Link to follow for next action. Empty string if the
+   * installation is already complete.
+   * 
+ * + * string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for actionUri. + */ + com.google.protobuf.ByteString getActionUriBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsRequest.java new file mode 100644 index 000000000000..c1376b8b7be0 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsRequest.java @@ -0,0 +1,925 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for requesting list of Connections.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListConnectionsRequest} + */ +public final class ListConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.ListConnectionsRequest) + ListConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConnectionsRequest.newBuilder() to construct. + private ListConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConnectionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConnectionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListConnectionsRequest.class, + google.devtools.cloudbuild.v2.ListConnectionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of Connections.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * 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 parent, which owns this collection of Connections.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Number of results to return in the list.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Page start.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Page start.
+   * 
+ * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.ListConnectionsRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.ListConnectionsRequest other = + (google.devtools.cloudbuild.v2.ListConnectionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest 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 google.devtools.cloudbuild.v2.ListConnectionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest 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 google.devtools.cloudbuild.v2.ListConnectionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest 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(google.devtools.cloudbuild.v2.ListConnectionsRequest 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; + } + /** + * + * + *
+   * Message for requesting list of Connections.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListConnectionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.ListConnectionsRequest) + google.devtools.cloudbuild.v2.ListConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListConnectionsRequest.class, + google.devtools.cloudbuild.v2.ListConnectionsRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.ListConnectionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.ListConnectionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsRequest build() { + google.devtools.cloudbuild.v2.ListConnectionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsRequest buildPartial() { + google.devtools.cloudbuild.v2.ListConnectionsRequest result = + new google.devtools.cloudbuild.v2.ListConnectionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.ListConnectionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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 google.devtools.cloudbuild.v2.ListConnectionsRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.ListConnectionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.ListConnectionsRequest other) { + if (other == google.devtools.cloudbuild.v2.ListConnectionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of Connections.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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 parent, which owns this collection of Connections.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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 parent, which owns this collection of Connections.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of Connections.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of Connections.
+     * Format: `projects/*/locations/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Number of results to return in the list.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Number of results to return in the list.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of results to return in the list.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + 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.cloudbuild.v2.ListConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.ListConnectionsRequest) + private static final google.devtools.cloudbuild.v2.ListConnectionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.ListConnectionsRequest(); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConnectionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsRequestOrBuilder.java new file mode 100644 index 000000000000..b785fa607de6 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface ListConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.ListConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of Connections.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of Connections.
+   * Format: `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Number of results to return in the list.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page start.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page start.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsResponse.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsResponse.java new file mode 100644 index 000000000000..3ab9c0fc2b1c --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsResponse.java @@ -0,0 +1,1125 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for response to listing Connections.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListConnectionsResponse} + */ +public final class ListConnectionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.ListConnectionsResponse) + ListConnectionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConnectionsResponse.newBuilder() to construct. + private ListConnectionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConnectionsResponse() { + connections_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConnectionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListConnectionsResponse.class, + google.devtools.cloudbuild.v2.ListConnectionsResponse.Builder.class); + } + + public static final int CONNECTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List connections_; + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + @java.lang.Override + public java.util.List getConnectionsList() { + return connections_; + } + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + @java.lang.Override + public java.util.List + getConnectionsOrBuilderList() { + return connections_; + } + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + @java.lang.Override + public int getConnectionsCount() { + return connections_.size(); + } + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection getConnections(int index) { + return connections_.get(index); + } + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionsOrBuilder(int index) { + return connections_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should 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 < connections_.size(); i++) { + output.writeMessage(1, connections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < connections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, connections_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.ListConnectionsResponse)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.ListConnectionsResponse other = + (google.devtools.cloudbuild.v2.ListConnectionsResponse) obj; + + if (!getConnectionsList().equals(other.getConnectionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse 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 google.devtools.cloudbuild.v2.ListConnectionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse 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 google.devtools.cloudbuild.v2.ListConnectionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse 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( + google.devtools.cloudbuild.v2.ListConnectionsResponse 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; + } + /** + * + * + *
+   * Message for response to listing Connections.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListConnectionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.ListConnectionsResponse) + google.devtools.cloudbuild.v2.ListConnectionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListConnectionsResponse.class, + google.devtools.cloudbuild.v2.ListConnectionsResponse.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.ListConnectionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + } else { + connections_ = null; + connectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsResponse getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.ListConnectionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsResponse build() { + google.devtools.cloudbuild.v2.ListConnectionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsResponse buildPartial() { + google.devtools.cloudbuild.v2.ListConnectionsResponse result = + new google.devtools.cloudbuild.v2.ListConnectionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + google.devtools.cloudbuild.v2.ListConnectionsResponse result) { + if (connectionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.connections_ = connections_; + } else { + result.connections_ = connectionsBuilder_.build(); + } + } + + private void buildPartial0(google.devtools.cloudbuild.v2.ListConnectionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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 google.devtools.cloudbuild.v2.ListConnectionsResponse) { + return mergeFrom((google.devtools.cloudbuild.v2.ListConnectionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.ListConnectionsResponse other) { + if (other == google.devtools.cloudbuild.v2.ListConnectionsResponse.getDefaultInstance()) + return this; + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); + } + onChanged(); + } + } else { + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + connectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConnectionsFieldBuilder() + : null; + } else { + connectionsBuilder_.addAllMessages(other.connections_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + google.devtools.cloudbuild.v2.Connection m = + input.readMessage( + google.devtools.cloudbuild.v2.Connection.parser(), extensionRegistry); + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(m); + } else { + connectionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List connections_ = + java.util.Collections.emptyList(); + + private void ensureConnectionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList(connections_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder> + connectionsBuilder_; + + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public java.util.List getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); + } else { + return connectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); + } else { + return connectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public google.devtools.cloudbuild.v2.Connection getConnections(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder setConnections(int index, google.devtools.cloudbuild.v2.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.set(index, value); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder setConnections( + int index, google.devtools.cloudbuild.v2.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder addConnections(google.devtools.cloudbuild.v2.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(value); + onChanged(); + } else { + connectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder addConnections(int index, google.devtools.cloudbuild.v2.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(index, value); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder addConnections( + google.devtools.cloudbuild.v2.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder addConnections( + int index, google.devtools.cloudbuild.v2.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder addAllConnections( + java.lang.Iterable values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connections_); + onChanged(); + } else { + connectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + connectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); + onChanged(); + } else { + connectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public google.devtools.cloudbuild.v2.Connection.Builder getConnectionsBuilder(int index) { + return getConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionsOrBuilder(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public java.util.List + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(connections_); + } + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public google.devtools.cloudbuild.v2.Connection.Builder addConnectionsBuilder() { + return getConnectionsFieldBuilder() + .addBuilder(google.devtools.cloudbuild.v2.Connection.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public google.devtools.cloudbuild.v2.Connection.Builder addConnectionsBuilder(int index) { + return getConnectionsFieldBuilder() + .addBuilder(index, google.devtools.cloudbuild.v2.Connection.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Connections.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + public java.util.List + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder>( + connections_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + connections_ = null; + } + return connectionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + bitField0_ |= 0x00000002; + 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.cloudbuild.v2.ListConnectionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.ListConnectionsResponse) + private static final google.devtools.cloudbuild.v2.ListConnectionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.ListConnectionsResponse(); + } + + public static google.devtools.cloudbuild.v2.ListConnectionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConnectionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListConnectionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsResponseOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsResponseOrBuilder.java new file mode 100644 index 000000000000..f183a05c7a82 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListConnectionsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface ListConnectionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.ListConnectionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + java.util.List getConnectionsList(); + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + google.devtools.cloudbuild.v2.Connection getConnections(int index); + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + int getConnectionsCount(); + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + java.util.List + getConnectionsOrBuilderList(); + /** + * + * + *
+   * The list of Connections.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Connection connections = 1; + */ + google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesRequest.java new file mode 100644 index 000000000000..024188d340dd --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesRequest.java @@ -0,0 +1,1129 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for requesting list of Repositories.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListRepositoriesRequest} + */ +public final class ListRepositoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.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_ = ""; + filter_ = ""; + } + + @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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListRepositoriesRequest.class, + google.devtools.cloudbuild.v2.ListRepositoriesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent, which owns this collection of Repositories.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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 parent, which owns this collection of Repositories.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Number of results to return in the list.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Page start.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Page start.
+   * 
+ * + * 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * Expressions must follow API improvement proposal
+   * [AIP-160](https://google.aip.dev/160). e.g.
+   * `remote_uri:"https://github.com*"`.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * Expressions must follow API improvement proposal
+   * [AIP-160](https://google.aip.dev/160). e.g.
+   * `remote_uri:"https://github.com*"`.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.ListRepositoriesRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.ListRepositoriesRequest other = + (google.devtools.cloudbuild.v2.ListRepositoriesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.ListRepositoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.ListRepositoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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( + google.devtools.cloudbuild.v2.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; + } + /** + * + * + *
+   * Message for requesting list of Repositories.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListRepositoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.ListRepositoriesRequest) + google.devtools.cloudbuild.v2.ListRepositoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListRepositoriesRequest.class, + google.devtools.cloudbuild.v2.ListRepositoriesRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.ListRepositoriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.ListRepositoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesRequest build() { + google.devtools.cloudbuild.v2.ListRepositoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesRequest buildPartial() { + google.devtools.cloudbuild.v2.ListRepositoriesRequest result = + new google.devtools.cloudbuild.v2.ListRepositoriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.ListRepositoriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + } + + @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 google.devtools.cloudbuild.v2.ListRepositoriesRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.ListRepositoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.ListRepositoriesRequest other) { + if (other == google.devtools.cloudbuild.v2.ListRepositoriesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of Repositories.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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 parent, which owns this collection of Repositories.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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 parent, which owns this collection of Repositories.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of Repositories.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of Repositories.
+     * Format: `projects/*/locations/*/connections/*`.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Number of results to return in the list.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Number of results to return in the list.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Number of results to return in the list.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Page start.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * Expressions must follow API improvement proposal
+     * [AIP-160](https://google.aip.dev/160). e.g.
+     * `remote_uri:"https://github.com*"`.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * Expressions must follow API improvement proposal
+     * [AIP-160](https://google.aip.dev/160). e.g.
+     * `remote_uri:"https://github.com*"`.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * Expressions must follow API improvement proposal
+     * [AIP-160](https://google.aip.dev/160). e.g.
+     * `remote_uri:"https://github.com*"`.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * Expressions must follow API improvement proposal
+     * [AIP-160](https://google.aip.dev/160). e.g.
+     * `remote_uri:"https://github.com*"`.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * A filter expression that filters resources listed in the response.
+     * Expressions must follow API improvement proposal
+     * [AIP-160](https://google.aip.dev/160). e.g.
+     * `remote_uri:"https://github.com*"`.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + 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.cloudbuild.v2.ListRepositoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.ListRepositoriesRequest) + private static final google.devtools.cloudbuild.v2.ListRepositoriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.ListRepositoriesRequest(); + } + + public static google.devtools.cloudbuild.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesRequestOrBuilder.java new file mode 100644 index 000000000000..2c085c9fe84b --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesRequestOrBuilder.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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface ListRepositoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.ListRepositoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of Repositories.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of Repositories.
+   * Format: `projects/*/locations/*/connections/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Number of results to return in the list.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page start.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page start.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * Expressions must follow API improvement proposal
+   * [AIP-160](https://google.aip.dev/160). e.g.
+   * `remote_uri:"https://github.com*"`.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filter expression that filters resources listed in the response.
+   * Expressions must follow API improvement proposal
+   * [AIP-160](https://google.aip.dev/160). e.g.
+   * `remote_uri:"https://github.com*"`.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesResponse.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesResponse.java new file mode 100644 index 000000000000..32a3a9ac5d5c --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesResponse.java @@ -0,0 +1,1125 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for response to listing Repositories.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListRepositoriesResponse} + */ +public final class ListRepositoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListRepositoriesResponse.class, + google.devtools.cloudbuild.v2.ListRepositoriesResponse.Builder.class); + } + + public static final int REPOSITORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List repositories_; + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List getRepositoriesList() { + return repositories_; + } + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public java.util.List + getRepositoriesOrBuilderList() { + return repositories_; + } + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public int getRepositoriesCount() { + return repositories_.size(); + } + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository getRepositories(int index) { + return repositories_.get(index); + } + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index) { + return repositories_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.ListRepositoriesResponse)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.ListRepositoriesResponse other = + (google.devtools.cloudbuild.v2.ListRepositoriesResponse) obj; + + if (!getRepositoriesList().equals(other.getRepositoriesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.ListRepositoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.ListRepositoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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( + google.devtools.cloudbuild.v2.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; + } + /** + * + * + *
+   * Message for response to listing Repositories.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ListRepositoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.ListRepositoriesResponse) + google.devtools.cloudbuild.v2.ListRepositoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ListRepositoriesResponse.class, + google.devtools.cloudbuild.v2.ListRepositoriesResponse.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.ListRepositoriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + } else { + repositories_ = null; + repositoriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesResponse getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.ListRepositoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesResponse build() { + google.devtools.cloudbuild.v2.ListRepositoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesResponse buildPartial() { + google.devtools.cloudbuild.v2.ListRepositoriesResponse result = + new google.devtools.cloudbuild.v2.ListRepositoriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + google.devtools.cloudbuild.v2.ListRepositoriesResponse result) { + if (repositoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + repositories_ = java.util.Collections.unmodifiableList(repositories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.repositories_ = repositories_; + } else { + result.repositories_ = repositoriesBuilder_.build(); + } + } + + private void buildPartial0(google.devtools.cloudbuild.v2.ListRepositoriesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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 google.devtools.cloudbuild.v2.ListRepositoriesResponse) { + return mergeFrom((google.devtools.cloudbuild.v2.ListRepositoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.ListRepositoriesResponse other) { + if (other == google.devtools.cloudbuild.v2.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_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + google.devtools.cloudbuild.v2.Repository m = + input.readMessage( + google.devtools.cloudbuild.v2.Repository.parser(), extensionRegistry); + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(m); + } else { + repositoriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + repositoriesBuilder_; + + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List getRepositoriesList() { + if (repositoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(repositories_); + } else { + return repositoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public int getRepositoriesCount() { + if (repositoriesBuilder_ == null) { + return repositories_.size(); + } else { + return repositoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository getRepositories(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder setRepositories(int index, google.devtools.cloudbuild.v2.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 list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder setRepositories( + int index, google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.set(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories(google.devtools.cloudbuild.v2.Repository value) { + if (repositoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRepositoriesIsMutable(); + repositories_.add(value); + onChanged(); + } else { + repositoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories(int index, google.devtools.cloudbuild.v2.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 list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories( + google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder addRepositories( + int index, google.devtools.cloudbuild.v2.Repository.Builder builderForValue) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.add(index, builderForValue.build()); + onChanged(); + } else { + repositoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.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 list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder clearRepositories() { + if (repositoriesBuilder_ == null) { + repositories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + repositoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public Builder removeRepositories(int index) { + if (repositoriesBuilder_ == null) { + ensureRepositoriesIsMutable(); + repositories_.remove(index); + onChanged(); + } else { + repositoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder getRepositoriesBuilder(int index) { + return getRepositoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index) { + if (repositoriesBuilder_ == null) { + return repositories_.get(index); + } else { + return repositoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List + getRepositoriesOrBuilderList() { + if (repositoriesBuilder_ != null) { + return repositoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(repositories_); + } + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder addRepositoriesBuilder() { + return getRepositoriesFieldBuilder() + .addBuilder(google.devtools.cloudbuild.v2.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public google.devtools.cloudbuild.v2.Repository.Builder addRepositoriesBuilder(int index) { + return getRepositoriesFieldBuilder() + .addBuilder(index, google.devtools.cloudbuild.v2.Repository.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Repositories.
+     * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + public java.util.List + getRepositoriesBuilderList() { + return getRepositoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder> + getRepositoriesFieldBuilder() { + if (repositoriesBuilder_ == null) { + repositoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + google.devtools.cloudbuild.v2.Repository, + google.devtools.cloudbuild.v2.Repository.Builder, + google.devtools.cloudbuild.v2.RepositoryOrBuilder>( + repositories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + repositories_ = null; + } + return repositoriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should 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; + bitField0_ |= 0x00000002; + 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.cloudbuild.v2.ListRepositoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.ListRepositoriesResponse) + private static final google.devtools.cloudbuild.v2.ListRepositoriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.ListRepositoriesResponse(); + } + + public static google.devtools.cloudbuild.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ListRepositoriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesResponseOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesResponseOrBuilder.java new file mode 100644 index 000000000000..62d53b2dbefa --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ListRepositoriesResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface ListRepositoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.ListRepositoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + java.util.List getRepositoriesList(); + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + google.devtools.cloudbuild.v2.Repository getRepositories(int index); + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + int getRepositoriesCount(); + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + java.util.List + getRepositoriesOrBuilderList(); + /** + * + * + *
+   * The list of Repositories.
+   * 
+ * + * repeated .google.devtools.cloudbuild.v2.Repository repositories = 1; + */ + google.devtools.cloudbuild.v2.RepositoryOrBuilder getRepositoriesOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/LocationName.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/LocationName.java new file mode 100644 index 000000000000..48da7023d0c1 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OAuthCredential.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OAuthCredential.java new file mode 100644 index 000000000000..a4ead8b6b147 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OAuthCredential.java @@ -0,0 +1,824 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Represents an OAuth token of the account that authorized the Connection,
+ * and associated metadata.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.OAuthCredential} + */ +public final class OAuthCredential extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.OAuthCredential) + OAuthCredentialOrBuilder { + private static final long serialVersionUID = 0L; + // Use OAuthCredential.newBuilder() to construct. + private OAuthCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OAuthCredential() { + oauthTokenSecretVersion_ = ""; + username_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OAuthCredential(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_OAuthCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_OAuthCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.OAuthCredential.class, + google.devtools.cloudbuild.v2.OAuthCredential.Builder.class); + } + + public static final int OAUTH_TOKEN_SECRET_VERSION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object oauthTokenSecretVersion_ = ""; + /** + * + * + *
+   * A SecretManager resource containing the OAuth token that authorizes
+   * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The oauthTokenSecretVersion. + */ + @java.lang.Override + public java.lang.String getOauthTokenSecretVersion() { + java.lang.Object ref = oauthTokenSecretVersion_; + 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(); + oauthTokenSecretVersion_ = s; + return s; + } + } + /** + * + * + *
+   * A SecretManager resource containing the OAuth token that authorizes
+   * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for oauthTokenSecretVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOauthTokenSecretVersionBytes() { + java.lang.Object ref = oauthTokenSecretVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + oauthTokenSecretVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + /** + * + * + *
+   * Output only. The username associated to this token.
+   * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + 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(); + username_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The username associated to this token.
+   * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oauthTokenSecretVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, oauthTokenSecretVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, username_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oauthTokenSecretVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, oauthTokenSecretVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, username_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.OAuthCredential)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.OAuthCredential other = + (google.devtools.cloudbuild.v2.OAuthCredential) obj; + + if (!getOauthTokenSecretVersion().equals(other.getOauthTokenSecretVersion())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OAUTH_TOKEN_SECRET_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getOauthTokenSecretVersion().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential 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 google.devtools.cloudbuild.v2.OAuthCredential parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential 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 google.devtools.cloudbuild.v2.OAuthCredential parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential 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(google.devtools.cloudbuild.v2.OAuthCredential 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; + } + /** + * + * + *
+   * Represents an OAuth token of the account that authorized the Connection,
+   * and associated metadata.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.OAuthCredential} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.OAuthCredential) + google.devtools.cloudbuild.v2.OAuthCredentialOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_OAuthCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_OAuthCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.OAuthCredential.class, + google.devtools.cloudbuild.v2.OAuthCredential.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.OAuthCredential.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oauthTokenSecretVersion_ = ""; + username_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_OAuthCredential_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OAuthCredential getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OAuthCredential build() { + google.devtools.cloudbuild.v2.OAuthCredential result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OAuthCredential buildPartial() { + google.devtools.cloudbuild.v2.OAuthCredential result = + new google.devtools.cloudbuild.v2.OAuthCredential(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.OAuthCredential result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.oauthTokenSecretVersion_ = oauthTokenSecretVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + } + + @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 google.devtools.cloudbuild.v2.OAuthCredential) { + return mergeFrom((google.devtools.cloudbuild.v2.OAuthCredential) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.OAuthCredential other) { + if (other == google.devtools.cloudbuild.v2.OAuthCredential.getDefaultInstance()) return this; + if (!other.getOauthTokenSecretVersion().isEmpty()) { + oauthTokenSecretVersion_ = other.oauthTokenSecretVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + oauthTokenSecretVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object oauthTokenSecretVersion_ = ""; + /** + * + * + *
+     * A SecretManager resource containing the OAuth token that authorizes
+     * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * + * @return The oauthTokenSecretVersion. + */ + public java.lang.String getOauthTokenSecretVersion() { + java.lang.Object ref = oauthTokenSecretVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + oauthTokenSecretVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A SecretManager resource containing the OAuth token that authorizes
+     * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * + * @return The bytes for oauthTokenSecretVersion. + */ + public com.google.protobuf.ByteString getOauthTokenSecretVersionBytes() { + java.lang.Object ref = oauthTokenSecretVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + oauthTokenSecretVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A SecretManager resource containing the OAuth token that authorizes
+     * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * + * @param value The oauthTokenSecretVersion to set. + * @return This builder for chaining. + */ + public Builder setOauthTokenSecretVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + oauthTokenSecretVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A SecretManager resource containing the OAuth token that authorizes
+     * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearOauthTokenSecretVersion() { + oauthTokenSecretVersion_ = getDefaultInstance().getOauthTokenSecretVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A SecretManager resource containing the OAuth token that authorizes
+     * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+     * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for oauthTokenSecretVersion to set. + * @return This builder for chaining. + */ + public Builder setOauthTokenSecretVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + oauthTokenSecretVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + /** + * + * + *
+     * Output only. The username associated to this token.
+     * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The username associated to this token.
+     * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The username associated to this token.
+     * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The username associated to this token.
+     * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The username associated to this token.
+     * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + 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.cloudbuild.v2.OAuthCredential) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.OAuthCredential) + private static final google.devtools.cloudbuild.v2.OAuthCredential DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.OAuthCredential(); + } + + public static google.devtools.cloudbuild.v2.OAuthCredential getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OAuthCredential parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OAuthCredential getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OAuthCredentialOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OAuthCredentialOrBuilder.java new file mode 100644 index 000000000000..59e9f2c37dac --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OAuthCredentialOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface OAuthCredentialOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.OAuthCredential) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A SecretManager resource containing the OAuth token that authorizes
+   * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The oauthTokenSecretVersion. + */ + java.lang.String getOauthTokenSecretVersion(); + /** + * + * + *
+   * A SecretManager resource containing the OAuth token that authorizes
+   * the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
+   * 
+ * + * string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for oauthTokenSecretVersion. + */ + com.google.protobuf.ByteString getOauthTokenSecretVersionBytes(); + + /** + * + * + *
+   * Output only. The username associated to this token.
+   * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The username. + */ + java.lang.String getUsername(); + /** + * + * + *
+   * Output only. The username associated to this token.
+   * 
+ * + * string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OperationMetadata.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OperationMetadata.java new file mode 100644 index 000000000000..e21963dae52b --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OperationMetadata.java @@ -0,0 +1,1833 @@ +/* + * 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/cloudbuild/v2/cloudbuild.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.OperationMetadata.class, + google.devtools.cloudbuild.v2.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.OperationMetadata)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.OperationMetadata other = + (google.devtools.cloudbuild.v2.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata 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 google.devtools.cloudbuild.v2.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata 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 google.devtools.cloudbuild.v2.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata 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(google.devtools.cloudbuild.v2.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.OperationMetadata) + google.devtools.cloudbuild.v2.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.OperationMetadata.class, + google.devtools.cloudbuild.v2.OperationMetadata.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OperationMetadata getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OperationMetadata build() { + google.devtools.cloudbuild.v2.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OperationMetadata buildPartial() { + google.devtools.cloudbuild.v2.OperationMetadata result = + new google.devtools.cloudbuild.v2.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + @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 google.devtools.cloudbuild.v2.OperationMetadata) { + return mergeFrom((google.devtools.cloudbuild.v2.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.OperationMetadata other) { + if (other == google.devtools.cloudbuild.v2.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + 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.cloudbuild.v2.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.OperationMetadata) + private static final google.devtools.cloudbuild.v2.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.OperationMetadata(); + } + + public static google.devtools.cloudbuild.v2.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OperationMetadataOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..064fefcf53cb --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/OperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * 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/cloudbuild/v2/cloudbuild.proto + +package google.devtools.cloudbuild.v2; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/Repository.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/Repository.java new file mode 100644 index 000000000000..815f20dc440b --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/Repository.java @@ -0,0 +1,1910 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * A repository associated to a parent connection.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.Repository} + */ +public final class Repository extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.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_ = ""; + remoteUri_ = ""; + etag_ = ""; + } + + @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; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Repository_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Repository_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.Repository.class, + google.devtools.cloudbuild.v2.Repository.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. Resource name of the repository, in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Resource name of the repository, in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 REMOTE_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object remoteUri_ = ""; + /** + * + * + *
+   * Required. Git Clone HTTPS URI.
+   * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The remoteUri. + */ + @java.lang.Override + public java.lang.String getRemoteUri() { + java.lang.Object ref = remoteUri_; + 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(); + remoteUri_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Git Clone HTTPS URI.
+   * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for remoteUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRemoteUriBytes() { + java.lang.Object ref = remoteUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remoteUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 6; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Repository_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ETAG_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 7; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 7; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remoteUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, remoteUri_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 6); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remoteUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, remoteUri_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, annotations__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.Repository)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.Repository other = (google.devtools.cloudbuild.v2.Repository) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRemoteUri().equals(other.getRemoteUri())) 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 (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REMOTE_URI_FIELD_NUMBER; + hash = (53 * hash) + getRemoteUri().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(); + } + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.Repository parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.Repository parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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 google.devtools.cloudbuild.v2.Repository parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.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(google.devtools.cloudbuild.v2.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 associated to a parent connection.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.Repository} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.Repository) + google.devtools.cloudbuild.v2.RepositoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Repository_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Repository_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.Repository.class, + google.devtools.cloudbuild.v2.Repository.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.Repository.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + remoteUri_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableAnnotations().clear(); + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_Repository_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.Repository.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository build() { + google.devtools.cloudbuild.v2.Repository result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository buildPartial() { + google.devtools.cloudbuild.v2.Repository result = + new google.devtools.cloudbuild.v2.Repository(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.Repository result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.remoteUri_ = remoteUri_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.etag_ = etag_; + } + } + + @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 google.devtools.cloudbuild.v2.Repository) { + return mergeFrom((google.devtools.cloudbuild.v2.Repository) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.Repository other) { + if (other == google.devtools.cloudbuild.v2.Repository.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRemoteUri().isEmpty()) { + remoteUri_ = other.remoteUri_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + remoteUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Resource name of the repository, in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Resource name of the repository, in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Resource name of the repository, in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Resource name of the repository, in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Resource name of the repository, in the format
+     * `projects/*/locations/*/connections/*/repositories/*`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object remoteUri_ = ""; + /** + * + * + *
+     * Required. Git Clone HTTPS URI.
+     * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The remoteUri. + */ + public java.lang.String getRemoteUri() { + java.lang.Object ref = remoteUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remoteUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Git Clone HTTPS URI.
+     * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for remoteUri. + */ + public com.google.protobuf.ByteString getRemoteUriBytes() { + java.lang.Object ref = remoteUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + remoteUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Git Clone HTTPS URI.
+     * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The remoteUri to set. + * @return This builder for chaining. + */ + public Builder setRemoteUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + remoteUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Git Clone HTTPS URI.
+     * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRemoteUri() { + remoteUri_ = getDefaultInstance().getRemoteUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Git Clone HTTPS URI.
+     * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for remoteUri to set. + * @return This builder for chaining. + */ + public Builder setRemoteUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + remoteUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + 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_; + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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_; + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Server assigned timestamp for when the connection was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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 com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Allows clients to store small amounts of arbitrary data.
+     * 
+ * + * map<string, string> annotations = 6; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 7; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 7; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 7; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 7; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * This checksum is computed by the server based on the value of other
+     * fields, and may be sent on update and delete requests to ensure the
+     * client has an up-to-date value before proceeding.
+     * 
+ * + * string etag = 7; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000020; + 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.cloudbuild.v2.Repository) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.Repository) + private static final google.devtools.cloudbuild.v2.Repository DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.Repository(); + } + + public static google.devtools.cloudbuild.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.Repository getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerProto.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerProto.java new file mode 100644 index 000000000000..b9b7e008e852 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryManagerProto.java @@ -0,0 +1,651 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public final class RepositoryManagerProto { + private RepositoryManagerProto() {} + + 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_cloudbuild_v2_Connection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_Connection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_Connection_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_Connection_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_InstallationState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_InstallationState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_GitHubConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_GitHubConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_Repository_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_Repository_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_Repository_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_Repository_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_OAuthCredential_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_OAuthCredential_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/devtools/cloudbuild/v2/reposito" + + "ries.proto\022\035google.devtools.cloudbuild.v" + + "2\032\034google/api/annotations.proto\032\027google/" + + "api/client.proto\032\037google/api/field_behav" + + "ior.proto\032\031google/api/httpbody.proto\032\031go" + + "ogle/api/resource.proto\032#google/longrunn" + + "ing/operations.proto\032\033google/protobuf/em" + + "pty.proto\032 google/protobuf/field_mask.pr" + + "oto\032\037google/protobuf/timestamp.proto\"\336\005\n" + + "\nConnection\022\021\n\004name\030\001 \001(\tB\003\340A\005\0224\n\013create" + + "_time\030\003 \001(\0132\032.google.protobuf.TimestampB" + + "\003\340A\003\0224\n\013update_time\030\004 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\003\022D\n\rgithub_config\030\005 \001(" + + "\0132+.google.devtools.cloudbuild.v2.GitHub" + + "ConfigH\000\022Y\n\030github_enterprise_config\030\006 \001" + + "(\01325.google.devtools.cloudbuild.v2.GitHu" + + "bEnterpriseConfigH\000\022Q\n\022installation_stat" + + "e\030\014 \001(\01320.google.devtools.cloudbuild.v2." + + "InstallationStateB\003\340A\003\022\020\n\010disabled\030\r \001(\010" + + "\022\030\n\013reconciling\030\016 \001(\010B\003\340A\003\022O\n\013annotation" + + "s\030\017 \003(\0132:.google.devtools.cloudbuild.v2." + + "Connection.AnnotationsEntry\022\014\n\004etag\030\020 \001(" + + "\t\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001:\210\001\352A\204\001\n$cloudbuild.googlea" + + "pis.com/Connection\022@projects/{project}/l" + + "ocations/{location}/connections/{connect" + + "ion}*\013connections2\nconnectionR\001\001B\023\n\021conn" + + "ection_config\"\205\002\n\021InstallationState\022J\n\005s" + + "tage\030\001 \001(\01626.google.devtools.cloudbuild." + + "v2.InstallationState.StageB\003\340A\003\022\024\n\007messa" + + "ge\030\002 \001(\tB\003\340A\003\022\027\n\naction_uri\030\003 \001(\tB\003\340A\003\"u" + + "\n\005Stage\022\025\n\021STAGE_UNSPECIFIED\020\000\022\026\n\022PENDIN" + + "G_CREATE_APP\020\001\022\026\n\022PENDING_USER_OAUTH\020\002\022\027" + + "\n\023PENDING_INSTALL_APP\020\003\022\014\n\010COMPLETE\020\n\"\213\001" + + "\n FetchLinkableRepositoriesRequest\022@\n\nco" + + "nnection\030\001 \001(\tB,\340A\002\372A&\n$cloudbuild.googl" + + "eapis.com/Connection\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\"}\n!FetchLinkableRepo" + + "sitoriesResponse\022?\n\014repositories\030\001 \003(\0132)" + + ".google.devtools.cloudbuild.v2.Repositor" + + "y\022\027\n\017next_page_token\030\002 \001(\t\"z\n\014GitHubConf" + + "ig\022M\n\025authorizer_credential\030\001 \001(\0132..goog" + + "le.devtools.cloudbuild.v2.OAuthCredentia" + + "l\022\033\n\023app_installation_id\030\002 \001(\003\"\267\003\n\026GitHu" + + "bEnterpriseConfig\022\025\n\010host_uri\030\001 \001(\tB\003\340A\002" + + "\022\024\n\007api_key\030\014 \001(\tB\003\340A\002\022\016\n\006app_id\030\002 \001(\003\022\020" + + "\n\010app_slug\030\r \001(\t\022S\n\032private_key_secret_v" + + "ersion\030\004 \001(\tB/\372A,\n*secretmanager.googlea" + + "pis.com/SecretVersion\022V\n\035webhook_secret_" + + "secret_version\030\005 \001(\tB/\372A,\n*secretmanager" + + ".googleapis.com/SecretVersion\022\033\n\023app_ins" + + "tallation_id\030\t \001(\003\022W\n\030service_directory_" + + "config\030\n \001(\01325.google.devtools.cloudbuil" + + "d.v2.ServiceDirectoryConfig\022\016\n\006ssl_ca\030\013 " + + "\001(\t\022\033\n\016server_version\030\016 \001(\tB\003\340A\003\"Z\n\026Serv" + + "iceDirectoryConfig\022@\n\007service\030\001 \001(\tB/\340A\002" + + "\372A)\n\'servicedirectory.googleapis.com/Ser" + + "vice\"\335\003\n\nRepository\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\027" + + "\n\nremote_uri\030\002 \001(\tB\003\340A\002\0224\n\013create_time\030\004" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\005 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\022O\n\013annotations\030\006 \003(\0132:.googl" + + "e.devtools.cloudbuild.v2.Repository.Anno" + + "tationsEntry\022\014\n\004etag\030\007 \001(\t\0322\n\020Annotation" + + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\243" + + "\001\352A\237\001\n$cloudbuild.googleapis.com/Reposit" + + "ory\022Zprojects/{project}/locations/{locat" + + "ion}/connections/{connection}/repositori" + + "es/{repository}*\014repositories2\nrepositor" + + "yR\001\001\"}\n\017OAuthCredential\022S\n\032oauth_token_s" + + "ecret_version\030\001 \001(\tB/\372A,\n*secretmanager." + + "googleapis.com/SecretVersion\022\025\n\010username" + + "\030\002 \001(\tB\003\340A\003\"\267\001\n\027CreateConnectionRequest\022" + + "<\n\006parent\030\001 \001(\tB,\340A\002\372A&\022$cloudbuild.goog" + + "leapis.com/Connection\022B\n\nconnection\030\002 \001(" + + "\0132).google.devtools.cloudbuild.v2.Connec" + + "tionB\003\340A\002\022\032\n\rconnection_id\030\003 \001(\tB\003\340A\002\"R\n" + + "\024GetConnectionRequest\022:\n\004name\030\001 \001(\tB,\340A\002" + + "\372A&\n$cloudbuild.googleapis.com/Connectio" + + "n\"}\n\026ListConnectionsRequest\022<\n\006parent\030\001 " + + "\001(\tB,\340A\002\372A&\022$cloudbuild.googleapis.com/C" + + "onnection\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_tok" + + "en\030\003 \001(\t\"r\n\027ListConnectionsResponse\022>\n\013c" + + "onnections\030\001 \003(\0132).google.devtools.cloud" + + "build.v2.Connection\022\027\n\017next_page_token\030\002" + + " \001(\t\"\263\001\n\027UpdateConnectionRequest\022B\n\nconn" + + "ection\030\001 \001(\0132).google.devtools.cloudbuil" + + "d.v2.ConnectionB\003\340A\002\022/\n\013update_mask\030\002 \001(" + + "\0132\032.google.protobuf.FieldMask\022\025\n\rallow_m" + + "issing\030\003 \001(\010\022\014\n\004etag\030\004 \001(\t\"z\n\027DeleteConn" + + "ectionRequest\022:\n\004name\030\001 \001(\tB,\340A\002\372A&\n$clo" + + "udbuild.googleapis.com/Connection\022\014\n\004eta" + + "g\030\002 \001(\t\022\025\n\rvalidate_only\030\003 \001(\010\"\267\001\n\027Creat" + + "eRepositoryRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372" + + "A&\n$cloudbuild.googleapis.com/Connection" + + "\022B\n\nrepository\030\002 \001(\0132).google.devtools.c" + + "loudbuild.v2.RepositoryB\003\340A\002\022\032\n\rreposito" + + "ry_id\030\003 \001(\tB\003\340A\002\"\255\001\n\036BatchCreateReposito" + + "riesRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$clo" + + "udbuild.googleapis.com/Connection\022M\n\010req" + + "uests\030\002 \003(\01326.google.devtools.cloudbuild" + + ".v2.CreateRepositoryRequestB\003\340A\002\"b\n\037Batc" + + "hCreateRepositoriesResponse\022?\n\014repositor" + + "ies\030\001 \003(\0132).google.devtools.cloudbuild.v" + + "2.Repository\"R\n\024GetRepositoryRequest\022:\n\004" + + "name\030\001 \001(\tB,\340A\002\372A&\n$cloudbuild.googleapi" + + "s.com/Repository\"\216\001\n\027ListRepositoriesReq" + + "uest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\022$cloudbuild" + + ".googleapis.com/Repository\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001(" + + "\t\"t\n\030ListRepositoriesResponse\022?\n\014reposit" + + "ories\030\001 \003(\0132).google.devtools.cloudbuild" + + ".v2.Repository\022\027\n\017next_page_token\030\002 \001(\t\"" + + "z\n\027DeleteRepositoryRequest\022:\n\004name\030\001 \001(\t" + + "B,\340A\002\372A&\n$cloudbuild.googleapis.com/Repo" + + "sitory\022\014\n\004etag\030\002 \001(\t\022\025\n\rvalidate_only\030\003 " + + "\001(\010\"^\n\032FetchReadWriteTokenRequest\022@\n\nrep" + + "ository\030\001 \001(\tB,\340A\002\372A&\n$cloudbuild.google" + + "apis.com/Repository\"Y\n\025FetchReadTokenReq" + + "uest\022@\n\nrepository\030\001 \001(\tB,\340A\002\372A&\n$cloudb" + + "uild.googleapis.com/Repository\"\\\n\026FetchR" + + "eadTokenResponse\022\r\n\005token\030\001 \001(\t\0223\n\017expir" + + "ation_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tamp\"a\n\033FetchReadWriteTokenResponse\022\r\n\005t" + + "oken\030\001 \001(\t\0223\n\017expiration_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.Timestamp2\340\031\n\021RepositoryMa" + + "nager\022\221\002\n\020CreateConnection\0226.google.devt" + + "ools.cloudbuild.v2.CreateConnectionReque" + + "st\032\035.google.longrunning.Operation\"\245\001\202\323\344\223" + + "\002=\"//v2/{parent=projects/*/locations/*}/" + + "connections:\nconnection\332A\037parent,connect" + + "ion,connection_id\312A=\n\nConnection\022/google" + + ".devtools.cloudbuild.v2.OperationMetadat" + + "a\022\257\001\n\rGetConnection\0223.google.devtools.cl" + + "oudbuild.v2.GetConnectionRequest\032).googl" + + "e.devtools.cloudbuild.v2.Connection\">\202\323\344" + + "\223\0021\022//v2/{name=projects/*/locations/*/co" + + "nnections/*}\332A\004name\022\302\001\n\017ListConnections\022" + + "5.google.devtools.cloudbuild.v2.ListConn" + + "ectionsRequest\0326.google.devtools.cloudbu" + + "ild.v2.ListConnectionsResponse\"@\202\323\344\223\0021\022/" + + "/v2/{parent=projects/*/locations/*}/conn" + + "ections\332A\006parent\022\223\002\n\020UpdateConnection\0226." + + "google.devtools.cloudbuild.v2.UpdateConn" + + "ectionRequest\032\035.google.longrunning.Opera" + + "tion\"\247\001\202\323\344\223\002H2:/v2/{connection.name=proj" + + "ects/*/locations/*/connections/*}:\nconne" + + "ction\332A\026connection,update_mask\312A=\n\nConne" + + "ction\022/google.devtools.cloudbuild.v2.Ope" + + "rationMetadata\022\365\001\n\020DeleteConnection\0226.go" + + "ogle.devtools.cloudbuild.v2.DeleteConnec" + + "tionRequest\032\035.google.longrunning.Operati" + + "on\"\211\001\202\323\344\223\0021*//v2/{name=projects/*/locati" + + "ons/*/connections/*}\332A\004name\312AH\n\025google.p" + + "rotobuf.Empty\022/google.devtools.cloudbuil" + + "d.v2.OperationMetadata\022\240\002\n\020CreateReposit" + + "ory\0226.google.devtools.cloudbuild.v2.Crea" + + "teRepositoryRequest\032\035.google.longrunning" + + ".Operation\"\264\001\202\323\344\223\002L\">/v2/{parent=project" + + "s/*/locations/*/connections/*}/repositor" + + "ies:\nrepository\332A\037parent,repository,repo" + + "sitory_id\312A=\n\nRepository\022/google.devtool" + + "s.cloudbuild.v2.OperationMetadata\022\266\002\n\027Ba" + + "tchCreateRepositories\022=.google.devtools." + + "cloudbuild.v2.BatchCreateRepositoriesReq" + + "uest\032\035.google.longrunning.Operation\"\274\001\202\323" + + "\344\223\002O\"J/v2/{parent=projects/*/locations/*" + + "/connections/*}/repositories:batchCreate" + + ":\001*\332A\017parent,requests\312AR\n\037BatchCreateRep" + + "ositoriesResponse\022/google.devtools.cloud" + + "build.v2.OperationMetadata\022\276\001\n\rGetReposi" + + "tory\0223.google.devtools.cloudbuild.v2.Get" + + "RepositoryRequest\032).google.devtools.clou" + + "dbuild.v2.Repository\"M\202\323\344\223\002@\022>/v2/{name=" + + "projects/*/locations/*/connections/*/rep" + + "ositories/*}\332A\004name\022\324\001\n\020ListRepositories" + + "\0226.google.devtools.cloudbuild.v2.ListRep" + + "ositoriesRequest\0327.google.devtools.cloud" + + "build.v2.ListRepositoriesResponse\"O\202\323\344\223\002" + + "@\022>/v2/{parent=projects/*/locations/*/co" + + "nnections/*}/repositories\332A\006parent\022\204\002\n\020D" + + "eleteRepository\0226.google.devtools.cloudb" + + "uild.v2.DeleteRepositoryRequest\032\035.google" + + ".longrunning.Operation\"\230\001\202\323\344\223\002@*>/v2/{na" + + "me=projects/*/locations/*/connections/*/" + + "repositories/*}\332A\004name\312AH\n\025google.protob" + + "uf.Empty\022/google.devtools.cloudbuild.v2." + + "OperationMetadata\022\377\001\n\023FetchReadWriteToke" + + "n\0229.google.devtools.cloudbuild.v2.FetchR" + + "eadWriteTokenRequest\032:.google.devtools.c" + + "loudbuild.v2.FetchReadWriteTokenResponse" + + "\"q\202\323\344\223\002^\"Y/v2/{repository=projects/*/loc" + + "ations/*/connections/*/repositories/*}:a" + + "ccessReadWriteToken:\001*\332A\nrepository\022\353\001\n\016" + + "FetchReadToken\0224.google.devtools.cloudbu" + + "ild.v2.FetchReadTokenRequest\0325.google.de" + + "vtools.cloudbuild.v2.FetchReadTokenRespo" + + "nse\"l\202\323\344\223\002Y\"T/v2/{repository=projects/*/" + + "locations/*/connections/*/repositories/*" + + "}:accessReadToken:\001*\332A\nrepository\022\367\001\n\031Fe" + + "tchLinkableRepositories\022?.google.devtool" + + "s.cloudbuild.v2.FetchLinkableRepositorie" + + "sRequest\032@.google.devtools.cloudbuild.v2" + + ".FetchLinkableRepositoriesResponse\"W\202\323\344\223" + + "\002Q\022O/v2/{connection=projects/*/locations" + + "/*/connections/*}:fetchLinkableRepositor" + + "ies\032M\312A\031cloudbuild.googleapis.com\322A.http" + + "s://www.googleapis.com/auth/cloud-platfo" + + "rmB\327\002\n\035google.devtools.cloudbuild.v2B\026Re" + + "positoryManagerProtoP\001ZGgoogle.golang.or" + + "g/genproto/googleapis/devtools/cloudbuil" + + "d/v2;cloudbuild\242\002\003GCB\252\002\032Google.Cloud.Clo" + + "udBuild.V2\312\002\025Google\\Cloud\\Build\\V2\352\002\030Goo" + + "gle::Cloud::Build::V2\352A|\n\'servicedirecto" + + "ry.googleapis.com/Service\022Qprojects/{pro" + + "ject}/locations/{location}/namespaces/{n" + + "amespace}/services/{service}b\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.api.FieldBehaviorProto.getDescriptor(), + com.google.api.HttpBodyProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_devtools_cloudbuild_v2_Connection_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_devtools_cloudbuild_v2_Connection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_Connection_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "GithubConfig", + "GithubEnterpriseConfig", + "InstallationState", + "Disabled", + "Reconciling", + "Annotations", + "Etag", + "ConnectionConfig", + }); + internal_static_google_devtools_cloudbuild_v2_Connection_AnnotationsEntry_descriptor = + internal_static_google_devtools_cloudbuild_v2_Connection_descriptor.getNestedTypes().get(0); + internal_static_google_devtools_cloudbuild_v2_Connection_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_Connection_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_devtools_cloudbuild_v2_InstallationState_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_devtools_cloudbuild_v2_InstallationState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_InstallationState_descriptor, + new java.lang.String[] { + "Stage", "Message", "ActionUri", + }); + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesRequest_descriptor, + new java.lang.String[] { + "Connection", "PageSize", "PageToken", + }); + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_FetchLinkableRepositoriesResponse_descriptor, + new java.lang.String[] { + "Repositories", "NextPageToken", + }); + internal_static_google_devtools_cloudbuild_v2_GitHubConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_devtools_cloudbuild_v2_GitHubConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_GitHubConfig_descriptor, + new java.lang.String[] { + "AuthorizerCredential", "AppInstallationId", + }); + internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_GitHubEnterpriseConfig_descriptor, + new java.lang.String[] { + "HostUri", + "ApiKey", + "AppId", + "AppSlug", + "PrivateKeySecretVersion", + "WebhookSecretSecretVersion", + "AppInstallationId", + "ServiceDirectoryConfig", + "SslCa", + "ServerVersion", + }); + internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_descriptor, + new java.lang.String[] { + "Service", + }); + internal_static_google_devtools_cloudbuild_v2_Repository_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_devtools_cloudbuild_v2_Repository_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_Repository_descriptor, + new java.lang.String[] { + "Name", "RemoteUri", "CreateTime", "UpdateTime", "Annotations", "Etag", + }); + internal_static_google_devtools_cloudbuild_v2_Repository_AnnotationsEntry_descriptor = + internal_static_google_devtools_cloudbuild_v2_Repository_descriptor.getNestedTypes().get(0); + internal_static_google_devtools_cloudbuild_v2_Repository_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_Repository_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_devtools_cloudbuild_v2_OAuthCredential_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_devtools_cloudbuild_v2_OAuthCredential_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_OAuthCredential_descriptor, + new java.lang.String[] { + "OauthTokenSecretVersion", "Username", + }); + internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_CreateConnectionRequest_descriptor, + new java.lang.String[] { + "Parent", "Connection", "ConnectionId", + }); + internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_GetConnectionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_ListConnectionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_ListConnectionsResponse_descriptor, + new java.lang.String[] { + "Connections", "NextPageToken", + }); + internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_descriptor, + new java.lang.String[] { + "Connection", "UpdateMask", "AllowMissing", "Etag", + }); + internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_DeleteConnectionRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", "ValidateOnly", + }); + internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_CreateRepositoryRequest_descriptor, + new java.lang.String[] { + "Parent", "Repository", "RepositoryId", + }); + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesRequest_descriptor, + new java.lang.String[] { + "Parent", "Requests", + }); + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_BatchCreateRepositoriesResponse_descriptor, + new java.lang.String[] { + "Repositories", + }); + internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_GetRepositoryRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_ListRepositoriesResponse_descriptor, + new java.lang.String[] { + "Repositories", "NextPageToken", + }); + internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_DeleteRepositoryRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", "ValidateOnly", + }); + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenRequest_descriptor, + new java.lang.String[] { + "Repository", + }); + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenRequest_descriptor, + new java.lang.String[] { + "Repository", + }); + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_FetchReadTokenResponse_descriptor, + new java.lang.String[] { + "Token", "ExpirationTime", + }); + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_cloudbuild_v2_FetchReadWriteTokenResponse_descriptor, + new java.lang.String[] { + "Token", "ExpirationTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.HttpBodyProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryName.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryName.java new file mode 100644 index 000000000000..fd9cb45b30fc --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2; + +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_CONNECTION_REPOSITORY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String connection; + private final String repository; + + @Deprecated + protected RepositoryName() { + project = null; + location = null; + connection = null; + repository = null; + } + + private RepositoryName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + connection = Preconditions.checkNotNull(builder.getConnection()); + repository = Preconditions.checkNotNull(builder.getRepository()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConnection() { + return connection; + } + + 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 connection, String repository) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setConnection(connection) + .setRepository(repository) + .build(); + } + + public static String format( + String project, String location, String connection, String repository) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setConnection(connection) + .setRepository(repository) + .build() + .toString(); + } + + public static RepositoryName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CONNECTION_REPOSITORY.validatedMatch( + formattedString, "RepositoryName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("connection"), + 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_CONNECTION_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 (connection != null) { + fieldMapBuilder.put("connection", connection); + } + 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_CONNECTION_REPOSITORY.instantiate( + "project", + project, + "location", + location, + "connection", + connection, + "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.connection, that.connection) + && 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(connection); + h *= 1000003; + h ^= Objects.hashCode(repository); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}. + */ + public static class Builder { + private String project; + private String location; + private String connection; + private String repository; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConnection() { + return connection; + } + + 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 setConnection(String connection) { + this.connection = connection; + 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.connection = repositoryName.connection; + this.repository = repositoryName.repository; + } + + public RepositoryName build() { + return new RepositoryName(this); + } + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryOrBuilder.java new file mode 100644 index 000000000000..3b5ea0d27d81 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RepositoryOrBuilder.java @@ -0,0 +1,240 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface RepositoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.Repository) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Resource name of the repository, in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Resource name of the repository, in the format
+   * `projects/*/locations/*/connections/*/repositories/*`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Git Clone HTTPS URI.
+   * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The remoteUri. + */ + java.lang.String getRemoteUri(); + /** + * + * + *
+   * Required. Git Clone HTTPS URI.
+   * 
+ * + * string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for remoteUri. + */ + com.google.protobuf.ByteString getRemoteUriBytes(); + + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Server assigned timestamp for when the connection was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Allows clients to store small amounts of arbitrary data.
+   * 
+ * + * map<string, string> annotations = 6; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 7; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * This checksum is computed by the server based on the value of other
+   * fields, and may be sent on update and delete requests to ensure the
+   * client has an up-to-date value before proceeding.
+   * 
+ * + * string etag = 7; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RunWorkflowCustomOperationMetadata.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RunWorkflowCustomOperationMetadata.java new file mode 100644 index 000000000000..edd86b0e06f1 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RunWorkflowCustomOperationMetadata.java @@ -0,0 +1,1842 @@ +/* + * 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/cloudbuild/v2/cloudbuild.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Represents the custom metadata of the RunWorkflow long-running operation.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata} + */ +public final class RunWorkflowCustomOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) + RunWorkflowCustomOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RunWorkflowCustomOperationMetadata.newBuilder() to construct. + private RunWorkflowCustomOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RunWorkflowCustomOperationMetadata() { + verb_ = ""; + apiVersion_ = ""; + target_ = ""; + pipelineRunId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RunWorkflowCustomOperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.class, + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int VERB_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 4; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PIPELINE_RUN_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object pipelineRunId_ = ""; + /** + * + * + *
+   * Output only. ID of the pipeline run created by RunWorkflow.
+   * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pipelineRunId. + */ + @java.lang.Override + public java.lang.String getPipelineRunId() { + java.lang.Object ref = pipelineRunId_; + 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(); + pipelineRunId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. ID of the pipeline run created by RunWorkflow.
+   * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pipelineRunId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPipelineRunIdBytes() { + java.lang.Object ref = pipelineRunId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pipelineRunId_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, verb_); + } + if (requestedCancellation_ != false) { + output.writeBool(4, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, apiVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pipelineRunId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, pipelineRunId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, verb_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, apiVersion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pipelineRunId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, pipelineRunId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata other = + (google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getVerb().equals(other.getVerb())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getTarget().equals(other.getTarget())) return false; + if (!getPipelineRunId().equals(other.getPipelineRunId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + PIPELINE_RUN_ID_FIELD_NUMBER; + hash = (53 * hash) + getPipelineRunId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata 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 google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata 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 google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata 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( + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata 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; + } + /** + * + * + *
+   * Represents the custom metadata of the RunWorkflow long-running operation.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.class, + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + verb_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + target_ = ""; + pipelineRunId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.CloudBuildProto + .internal_static_google_devtools_cloudbuild_v2_RunWorkflowCustomOperationMetadata_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata + getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata build() { + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata buildPartial() { + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata result = + new google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.apiVersion_ = apiVersion_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pipelineRunId_ = pipelineRunId_; + } + } + + @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 google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) { + return mergeFrom((google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata other) { + if (other + == google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getPipelineRunId().isEmpty()) { + pipelineRunId_ = other.pipelineRunId_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + pipelineRunId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000008); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object pipelineRunId_ = ""; + /** + * + * + *
+     * Output only. ID of the pipeline run created by RunWorkflow.
+     * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pipelineRunId. + */ + public java.lang.String getPipelineRunId() { + java.lang.Object ref = pipelineRunId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pipelineRunId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. ID of the pipeline run created by RunWorkflow.
+     * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pipelineRunId. + */ + public com.google.protobuf.ByteString getPipelineRunIdBytes() { + java.lang.Object ref = pipelineRunId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pipelineRunId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. ID of the pipeline run created by RunWorkflow.
+     * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The pipelineRunId to set. + * @return This builder for chaining. + */ + public Builder setPipelineRunId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pipelineRunId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. ID of the pipeline run created by RunWorkflow.
+     * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPipelineRunId() { + pipelineRunId_ = getDefaultInstance().getPipelineRunId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. ID of the pipeline run created by RunWorkflow.
+     * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for pipelineRunId to set. + * @return This builder for chaining. + */ + public Builder setPipelineRunIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pipelineRunId_ = value; + bitField0_ |= 0x00000040; + 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.cloudbuild.v2.RunWorkflowCustomOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) + private static final google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata(); + } + + public static google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RunWorkflowCustomOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RunWorkflowCustomOperationMetadataOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RunWorkflowCustomOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..95cec9d25b51 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/RunWorkflowCustomOperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * 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/cloudbuild/v2/cloudbuild.proto + +package google.devtools.cloudbuild.v2; + +public interface RunWorkflowCustomOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. ID of the pipeline run created by RunWorkflow.
+   * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pipelineRunId. + */ + java.lang.String getPipelineRunId(); + /** + * + * + *
+   * Output only. ID of the pipeline run created by RunWorkflow.
+   * 
+ * + * string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pipelineRunId. + */ + com.google.protobuf.ByteString getPipelineRunIdBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ServiceDirectoryConfig.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ServiceDirectoryConfig.java new file mode 100644 index 000000000000..6a6318fa7897 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ServiceDirectoryConfig.java @@ -0,0 +1,659 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * ServiceDirectoryConfig represents Service Directory configuration for a
+ * connection.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ServiceDirectoryConfig} + */ +public final class ServiceDirectoryConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.ServiceDirectoryConfig) + ServiceDirectoryConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceDirectoryConfig.newBuilder() to construct. + private ServiceDirectoryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceDirectoryConfig() { + service_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceDirectoryConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.class, + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * Required. The Service Directory service name.
+   * Format:
+   * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Service Directory service name.
+   * Format:
+   * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.ServiceDirectoryConfig)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.ServiceDirectoryConfig other = + (google.devtools.cloudbuild.v2.ServiceDirectoryConfig) obj; + + if (!getService().equals(other.getService())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig 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 google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig 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 google.devtools.cloudbuild.v2.ServiceDirectoryConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig 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(google.devtools.cloudbuild.v2.ServiceDirectoryConfig 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; + } + /** + * + * + *
+   * ServiceDirectoryConfig represents Service Directory configuration for a
+   * connection.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.ServiceDirectoryConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.ServiceDirectoryConfig) + google.devtools.cloudbuild.v2.ServiceDirectoryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.class, + google.devtools.cloudbuild.v2.ServiceDirectoryConfig.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.ServiceDirectoryConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + service_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_ServiceDirectoryConfig_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig build() { + google.devtools.cloudbuild.v2.ServiceDirectoryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig buildPartial() { + google.devtools.cloudbuild.v2.ServiceDirectoryConfig result = + new google.devtools.cloudbuild.v2.ServiceDirectoryConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.ServiceDirectoryConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.service_ = service_; + } + } + + @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 google.devtools.cloudbuild.v2.ServiceDirectoryConfig) { + return mergeFrom((google.devtools.cloudbuild.v2.ServiceDirectoryConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.ServiceDirectoryConfig other) { + if (other == google.devtools.cloudbuild.v2.ServiceDirectoryConfig.getDefaultInstance()) + return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * Required. The Service Directory service name.
+     * Format:
+     * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Service Directory service name.
+     * Format:
+     * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Service Directory service name.
+     * Format:
+     * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Service Directory service name.
+     * Format:
+     * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Service Directory service name.
+     * Format:
+     * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000001; + 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.cloudbuild.v2.ServiceDirectoryConfig) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.ServiceDirectoryConfig) + private static final google.devtools.cloudbuild.v2.ServiceDirectoryConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.ServiceDirectoryConfig(); + } + + public static google.devtools.cloudbuild.v2.ServiceDirectoryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceDirectoryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.ServiceDirectoryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ServiceDirectoryConfigOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ServiceDirectoryConfigOrBuilder.java new file mode 100644 index 000000000000..dab18dcfb845 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/ServiceDirectoryConfigOrBuilder.java @@ -0,0 +1,58 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface ServiceDirectoryConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.ServiceDirectoryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Service Directory service name.
+   * Format:
+   * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * Required. The Service Directory service name.
+   * Format:
+   * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/UpdateConnectionRequest.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/UpdateConnectionRequest.java new file mode 100644 index 000000000000..e8fa7ed0c62f --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/UpdateConnectionRequest.java @@ -0,0 +1,1301 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +/** + * + * + *
+ * Message for updating a Connection.
+ * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.UpdateConnectionRequest} + */ +public final class UpdateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v2.UpdateConnectionRequest) + UpdateConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConnectionRequest.newBuilder() to construct. + private UpdateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConnectionRequest() { + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.UpdateConnectionRequest.class, + google.devtools.cloudbuild.v2.UpdateConnectionRequest.Builder.class); + } + + public static final int CONNECTION_FIELD_NUMBER = 1; + private google.devtools.cloudbuild.v2.Connection connection_; + /** + * + * + *
+   * Required. The Connection to update.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + @java.lang.Override + public boolean hasConnection() { + return connection_ != null; + } + /** + * + * + *
+   * Required. The Connection to update.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.Connection getConnection() { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } + /** + * + * + *
+   * Required. The Connection to update.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionOrBuilder() { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_ = false; + /** + * + * + *
+   * If set to true, and the connection is not found a new connection
+   * will be created. In this situation `update_mask` is ignored.
+   * The creation will succeed only if the input connection has all the
+   * necessary information (e.g a github_config with both  user_oauth_token and
+   * installation_id properties).
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, update will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, update will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = 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 (connection_ != null) { + output.writeMessage(1, getConnection()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (connection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConnection()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof google.devtools.cloudbuild.v2.UpdateConnectionRequest)) { + return super.equals(obj); + } + google.devtools.cloudbuild.v2.UpdateConnectionRequest other = + (google.devtools.cloudbuild.v2.UpdateConnectionRequest) obj; + + if (hasConnection() != other.hasConnection()) return false; + if (hasConnection()) { + if (!getConnection().equals(other.getConnection())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConnection()) { + hash = (37 * hash) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest 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 google.devtools.cloudbuild.v2.UpdateConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest 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 google.devtools.cloudbuild.v2.UpdateConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest 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( + google.devtools.cloudbuild.v2.UpdateConnectionRequest 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; + } + /** + * + * + *
+   * Message for updating a Connection.
+   * 
+ * + * Protobuf type {@code google.devtools.cloudbuild.v2.UpdateConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v2.UpdateConnectionRequest) + google.devtools.cloudbuild.v2.UpdateConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + google.devtools.cloudbuild.v2.UpdateConnectionRequest.class, + google.devtools.cloudbuild.v2.UpdateConnectionRequest.Builder.class); + } + + // Construct using google.devtools.cloudbuild.v2.UpdateConnectionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + connection_ = null; + if (connectionBuilder_ != null) { + connectionBuilder_.dispose(); + connectionBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + allowMissing_ = false; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return google.devtools.cloudbuild.v2.RepositoryManagerProto + .internal_static_google_devtools_cloudbuild_v2_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.UpdateConnectionRequest getDefaultInstanceForType() { + return google.devtools.cloudbuild.v2.UpdateConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.UpdateConnectionRequest build() { + google.devtools.cloudbuild.v2.UpdateConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.UpdateConnectionRequest buildPartial() { + google.devtools.cloudbuild.v2.UpdateConnectionRequest result = + new google.devtools.cloudbuild.v2.UpdateConnectionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(google.devtools.cloudbuild.v2.UpdateConnectionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connection_ = connectionBuilder_ == null ? connection_ : connectionBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowMissing_ = allowMissing_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + } + + @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 google.devtools.cloudbuild.v2.UpdateConnectionRequest) { + return mergeFrom((google.devtools.cloudbuild.v2.UpdateConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(google.devtools.cloudbuild.v2.UpdateConnectionRequest other) { + if (other == google.devtools.cloudbuild.v2.UpdateConnectionRequest.getDefaultInstance()) + return this; + if (other.hasConnection()) { + mergeConnection(other.getConnection()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getConnectionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private google.devtools.cloudbuild.v2.Connection connection_; + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder> + connectionBuilder_; + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public google.devtools.cloudbuild.v2.Connection getConnection() { + if (connectionBuilder_ == null) { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } else { + return connectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection(google.devtools.cloudbuild.v2.Connection value) { + if (connectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + } else { + connectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection(google.devtools.cloudbuild.v2.Connection.Builder builderForValue) { + if (connectionBuilder_ == null) { + connection_ = builderForValue.build(); + } else { + connectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConnection(google.devtools.cloudbuild.v2.Connection value) { + if (connectionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && connection_ != null + && connection_ != google.devtools.cloudbuild.v2.Connection.getDefaultInstance()) { + getConnectionBuilder().mergeFrom(value); + } else { + connection_ = value; + } + } else { + connectionBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConnection() { + bitField0_ = (bitField0_ & ~0x00000001); + connection_ = null; + if (connectionBuilder_ != null) { + connectionBuilder_.dispose(); + connectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.Connection.Builder getConnectionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionOrBuilder() { + if (connectionBuilder_ != null) { + return connectionBuilder_.getMessageOrBuilder(); + } else { + return connection_ == null + ? google.devtools.cloudbuild.v2.Connection.getDefaultInstance() + : connection_; + } + } + /** + * + * + *
+     * Required. The Connection to update.
+     * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder> + getConnectionFieldBuilder() { + if (connectionBuilder_ == null) { + connectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + google.devtools.cloudbuild.v2.Connection, + google.devtools.cloudbuild.v2.Connection.Builder, + google.devtools.cloudbuild.v2.ConnectionOrBuilder>( + getConnection(), getParentForChildren(), isClean()); + connection_ = null; + } + return connectionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * If set to true, and the connection is not found a new connection
+     * will be created. In this situation `update_mask` is ignored.
+     * The creation will succeed only if the input connection has all the
+     * necessary information (e.g a github_config with both  user_oauth_token and
+     * installation_id properties).
+     * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * If set to true, and the connection is not found a new connection
+     * will be created. In this situation `update_mask` is ignored.
+     * The creation will succeed only if the input connection has all the
+     * necessary information (e.g a github_config with both  user_oauth_token and
+     * installation_id properties).
+     * 
+ * + * bool allow_missing = 3; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set to true, and the connection is not found a new connection
+     * will be created. In this situation `update_mask` is ignored.
+     * The creation will succeed only if the input connection has all the
+     * necessary information (e.g a github_config with both  user_oauth_token and
+     * installation_id properties).
+     * 
+ * + * bool allow_missing = 3; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000004); + allowMissing_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, update will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, update will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, update will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, update will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the connection.
+     * If an etag is provided and does not match the current etag of the
+     * connection, update will be blocked and an ABORTED error will be returned.
+     * 
+ * + * string etag = 4; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + 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.cloudbuild.v2.UpdateConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v2.UpdateConnectionRequest) + private static final google.devtools.cloudbuild.v2.UpdateConnectionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new google.devtools.cloudbuild.v2.UpdateConnectionRequest(); + } + + public static google.devtools.cloudbuild.v2.UpdateConnectionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public google.devtools.cloudbuild.v2.UpdateConnectionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/UpdateConnectionRequestOrBuilder.java b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/UpdateConnectionRequestOrBuilder.java new file mode 100644 index 000000000000..108fd1221fa1 --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/java/google/devtools/cloudbuild/v2/UpdateConnectionRequestOrBuilder.java @@ -0,0 +1,147 @@ +/* + * 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/cloudbuild/v2/repositories.proto + +package google.devtools.cloudbuild.v2; + +public interface UpdateConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.devtools.cloudbuild.v2.UpdateConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Connection to update.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + boolean hasConnection(); + /** + * + * + *
+   * Required. The Connection to update.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + google.devtools.cloudbuild.v2.Connection getConnection(); + /** + * + * + *
+   * Required. The Connection to update.
+   * 
+ * + * + * .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + google.devtools.cloudbuild.v2.ConnectionOrBuilder getConnectionOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * If set to true, and the connection is not found a new connection
+   * will be created. In this situation `update_mask` is ignored.
+   * The creation will succeed only if the input connection has all the
+   * necessary information (e.g a github_config with both  user_oauth_token and
+   * installation_id properties).
+   * 
+ * + * bool allow_missing = 3; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); + + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, update will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * The current etag of the connection.
+   * If an etag is provided and does not match the current etag of the
+   * connection, update will be blocked and an ABORTED error will be returned.
+   * 
+ * + * string etag = 4; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/proto/google/devtools/cloudbuild/v2/cloudbuild.proto b/java-cloudbuild/proto-google-cloud-build-v2/src/main/proto/google/devtools/cloudbuild/v2/cloudbuild.proto new file mode 100644 index 000000000000..a6ea258771de --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/proto/google/devtools/cloudbuild/v2/cloudbuild.proto @@ -0,0 +1,112 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloudbuild.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudBuild.V2"; +option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v2;cloudbuild"; +option java_multiple_files = true; +option java_outer_classname = "CloudBuildProto"; +option java_package = "google.devtools.cloudbuild.v2"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Build\\V2"; +option ruby_package = "Google::Cloud::Build::V2"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/ServiceAccount" + pattern: "projects/{project}/serviceAccounts/{service_account}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/Secret" + pattern: "projects/{project}/secrets/{secret}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/githubEnterpriseConfig" + pattern: "projects/{project}/locations/{location}/githubEnterpriseConfigs/{config}" +}; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents the custom metadata of the RunWorkflow long-running operation. +message RunWorkflowCustomOperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the pipeline run created by RunWorkflow. + string pipeline_run_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudbuild/proto-google-cloud-build-v2/src/main/proto/google/devtools/cloudbuild/v2/repositories.proto b/java-cloudbuild/proto-google-cloud-build-v2/src/main/proto/google/devtools/cloudbuild/v2/repositories.proto new file mode 100644 index 000000000000..5cfa6d94167a --- /dev/null +++ b/java-cloudbuild/proto-google-cloud-build-v2/src/main/proto/google/devtools/cloudbuild/v2/repositories.proto @@ -0,0 +1,676 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloudbuild.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudBuild.V2"; +option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v2;cloudbuild"; +option java_multiple_files = true; +option java_outer_classname = "RepositoryManagerProto"; +option java_package = "google.devtools.cloudbuild.v2"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Build\\V2"; +option ruby_package = "Google::Cloud::Build::V2"; +option (google.api.resource_definition) = { + type: "servicedirectory.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" +}; + +// Manages connections to source code repostiories. +service RepositoryManager { + option (google.api.default_host) = "cloudbuild.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Connection. + rpc CreateConnection(CreateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/connections" + body: "connection" + }; + option (google.api.method_signature) = "parent,connection,connection_id"; + option (google.longrunning.operation_info) = { + response_type: "Connection" + metadata_type: "google.devtools.cloudbuild.v2.OperationMetadata" + }; + } + + // Gets details of a single connection. + rpc GetConnection(GetConnectionRequest) returns (Connection) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Connections in a given project and location. + rpc ListConnections(ListConnectionsRequest) + returns (ListConnectionsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/connections" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a single connection. + rpc UpdateConnection(UpdateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{connection.name=projects/*/locations/*/connections/*}" + body: "connection" + }; + option (google.api.method_signature) = "connection,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Connection" + metadata_type: "google.devtools.cloudbuild.v2.OperationMetadata" + }; + } + + // Deletes a single connection. + rpc DeleteConnection(DeleteConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.devtools.cloudbuild.v2.OperationMetadata" + }; + } + + // Creates a Repository. + rpc CreateRepository(CreateRepositoryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*/connections/*}/repositories" + body: "repository" + }; + option (google.api.method_signature) = "parent,repository,repository_id"; + option (google.longrunning.operation_info) = { + response_type: "Repository" + metadata_type: "google.devtools.cloudbuild.v2.OperationMetadata" + }; + } + + // Creates multiple repositories inside a connection. + rpc BatchCreateRepositories(BatchCreateRepositoriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*/connections/*}/repositories:batchCreate" + body: "*" + }; + option (google.api.method_signature) = "parent,requests"; + option (google.longrunning.operation_info) = { + response_type: "BatchCreateRepositoriesResponse" + metadata_type: "google.devtools.cloudbuild.v2.OperationMetadata" + }; + } + + // Gets details of a single repository. + rpc GetRepository(GetRepositoryRequest) returns (Repository) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/connections/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Repositories in a given connection. + rpc ListRepositories(ListRepositoriesRequest) + returns (ListRepositoriesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*/connections/*}/repositories" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single repository. + rpc DeleteRepository(DeleteRepositoryRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/connections/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.devtools.cloudbuild.v2.OperationMetadata" + }; + } + + // Fetches read/write token of a given repository. + rpc FetchReadWriteToken(FetchReadWriteTokenRequest) + returns (FetchReadWriteTokenResponse) { + option (google.api.http) = { + post: "/v2/{repository=projects/*/locations/*/connections/*/repositories/*}:accessReadWriteToken" + body: "*" + }; + option (google.api.method_signature) = "repository"; + } + + // Fetches read token of a given repository. + rpc FetchReadToken(FetchReadTokenRequest) returns (FetchReadTokenResponse) { + option (google.api.http) = { + post: "/v2/{repository=projects/*/locations/*/connections/*/repositories/*}:accessReadToken" + body: "*" + }; + option (google.api.method_signature) = "repository"; + } + + // FetchLinkableRepositories get repositories from SCM that are + // accessible and could be added to the connection. + rpc FetchLinkableRepositories(FetchLinkableRepositoriesRequest) + returns (FetchLinkableRepositoriesResponse) { + option (google.api.http) = { + get: "/v2/{connection=projects/*/locations/*/connections/*}:fetchLinkableRepositories" + }; + } +} + +// A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Server or +// GitLab. +message Connection { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/Connection" + pattern: "projects/{project}/locations/{location}/connections/{connection}" + plural: "connections" + singular: "connection" + style: DECLARATIVE_FRIENDLY + }; + + // Immutable. The resource name of the connection, in the format + // `projects/{project}/locations/{location}/connections/{connection_id}`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Server assigned timestamp for when the connection was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server assigned timestamp for when the connection was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for the connection depending on the type of provider. + oneof connection_config { + // Configuration for connections to github.com. + GitHubConfig github_config = 5; + + // Configuration for connections to an instance of GitHub Enterprise. + GitHubEnterpriseConfig github_enterprise_config = 6; + } + + // Output only. Installation state of the Connection. + InstallationState installation_state = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If disabled is set to true, functionality is disabled for this connection. + // Repository based API methods and webhooks processing for repositories in + // this connection will be disabled. + bool disabled = 13; + + // Output only. Set to true when the connection is being set up or updated in + // the background. + bool reconciling = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allows clients to store small amounts of arbitrary data. + map annotations = 15; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 16; +} + +// Describes stage and necessary actions to be taken by the +// user to complete the installation. Used for GitHub and GitHub Enterprise +// based connections. +message InstallationState { + // Stage of the installation process. + enum Stage { + // No stage specified. + STAGE_UNSPECIFIED = 0; + + // Only for GitHub Enterprise. An App creation has been requested. + // The user needs to confirm the creation in their GitHub enterprise host. + PENDING_CREATE_APP = 1; + + // User needs to authorize the GitHub (or Enterprise) App via OAuth. + PENDING_USER_OAUTH = 2; + + // User needs to follow the link to install the GitHub (or Enterprise) App. + PENDING_INSTALL_APP = 3; + + // Installation process has been completed. + COMPLETE = 10; + } + + // Output only. Current step of the installation process. + Stage stage = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Message of what the user should do next to continue the + // installation. Empty string if the installation is already complete. + string message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to follow for next action. Empty string if the + // installation is already complete. + string action_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for FetchLinkableRepositories. +message FetchLinkableRepositoriesRequest { + // Required. The name of the Connection. + // Format: `projects/*/locations/*/connections/*`. + string connection = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Connection" + } + ]; + + // Number of results to return in the list. Default to 20. + int32 page_size = 2; + + // Page start. + string page_token = 3; +} + +// Response message for FetchLinkableRepositories. +message FetchLinkableRepositoriesResponse { + // repositories ready to be created. + repeated Repository repositories = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Configuration for connections to github.com. +message GitHubConfig { + // OAuth credential of the account that authorized the Cloud Build GitHub App. + // It is recommended to use a robot account instead of a human user account. + // The OAuth token must be tied to the Cloud Build GitHub App. + OAuthCredential authorizer_credential = 1; + + // GitHub App installation id. + int64 app_installation_id = 2; +} + +// Configuration for connections to an instance of GitHub Enterprise. +message GitHubEnterpriseConfig { + // Required. The URI of the GitHub Enterprise host this connection is for. + string host_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. API Key used for authentication of webhook events. + string api_key = 12 [(google.api.field_behavior) = REQUIRED]; + + // Id of the GitHub App created from the manifest. + int64 app_id = 2; + + // The URL-friendly name of the GitHub App. + string app_slug = 13; + + // SecretManager resource containing the private key of the GitHub App, + // formatted as `projects/*/secrets/*/versions/*`. + string private_key_secret_version = 4 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + + // SecretManager resource containing the webhook secret of the GitHub App, + // formatted as `projects/*/secrets/*/versions/*`. + string webhook_secret_secret_version = 5 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + + // ID of the installation of the GitHub App. + int64 app_installation_id = 9; + + // Configuration for using Service Directory to privately connect to a GitHub + // Enterprise server. This should only be set if the GitHub Enterprise server + // is hosted on-premises and not reachable by public internet. If this field + // is left empty, calls to the GitHub Enterprise server will be made over the + // public internet. + ServiceDirectoryConfig service_directory_config = 10; + + // SSL certificate to use for requests to GitHub Enterprise. + string ssl_ca = 11; + + // Output only. GitHub Enterprise version installed at the host_uri. + string server_version = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ServiceDirectoryConfig represents Service Directory configuration for a +// connection. +message ServiceDirectoryConfig { + // Required. The Service Directory service name. + // Format: + // projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + string service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; +} + +// A repository associated to a parent connection. +message Repository { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}" + plural: "repositories" + singular: "repository" + style: DECLARATIVE_FRIENDLY + }; + + // Immutable. Resource name of the repository, in the format + // `projects/*/locations/*/connections/*/repositories/*`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Git Clone HTTPS URI. + string remote_uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server assigned timestamp for when the connection was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server assigned timestamp for when the connection was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allows clients to store small amounts of arbitrary data. + map annotations = 6; + + // This checksum is computed by the server based on the value of other + // fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 7; +} + +// Represents an OAuth token of the account that authorized the Connection, +// and associated metadata. +message OAuthCredential { + // A SecretManager resource containing the OAuth token that authorizes + // the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`. + string oauth_token_secret_version = 1 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + + // Output only. The username associated to this token. + string username = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for creating a Connection +message CreateConnectionRequest { + // Required. Project and location where the connection will be created. + // Format: `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Connection" + } + ]; + + // Required. The Connection to create. + Connection connection = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the Connection, which will become the final + // component of the Connection's resource name. Names must be unique + // per-project per-location. Allows alphanumeric characters and any of + // -._~%!$&'()*+,;=@. + string connection_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for getting the details of a Connection. +message GetConnectionRequest { + // Required. The name of the Connection to retrieve. + // Format: `projects/*/locations/*/connections/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Connection" + } + ]; +} + +// Message for requesting list of Connections. +message ListConnectionsRequest { + // Required. The parent, which owns this collection of Connections. + // Format: `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Connection" + } + ]; + + // Number of results to return in the list. + int32 page_size = 2; + + // Page start. + string page_token = 3; +} + +// Message for response to listing Connections. +message ListConnectionsResponse { + // The list of Connections. + repeated Connection connections = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for updating a Connection. +message UpdateConnectionRequest { + // Required. The Connection to update. + Connection connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the connection is not found a new connection + // will be created. In this situation `update_mask` is ignored. + // The creation will succeed only if the input connection has all the + // necessary information (e.g a github_config with both user_oauth_token and + // installation_id properties). + bool allow_missing = 3; + + // The current etag of the connection. + // If an etag is provided and does not match the current etag of the + // connection, update will be blocked and an ABORTED error will be returned. + string etag = 4; +} + +// Message for deleting a Connection. +message DeleteConnectionRequest { + // Required. The name of the Connection to delete. + // Format: `projects/*/locations/*/connections/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Connection" + } + ]; + + // The current etag of the connection. + // If an etag is provided and does not match the current etag of the + // connection, deletion will be blocked and an ABORTED error will be returned. + string etag = 2; + + // If set, validate the request, but do not actually post it. + bool validate_only = 3; +} + +// Message for creating a Repository. +message CreateRepositoryRequest { + // Required. The connection to contain the repository. If the request is part + // of a BatchCreateRepositoriesRequest, this field should be empty or match + // the parent specified there. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Connection" + } + ]; + + // Required. The repository to create. + Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the repository, which will become the final + // component of the repository's resource name. This ID should be unique in + // the connection. Allows alphanumeric characters and any of + // -._~%!$&'()*+,;=@. + string repository_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for creating repositoritories in batch. +message BatchCreateRepositoriesRequest { + // Required. The connection to contain all the repositories being created. + // Format: projects/*/locations/*/connections/* + // The parent field in the CreateRepositoryRequest messages + // must either be empty or match this field. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Connection" + } + ]; + + // Required. The request messages specifying the repositories to create. + repeated CreateRepositoryRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for response of creating repositories in batch. +message BatchCreateRepositoriesResponse { + // Repository resources created. + repeated Repository repositories = 1; +} + +// Message for getting the details of a Repository. +message GetRepositoryRequest { + // Required. The name of the Repository to retrieve. + // Format: `projects/*/locations/*/connections/*/repositories/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Repository" + } + ]; +} + +// Message for requesting list of Repositories. +message ListRepositoriesRequest { + // Required. The parent, which owns this collection of Repositories. + // Format: `projects/*/locations/*/connections/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Repository" + } + ]; + + // Number of results to return in the list. + int32 page_size = 2; + + // Page start. + string page_token = 3; + + // A filter expression that filters resources listed in the response. + // Expressions must follow API improvement proposal + // [AIP-160](https://google.aip.dev/160). e.g. + // `remote_uri:"https://github.com*"`. + string filter = 4; +} + +// Message for response to listing Repositories. +message ListRepositoriesResponse { + // The list of Repositories. + repeated Repository repositories = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for deleting a Repository. +message DeleteRepositoryRequest { + // Required. The name of the Repository to delete. + // Format: `projects/*/locations/*/connections/*/repositories/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Repository" + } + ]; + + // The current etag of the repository. + // If an etag is provided and does not match the current etag of the + // repository, deletion will be blocked and an ABORTED error will be returned. + string etag = 2; + + // If set, validate the request, but do not actually post it. + bool validate_only = 3; +} + +// Message for fetching SCM read/write token. +message FetchReadWriteTokenRequest { + // Required. The resource name of the repository in the format + // `projects/*/locations/*/connections/*/repositories/*`. + string repository = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Repository" + } + ]; +} + +// Message for fetching SCM read token. +message FetchReadTokenRequest { + // Required. The resource name of the repository in the format + // `projects/*/locations/*/connections/*/repositories/*`. + string repository = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Repository" + } + ]; +} + +// Message for responding to get read token. +message FetchReadTokenResponse { + // The token content. + string token = 1; + + // Expiration timestamp. Can be empty if unknown or non-expiring. + google.protobuf.Timestamp expiration_time = 2; +} + +// Message for responding to get read/write token. +message FetchReadWriteTokenResponse { + // The token content. + string token = 1; + + // Expiration timestamp. Can be empty if unknown or non-expiring. + google.protobuf.Timestamp expiration_time = 2; +} diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/AsyncBatchCreateRepositories.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/AsyncBatchCreateRepositories.java new file mode 100644 index 000000000000..1cf1c1fffd30 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/AsyncBatchCreateRepositories.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; + +public class AsyncBatchCreateRepositories { + + public static void main(String[] args) throws Exception { + asyncBatchCreateRepositories(); + } + + public static void asyncBatchCreateRepositories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + BatchCreateRepositoriesRequest request = + BatchCreateRepositoriesRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllRequests(new ArrayList()) + .build(); + ApiFuture future = + repositoryManagerClient.batchCreateRepositoriesCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/AsyncBatchCreateRepositoriesLRO.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/AsyncBatchCreateRepositoriesLRO.java new file mode 100644 index 000000000000..00c3de4edef5 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/AsyncBatchCreateRepositoriesLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; + +public class AsyncBatchCreateRepositoriesLRO { + + public static void main(String[] args) throws Exception { + asyncBatchCreateRepositoriesLRO(); + } + + public static void asyncBatchCreateRepositoriesLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + BatchCreateRepositoriesRequest request = + BatchCreateRepositoriesRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllRequests(new ArrayList()) + .build(); + OperationFuture future = + repositoryManagerClient.batchCreateRepositoriesOperationCallable().futureCall(request); + // Do something. + BatchCreateRepositoriesResponse response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_LRO_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositories.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositories.java new file mode 100644 index 000000000000..2fecd232b32e --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositories.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_sync] +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest; +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; + +public class SyncBatchCreateRepositories { + + public static void main(String[] args) throws Exception { + syncBatchCreateRepositories(); + } + + public static void syncBatchCreateRepositories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + BatchCreateRepositoriesRequest request = + BatchCreateRepositoriesRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllRequests(new ArrayList()) + .build(); + BatchCreateRepositoriesResponse response = + repositoryManagerClient.batchCreateRepositoriesAsync(request).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositoriesConnectionnameListcreaterepositoryrequest.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositoriesConnectionnameListcreaterepositoryrequest.java new file mode 100644 index 000000000000..ab19ff68afda --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositoriesConnectionnameListcreaterepositoryrequest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_ConnectionnameListcreaterepositoryrequest_sync] +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncBatchCreateRepositoriesConnectionnameListcreaterepositoryrequest { + + public static void main(String[] args) throws Exception { + syncBatchCreateRepositoriesConnectionnameListcreaterepositoryrequest(); + } + + public static void syncBatchCreateRepositoriesConnectionnameListcreaterepositoryrequest() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List requests = new ArrayList<>(); + BatchCreateRepositoriesResponse response = + repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_ConnectionnameListcreaterepositoryrequest_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositoriesStringListcreaterepositoryrequest.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositoriesStringListcreaterepositoryrequest.java new file mode 100644 index 000000000000..7e71b2d90ffc --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/batchcreaterepositories/SyncBatchCreateRepositoriesStringListcreaterepositoryrequest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_StringListcreaterepositoryrequest_sync] +import google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncBatchCreateRepositoriesStringListcreaterepositoryrequest { + + public static void main(String[] args) throws Exception { + syncBatchCreateRepositoriesStringListcreaterepositoryrequest(); + } + + public static void syncBatchCreateRepositoriesStringListcreaterepositoryrequest() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + List requests = new ArrayList<>(); + BatchCreateRepositoriesResponse response = + repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_BatchCreateRepositories_StringListcreaterepositoryrequest_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetCredentialsProvider.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f329a25aeb39 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryManagerSettings; +import google.devtools.cloudbuild.v2.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RepositoryManagerSettings repositoryManagerSettings = + RepositoryManagerSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RepositoryManagerClient repositoryManagerClient = + RepositoryManagerClient.create(repositoryManagerSettings); + } +} +// [END cloudbuild_v2_generated_RepositoryManager_Create_SetCredentialsProvider_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetCredentialsProvider1.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..876b89ab2dbb --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_Create_SetCredentialsProvider1_sync] +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryManagerSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RepositoryManagerSettings repositoryManagerSettings = + RepositoryManagerSettings.newHttpJsonBuilder().build(); + RepositoryManagerClient repositoryManagerClient = + RepositoryManagerClient.create(repositoryManagerSettings); + } +} +// [END cloudbuild_v2_generated_RepositoryManager_Create_SetCredentialsProvider1_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetEndpoint.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..78e0751cbd52 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_Create_SetEndpoint_sync] +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryManagerSettings; +import google.devtools.cloudbuild.v2.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RepositoryManagerSettings repositoryManagerSettings = + RepositoryManagerSettings.newBuilder().setEndpoint(myEndpoint).build(); + RepositoryManagerClient repositoryManagerClient = + RepositoryManagerClient.create(repositoryManagerSettings); + } +} +// [END cloudbuild_v2_generated_RepositoryManager_Create_SetEndpoint_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/AsyncCreateConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/AsyncCreateConnection.java new file mode 100644 index 000000000000..0d9fbb779682 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/AsyncCreateConnection.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateConnection_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncCreateConnection { + + public static void main(String[] args) throws Exception { + asyncCreateConnection(); + } + + public static void asyncCreateConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setConnection(Connection.newBuilder().build()) + .setConnectionId("connectionId1923106969") + .build(); + ApiFuture future = + repositoryManagerClient.createConnectionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateConnection_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/AsyncCreateConnectionLRO.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/AsyncCreateConnectionLRO.java new file mode 100644 index 000000000000..76c23a376bc0 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/AsyncCreateConnectionLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateConnection_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncCreateConnectionLRO { + + public static void main(String[] args) throws Exception { + asyncCreateConnectionLRO(); + } + + public static void asyncCreateConnectionLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setConnection(Connection.newBuilder().build()) + .setConnectionId("connectionId1923106969") + .build(); + OperationFuture future = + repositoryManagerClient.createConnectionOperationCallable().futureCall(request); + // Do something. + Connection response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateConnection_LRO_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnection.java new file mode 100644 index 000000000000..fdfcf15263fc --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnection.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateConnection_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.CreateConnectionRequest; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncCreateConnection { + + public static void main(String[] args) throws Exception { + syncCreateConnection(); + } + + public static void syncCreateConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setConnection(Connection.newBuilder().build()) + .setConnectionId("connectionId1923106969") + .build(); + Connection response = repositoryManagerClient.createConnectionAsync(request).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateConnection_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnectionLocationnameConnectionString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnectionLocationnameConnectionString.java new file mode 100644 index 000000000000..30f20599fe39 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnectionLocationnameConnectionString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateConnection_LocationnameConnectionString_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncCreateConnectionLocationnameConnectionString { + + public static void main(String[] args) throws Exception { + syncCreateConnectionLocationnameConnectionString(); + } + + public static void syncCreateConnectionLocationnameConnectionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + Connection response = + repositoryManagerClient.createConnectionAsync(parent, connection, connectionId).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateConnection_LocationnameConnectionString_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnectionStringConnectionString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnectionStringConnectionString.java new file mode 100644 index 000000000000..23a622df7690 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createconnection/SyncCreateConnectionStringConnectionString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateConnection_StringConnectionString_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncCreateConnectionStringConnectionString { + + public static void main(String[] args) throws Exception { + syncCreateConnectionStringConnectionString(); + } + + public static void syncCreateConnectionStringConnectionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId1923106969"; + Connection response = + repositoryManagerClient.createConnectionAsync(parent, connection, connectionId).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateConnection_StringConnectionString_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/AsyncCreateRepository.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/AsyncCreateRepository.java new file mode 100644 index 000000000000..9df38f88fafe --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/AsyncCreateRepository.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateRepository_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncCreateRepository { + + public static void main(String[] args) throws Exception { + asyncCreateRepository(); + } + + public static void asyncCreateRepository() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + CreateRepositoryRequest request = + CreateRepositoryRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setRepository(Repository.newBuilder().build()) + .setRepositoryId("repositoryId2113747461") + .build(); + ApiFuture future = + repositoryManagerClient.createRepositoryCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateRepository_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/AsyncCreateRepositoryLRO.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/AsyncCreateRepositoryLRO.java new file mode 100644 index 000000000000..b96aa2365690 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/AsyncCreateRepositoryLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateRepository_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncCreateRepositoryLRO { + + public static void main(String[] args) throws Exception { + asyncCreateRepositoryLRO(); + } + + public static void asyncCreateRepositoryLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + CreateRepositoryRequest request = + CreateRepositoryRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setRepository(Repository.newBuilder().build()) + .setRepositoryId("repositoryId2113747461") + .build(); + OperationFuture future = + repositoryManagerClient.createRepositoryOperationCallable().futureCall(request); + // Do something. + Repository response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateRepository_LRO_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepository.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepository.java new file mode 100644 index 000000000000..b9c9f4bea015 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepository.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateRepository_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.CreateRepositoryRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncCreateRepository { + + public static void main(String[] args) throws Exception { + syncCreateRepository(); + } + + public static void syncCreateRepository() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + CreateRepositoryRequest request = + CreateRepositoryRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setRepository(Repository.newBuilder().build()) + .setRepositoryId("repositoryId2113747461") + .build(); + Repository response = repositoryManagerClient.createRepositoryAsync(request).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateRepository_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepositoryConnectionnameRepositoryString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepositoryConnectionnameRepositoryString.java new file mode 100644 index 000000000000..1e428ecf0917 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepositoryConnectionnameRepositoryString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateRepository_ConnectionnameRepositoryString_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncCreateRepositoryConnectionnameRepositoryString { + + public static void main(String[] args) throws Exception { + syncCreateRepositoryConnectionnameRepositoryString(); + } + + public static void syncCreateRepositoryConnectionnameRepositoryString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + Repository response = + repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateRepository_ConnectionnameRepositoryString_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepositoryStringRepositoryString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepositoryStringRepositoryString.java new file mode 100644 index 000000000000..7e013ae01f88 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/createrepository/SyncCreateRepositoryStringRepositoryString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_CreateRepository_StringRepositoryString_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncCreateRepositoryStringRepositoryString { + + public static void main(String[] args) throws Exception { + syncCreateRepositoryStringRepositoryString(); + } + + public static void syncCreateRepositoryStringRepositoryString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + Repository repository = Repository.newBuilder().build(); + String repositoryId = "repositoryId2113747461"; + Repository response = + repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_CreateRepository_StringRepositoryString_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/AsyncDeleteConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/AsyncDeleteConnection.java new file mode 100644 index 000000000000..6964582f1513 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/AsyncDeleteConnection.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteConnection_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncDeleteConnection { + + public static void main(String[] args) throws Exception { + asyncDeleteConnection(); + } + + public static void asyncDeleteConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = + repositoryManagerClient.deleteConnectionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteConnection_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/AsyncDeleteConnectionLRO.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/AsyncDeleteConnectionLRO.java new file mode 100644 index 000000000000..667fc13af607 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/AsyncDeleteConnectionLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteConnection_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncDeleteConnectionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteConnectionLRO(); + } + + public static void asyncDeleteConnectionLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + repositoryManagerClient.deleteConnectionOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteConnection_LRO_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnection.java new file mode 100644 index 000000000000..d08ec2154d8a --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnection.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteConnection_sync] +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.DeleteConnectionRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncDeleteConnection { + + public static void main(String[] args) throws Exception { + syncDeleteConnection(); + } + + public static void syncDeleteConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + repositoryManagerClient.deleteConnectionAsync(request).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteConnection_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnectionConnectionname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnectionConnectionname.java new file mode 100644 index 000000000000..cf4394b4706c --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnectionConnectionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteConnection_Connectionname_sync] +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncDeleteConnectionConnectionname { + + public static void main(String[] args) throws Exception { + syncDeleteConnectionConnectionname(); + } + + public static void syncDeleteConnectionConnectionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + repositoryManagerClient.deleteConnectionAsync(name).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteConnection_Connectionname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnectionString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnectionString.java new file mode 100644 index 000000000000..fdd50a708653 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleteconnection/SyncDeleteConnectionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteConnection_String_sync] +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncDeleteConnectionString { + + public static void main(String[] args) throws Exception { + syncDeleteConnectionString(); + } + + public static void syncDeleteConnectionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + repositoryManagerClient.deleteConnectionAsync(name).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteConnection_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/AsyncDeleteRepository.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/AsyncDeleteRepository.java new file mode 100644 index 000000000000..0ce513d08ad3 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/AsyncDeleteRepository.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteRepository_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class AsyncDeleteRepository { + + public static void main(String[] args) throws Exception { + asyncDeleteRepository(); + } + + public static void asyncDeleteRepository() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + DeleteRepositoryRequest request = + DeleteRepositoryRequest.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + ApiFuture future = + repositoryManagerClient.deleteRepositoryCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteRepository_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/AsyncDeleteRepositoryLRO.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/AsyncDeleteRepositoryLRO.java new file mode 100644 index 000000000000..196eebb3b381 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/AsyncDeleteRepositoryLRO.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteRepository_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class AsyncDeleteRepositoryLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteRepositoryLRO(); + } + + public static void asyncDeleteRepositoryLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + DeleteRepositoryRequest request = + DeleteRepositoryRequest.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + OperationFuture future = + repositoryManagerClient.deleteRepositoryOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteRepository_LRO_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepository.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepository.java new file mode 100644 index 000000000000..682633150729 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepository.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteRepository_sync] +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.DeleteRepositoryRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncDeleteRepository { + + public static void main(String[] args) throws Exception { + syncDeleteRepository(); + } + + public static void syncDeleteRepository() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + DeleteRepositoryRequest request = + DeleteRepositoryRequest.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .setEtag("etag3123477") + .setValidateOnly(true) + .build(); + repositoryManagerClient.deleteRepositoryAsync(request).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteRepository_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepositoryRepositoryname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepositoryRepositoryname.java new file mode 100644 index 000000000000..54dc8911e3a2 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepositoryRepositoryname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteRepository_Repositoryname_sync] +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncDeleteRepositoryRepositoryname { + + public static void main(String[] args) throws Exception { + syncDeleteRepositoryRepositoryname(); + } + + public static void syncDeleteRepositoryRepositoryname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + repositoryManagerClient.deleteRepositoryAsync(name).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteRepository_Repositoryname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepositoryString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepositoryString.java new file mode 100644 index 000000000000..e321aea955fa --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/deleterepository/SyncDeleteRepositoryString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_DeleteRepository_String_sync] +import com.google.protobuf.Empty; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncDeleteRepositoryString { + + public static void main(String[] args) throws Exception { + syncDeleteRepositoryString(); + } + + public static void syncDeleteRepositoryString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString(); + repositoryManagerClient.deleteRepositoryAsync(name).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_DeleteRepository_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/AsyncFetchLinkableRepositories.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/AsyncFetchLinkableRepositories.java new file mode 100644 index 000000000000..3e2503f6cbb5 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/AsyncFetchLinkableRepositories.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchLinkableRepositories_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncFetchLinkableRepositories { + + public static void main(String[] args) throws Exception { + asyncFetchLinkableRepositories(); + } + + public static void asyncFetchLinkableRepositories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection( + ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + repositoryManagerClient.fetchLinkableRepositoriesPagedCallable().futureCall(request); + // Do something. + for (Repository element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchLinkableRepositories_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/AsyncFetchLinkableRepositoriesPaged.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/AsyncFetchLinkableRepositoriesPaged.java new file mode 100644 index 000000000000..a0123d37b496 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/AsyncFetchLinkableRepositoriesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchLinkableRepositories_Paged_async] +import com.google.common.base.Strings; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncFetchLinkableRepositoriesPaged { + + public static void main(String[] args) throws Exception { + asyncFetchLinkableRepositoriesPaged(); + } + + public static void asyncFetchLinkableRepositoriesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection( + ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + FetchLinkableRepositoriesResponse response = + repositoryManagerClient.fetchLinkableRepositoriesCallable().call(request); + for (Repository element : response.getRepositoriesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchLinkableRepositories_Paged_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/SyncFetchLinkableRepositories.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/SyncFetchLinkableRepositories.java new file mode 100644 index 000000000000..22be8b8475fe --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchlinkablerepositories/SyncFetchLinkableRepositories.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchLinkableRepositories_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncFetchLinkableRepositories { + + public static void main(String[] args) throws Exception { + syncFetchLinkableRepositories(); + } + + public static void syncFetchLinkableRepositories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchLinkableRepositoriesRequest request = + FetchLinkableRepositoriesRequest.newBuilder() + .setConnection( + ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Repository element : + repositoryManagerClient.fetchLinkableRepositories(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchLinkableRepositories_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/AsyncFetchReadToken.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/AsyncFetchReadToken.java new file mode 100644 index 000000000000..a598ff8da79e --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/AsyncFetchReadToken.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadToken_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.FetchReadTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class AsyncFetchReadToken { + + public static void main(String[] args) throws Exception { + asyncFetchReadToken(); + } + + public static void asyncFetchReadToken() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchReadTokenRequest request = + FetchReadTokenRequest.newBuilder() + .setRepository( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .build(); + ApiFuture future = + repositoryManagerClient.fetchReadTokenCallable().futureCall(request); + // Do something. + FetchReadTokenResponse response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadToken_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadToken.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadToken.java new file mode 100644 index 000000000000..3de8c0973415 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadToken.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadToken_sync] +import google.devtools.cloudbuild.v2.FetchReadTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncFetchReadToken { + + public static void main(String[] args) throws Exception { + syncFetchReadToken(); + } + + public static void syncFetchReadToken() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchReadTokenRequest request = + FetchReadTokenRequest.newBuilder() + .setRepository( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .build(); + FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadToken_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadTokenRepositoryname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadTokenRepositoryname.java new file mode 100644 index 000000000000..411b307cfb04 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadTokenRepositoryname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadToken_Repositoryname_sync] +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncFetchReadTokenRepositoryname { + + public static void main(String[] args) throws Exception { + syncFetchReadTokenRepositoryname(); + } + + public static void syncFetchReadTokenRepositoryname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(repository); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadToken_Repositoryname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadTokenString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadTokenString.java new file mode 100644 index 000000000000..3cf38197f375 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadtoken/SyncFetchReadTokenString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadToken_String_sync] +import google.devtools.cloudbuild.v2.FetchReadTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncFetchReadTokenString { + + public static void main(String[] args) throws Exception { + syncFetchReadTokenString(); + } + + public static void syncFetchReadTokenString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString(); + FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(repository); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadToken_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/AsyncFetchReadWriteToken.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/AsyncFetchReadWriteToken.java new file mode 100644 index 000000000000..f3cac51fc68f --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/AsyncFetchReadWriteToken.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class AsyncFetchReadWriteToken { + + public static void main(String[] args) throws Exception { + asyncFetchReadWriteToken(); + } + + public static void asyncFetchReadWriteToken() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchReadWriteTokenRequest request = + FetchReadWriteTokenRequest.newBuilder() + .setRepository( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .build(); + ApiFuture future = + repositoryManagerClient.fetchReadWriteTokenCallable().futureCall(request); + // Do something. + FetchReadWriteTokenResponse response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteToken.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteToken.java new file mode 100644 index 000000000000..ff38b82165f3 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteToken.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_sync] +import google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest; +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncFetchReadWriteToken { + + public static void main(String[] args) throws Exception { + syncFetchReadWriteToken(); + } + + public static void syncFetchReadWriteToken() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + FetchReadWriteTokenRequest request = + FetchReadWriteTokenRequest.newBuilder() + .setRepository( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .build(); + FetchReadWriteTokenResponse response = repositoryManagerClient.fetchReadWriteToken(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteTokenRepositoryname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteTokenRepositoryname.java new file mode 100644 index 000000000000..d7ca5558f663 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteTokenRepositoryname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_Repositoryname_sync] +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncFetchReadWriteTokenRepositoryname { + + public static void main(String[] args) throws Exception { + syncFetchReadWriteTokenRepositoryname(); + } + + public static void syncFetchReadWriteTokenRepositoryname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + RepositoryName repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + FetchReadWriteTokenResponse response = + repositoryManagerClient.fetchReadWriteToken(repository); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_Repositoryname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteTokenString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteTokenString.java new file mode 100644 index 000000000000..264b7bdde42b --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/fetchreadwritetoken/SyncFetchReadWriteTokenString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_String_sync] +import google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncFetchReadWriteTokenString { + + public static void main(String[] args) throws Exception { + syncFetchReadWriteTokenString(); + } + + public static void syncFetchReadWriteTokenString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String repository = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString(); + FetchReadWriteTokenResponse response = + repositoryManagerClient.fetchReadWriteToken(repository); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_FetchReadWriteToken_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/AsyncGetConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/AsyncGetConnection.java new file mode 100644 index 000000000000..8cd2aca9dc91 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/AsyncGetConnection.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetConnection_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.GetConnectionRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncGetConnection { + + public static void main(String[] args) throws Exception { + asyncGetConnection(); + } + + public static void asyncGetConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + GetConnectionRequest request = + GetConnectionRequest.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .build(); + ApiFuture future = + repositoryManagerClient.getConnectionCallable().futureCall(request); + // Do something. + Connection response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetConnection_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnection.java new file mode 100644 index 000000000000..fac1bf9f1afc --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnection.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetConnection_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.GetConnectionRequest; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncGetConnection { + + public static void main(String[] args) throws Exception { + syncGetConnection(); + } + + public static void syncGetConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + GetConnectionRequest request = + GetConnectionRequest.newBuilder() + .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .build(); + Connection response = repositoryManagerClient.getConnection(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetConnection_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnectionConnectionname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnectionConnectionname.java new file mode 100644 index 000000000000..1d5e5c0e7274 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnectionConnectionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetConnection_Connectionname_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncGetConnectionConnectionname { + + public static void main(String[] args) throws Exception { + syncGetConnectionConnectionname(); + } + + public static void syncGetConnectionConnectionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection response = repositoryManagerClient.getConnection(name); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetConnection_Connectionname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnectionString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnectionString.java new file mode 100644 index 000000000000..626cce5cde54 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getconnection/SyncGetConnectionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetConnection_String_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncGetConnectionString { + + public static void main(String[] args) throws Exception { + syncGetConnectionString(); + } + + public static void syncGetConnectionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + Connection response = repositoryManagerClient.getConnection(name); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetConnection_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getiampolicy/AsyncGetIamPolicy.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..996ba879de8d --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = repositoryManagerClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetIamPolicy_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getiampolicy/SyncGetIamPolicy.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..4480b40fc2ea --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = repositoryManagerClient.getIamPolicy(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetIamPolicy_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/AsyncGetRepository.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/AsyncGetRepository.java new file mode 100644 index 000000000000..d30c96aab63a --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/AsyncGetRepository.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetRepository_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.GetRepositoryRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class AsyncGetRepository { + + public static void main(String[] args) throws Exception { + asyncGetRepository(); + } + + public static void asyncGetRepository() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + GetRepositoryRequest request = + GetRepositoryRequest.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .build(); + ApiFuture future = + repositoryManagerClient.getRepositoryCallable().futureCall(request); + // Do something. + Repository response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetRepository_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepository.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepository.java new file mode 100644 index 000000000000..4eaa84801c13 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepository.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetRepository_sync] +import google.devtools.cloudbuild.v2.GetRepositoryRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncGetRepository { + + public static void main(String[] args) throws Exception { + syncGetRepository(); + } + + public static void syncGetRepository() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + GetRepositoryRequest request = + GetRepositoryRequest.newBuilder() + .setName( + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]") + .toString()) + .build(); + Repository response = repositoryManagerClient.getRepository(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetRepository_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepositoryRepositoryname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepositoryRepositoryname.java new file mode 100644 index 000000000000..e20181d7510e --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepositoryRepositoryname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetRepository_Repositoryname_sync] +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncGetRepositoryRepositoryname { + + public static void main(String[] args) throws Exception { + syncGetRepositoryRepositoryname(); + } + + public static void syncGetRepositoryRepositoryname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + RepositoryName name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]"); + Repository response = repositoryManagerClient.getRepository(name); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetRepository_Repositoryname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepositoryString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepositoryString.java new file mode 100644 index 000000000000..49e21656c84e --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/getrepository/SyncGetRepositoryString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_GetRepository_String_sync] +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.RepositoryName; + +public class SyncGetRepositoryString { + + public static void main(String[] args) throws Exception { + syncGetRepositoryString(); + } + + public static void syncGetRepositoryString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String name = + RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString(); + Repository response = repositoryManagerClient.getRepository(name); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_GetRepository_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/AsyncListConnections.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/AsyncListConnections.java new file mode 100644 index 000000000000..983e398ac10c --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/AsyncListConnections.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListConnections_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncListConnections { + + public static void main(String[] args) throws Exception { + asyncListConnections(); + } + + public static void asyncListConnections() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + repositoryManagerClient.listConnectionsPagedCallable().futureCall(request); + // Do something. + for (Connection element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListConnections_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/AsyncListConnectionsPaged.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/AsyncListConnectionsPaged.java new file mode 100644 index 000000000000..15d23376f71f --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/AsyncListConnectionsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListConnections_Paged_async] +import com.google.common.base.Strings; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.ListConnectionsResponse; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncListConnectionsPaged { + + public static void main(String[] args) throws Exception { + asyncListConnectionsPaged(); + } + + public static void asyncListConnectionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListConnectionsResponse response = + repositoryManagerClient.listConnectionsCallable().call(request); + for (Connection element : response.getConnectionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListConnections_Paged_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnections.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnections.java new file mode 100644 index 000000000000..ef970285070b --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnections.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListConnections_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.ListConnectionsRequest; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncListConnections { + + public static void main(String[] args) throws Exception { + syncListConnections(); + } + + public static void syncListConnections() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Connection element : repositoryManagerClient.listConnections(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListConnections_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnectionsLocationname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnectionsLocationname.java new file mode 100644 index 000000000000..5cb6888f3cbc --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnectionsLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListConnections_Locationname_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncListConnectionsLocationname { + + public static void main(String[] args) throws Exception { + syncListConnectionsLocationname(); + } + + public static void syncListConnectionsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Connection element : repositoryManagerClient.listConnections(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListConnections_Locationname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnectionsString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnectionsString.java new file mode 100644 index 000000000000..b01fd8c0ab1a --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listconnections/SyncListConnectionsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListConnections_String_sync] +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.LocationName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncListConnectionsString { + + public static void main(String[] args) throws Exception { + syncListConnectionsString(); + } + + public static void syncListConnectionsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Connection element : repositoryManagerClient.listConnections(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListConnections_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/AsyncListRepositories.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/AsyncListRepositories.java new file mode 100644 index 000000000000..be993f54e307 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/AsyncListRepositories.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListRepositories_async] +import com.google.api.core.ApiFuture; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncListRepositories { + + public static void main(String[] args) throws Exception { + asyncListRepositories(); + } + + public static void asyncListRepositories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ListRepositoriesRequest request = + ListRepositoriesRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + repositoryManagerClient.listRepositoriesPagedCallable().futureCall(request); + // Do something. + for (Repository element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListRepositories_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/AsyncListRepositoriesPaged.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/AsyncListRepositoriesPaged.java new file mode 100644 index 000000000000..21ad7bffd96e --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/AsyncListRepositoriesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListRepositories_Paged_async] +import com.google.common.base.Strings; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.ListRepositoriesResponse; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncListRepositoriesPaged { + + public static void main(String[] args) throws Exception { + asyncListRepositoriesPaged(); + } + + public static void asyncListRepositoriesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ListRepositoriesRequest request = + ListRepositoriesRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListRepositoriesResponse response = + repositoryManagerClient.listRepositoriesCallable().call(request); + for (Repository element : response.getRepositoriesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListRepositories_Paged_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositories.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositories.java new file mode 100644 index 000000000000..b479b78c1a42 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositories.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListRepositories_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.ListRepositoriesRequest; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncListRepositories { + + public static void main(String[] args) throws Exception { + syncListRepositories(); + } + + public static void syncListRepositories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ListRepositoriesRequest request = + ListRepositoriesRequest.newBuilder() + .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Repository element : repositoryManagerClient.listRepositories(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListRepositories_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositoriesConnectionname.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositoriesConnectionname.java new file mode 100644 index 000000000000..4bbd182bd942 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositoriesConnectionname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListRepositories_Connectionname_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncListRepositoriesConnectionname { + + public static void main(String[] args) throws Exception { + syncListRepositoriesConnectionname(); + } + + public static void syncListRepositoriesConnectionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + for (Repository element : repositoryManagerClient.listRepositories(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListRepositories_Connectionname_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositoriesString.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositoriesString.java new file mode 100644 index 000000000000..7650f3dc3c65 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/listrepositories/SyncListRepositoriesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_ListRepositories_String_sync] +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.Repository; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncListRepositoriesString { + + public static void main(String[] args) throws Exception { + syncListRepositoriesString(); + } + + public static void syncListRepositoriesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + for (Repository element : repositoryManagerClient.listRepositories(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_ListRepositories_String_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/setiampolicy/AsyncSetIamPolicy.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..4e5b7286a84d --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = repositoryManagerClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_SetIamPolicy_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/setiampolicy/SyncSetIamPolicy.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..e4e2a72bc480 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = repositoryManagerClient.setIamPolicy(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_SetIamPolicy_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/testiampermissions/AsyncTestIamPermissions.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..6c42c0bdaac8 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + repositoryManagerClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_TestIamPermissions_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/testiampermissions/SyncTestIamPermissions.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..d213cac89302 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import google.devtools.cloudbuild.v2.ConnectionName; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = repositoryManagerClient.testIamPermissions(request); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_TestIamPermissions_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/AsyncUpdateConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/AsyncUpdateConnection.java new file mode 100644 index 000000000000..c7d0935eed7b --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/AsyncUpdateConnection.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_UpdateConnection_async] +import com.google.api.core.ApiFuture; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; + +public class AsyncUpdateConnection { + + public static void main(String[] args) throws Exception { + asyncUpdateConnection(); + } + + public static void asyncUpdateConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setConnection(Connection.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setAllowMissing(true) + .setEtag("etag3123477") + .build(); + ApiFuture future = + repositoryManagerClient.updateConnectionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_UpdateConnection_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/AsyncUpdateConnectionLRO.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/AsyncUpdateConnectionLRO.java new file mode 100644 index 000000000000..908747c25031 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/AsyncUpdateConnectionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_UpdateConnection_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.OperationMetadata; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; + +public class AsyncUpdateConnectionLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateConnectionLRO(); + } + + public static void asyncUpdateConnectionLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setConnection(Connection.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setAllowMissing(true) + .setEtag("etag3123477") + .build(); + OperationFuture future = + repositoryManagerClient.updateConnectionOperationCallable().futureCall(request); + // Do something. + Connection response = future.get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_UpdateConnection_LRO_async] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/SyncUpdateConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/SyncUpdateConnection.java new file mode 100644 index 000000000000..44371d39f420 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/SyncUpdateConnection.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_UpdateConnection_sync] +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; +import google.devtools.cloudbuild.v2.UpdateConnectionRequest; + +public class SyncUpdateConnection { + + public static void main(String[] args) throws Exception { + syncUpdateConnection(); + } + + public static void syncUpdateConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setConnection(Connection.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setAllowMissing(true) + .setEtag("etag3123477") + .build(); + Connection response = repositoryManagerClient.updateConnectionAsync(request).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_UpdateConnection_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/SyncUpdateConnectionConnectionFieldmask.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/SyncUpdateConnectionConnectionFieldmask.java new file mode 100644 index 000000000000..2639d639141d --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanager/updateconnection/SyncUpdateConnectionConnectionFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManager_UpdateConnection_ConnectionFieldmask_sync] +import com.google.protobuf.FieldMask; +import google.devtools.cloudbuild.v2.Connection; +import google.devtools.cloudbuild.v2.RepositoryManagerClient; + +public class SyncUpdateConnectionConnectionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateConnectionConnectionFieldmask(); + } + + public static void syncUpdateConnectionConnectionFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) { + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Connection response = + repositoryManagerClient.updateConnectionAsync(connection, updateMask).get(); + } + } +} +// [END cloudbuild_v2_generated_RepositoryManager_UpdateConnection_ConnectionFieldmask_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanagersettings/getconnection/SyncGetConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanagersettings/getconnection/SyncGetConnection.java new file mode 100644 index 000000000000..3b9074925612 --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/repositorymanagersettings/getconnection/SyncGetConnection.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.samples; + +// [START cloudbuild_v2_generated_RepositoryManagerSettings_GetConnection_sync] +import google.devtools.cloudbuild.v2.RepositoryManagerSettings; +import java.time.Duration; + +public class SyncGetConnection { + + public static void main(String[] args) throws Exception { + syncGetConnection(); + } + + public static void syncGetConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RepositoryManagerSettings.Builder repositoryManagerSettingsBuilder = + RepositoryManagerSettings.newBuilder(); + repositoryManagerSettingsBuilder + .getConnectionSettings() + .setRetrySettings( + repositoryManagerSettingsBuilder + .getConnectionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RepositoryManagerSettings repositoryManagerSettings = repositoryManagerSettingsBuilder.build(); + } +} +// [END cloudbuild_v2_generated_RepositoryManagerSettings_GetConnection_sync] diff --git a/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/stub/repositorymanagerstubsettings/getconnection/SyncGetConnection.java b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/stub/repositorymanagerstubsettings/getconnection/SyncGetConnection.java new file mode 100644 index 000000000000..1e3298cadd7d --- /dev/null +++ b/java-cloudbuild/samples/snippets/generated/google/devtools/cloudbuild/v2/stub/repositorymanagerstubsettings/getconnection/SyncGetConnection.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package google.devtools.cloudbuild.v2.stub.samples; + +// [START cloudbuild_v2_generated_RepositoryManagerStubSettings_GetConnection_sync] +import google.devtools.cloudbuild.v2.stub.RepositoryManagerStubSettings; +import java.time.Duration; + +public class SyncGetConnection { + + public static void main(String[] args) throws Exception { + syncGetConnection(); + } + + public static void syncGetConnection() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RepositoryManagerStubSettings.Builder repositoryManagerSettingsBuilder = + RepositoryManagerStubSettings.newBuilder(); + repositoryManagerSettingsBuilder + .getConnectionSettings() + .setRetrySettings( + repositoryManagerSettingsBuilder + .getConnectionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RepositoryManagerStubSettings repositoryManagerSettings = + repositoryManagerSettingsBuilder.build(); + } +} +// [END cloudbuild_v2_generated_RepositoryManagerStubSettings_GetConnection_sync] diff --git a/versions.txt b/versions.txt index dc9a24ee9d1e..6f358fd2b8b7 100644 --- a/versions.txt +++ b/versions.txt @@ -606,3 +606,5 @@ grpc-google-cloud-datalineage-v1:0.2.0:0.3.0-SNAPSHOT google-cloud-shared-dependencies:3.2.0:3.3.0-SNAPSHOT google-cloud-core:2.10.0:2.11.0-SNAPSHOT google-iam-policy:1.8.0:1.9.0-SNAPSHOT +proto-google-cloud-build-v2:3.12.0:3.13.0-SNAPSHOT +grpc-google-cloud-build-v2:3.12.0:3.13.0-SNAPSHOT