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: + * + *
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
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
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
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+ */ + public final OperationCallablefuture = + * repositoryManagerClient.createConnectionOperationCallable().futureCall(request); + * // Do something. + * Connection response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.createConnectionCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.getConnectionCallable().futureCall(request); + * // Do something. + * Connection response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.listConnectionsPagedCallable().futureCall(request); + * // Do something. + * for (Connection element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * repositoryManagerClient.updateConnectionOperationCallable().futureCall(request); + * // Do something. + * Connection response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.updateConnectionCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * repositoryManagerClient.deleteConnectionOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.deleteConnectionCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * repositoryManagerClient.createRepositoryOperationCallable().futureCall(request); + * // Do something. + * Repository response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.createRepositoryCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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+ * + * @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 OperationFuturerequests = new ArrayList<>(); + * BatchCreateRepositoriesResponse response = + * repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get(); + * } + * }
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+ * + * @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 OperationFuturerequests = new ArrayList<>(); + * BatchCreateRepositoriesResponse response = + * repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get(); + * } + * }
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+ * + * @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()) + * .build(); + * BatchCreateRepositoriesResponse response = + * repositoryManagerClient.batchCreateRepositoriesAsync(request).get(); + * } + * }
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+ */ + public final OperationCallable< + BatchCreateRepositoriesRequest, BatchCreateRepositoriesResponse, OperationMetadata> + batchCreateRepositoriesOperationCallable() { + return stub.batchCreateRepositoriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates multiple repositories inside a connection. + * + *()) + * .build(); + * OperationFuture future = + * repositoryManagerClient.batchCreateRepositoriesOperationCallable().futureCall(request); + * // Do something. + * BatchCreateRepositoriesResponse response = future.get(); + * } + * }
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+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = + * repositoryManagerClient.batchCreateRepositoriesCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.getRepositoryCallable().futureCall(request); + * // Do something. + * Repository response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.listRepositoriesPagedCallable().futureCall(request); + * // Do something. + * for (Repository element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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
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
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
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+ */ + public final OperationCallablefuture = + * repositoryManagerClient.deleteRepositoryOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.deleteRepositoryCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.fetchReadWriteTokenCallable().futureCall(request); + * // Do something. + * FetchReadWriteTokenResponse response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * repositoryManagerClient.fetchReadTokenCallable().futureCall(request); + * // Do something. + * FetchReadTokenResponse response = future.get(); + * } + * }
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+ */ + 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. + * + *future = + * repositoryManagerClient.fetchLinkableRepositoriesPagedCallable().futureCall(request); + * // Do something. + * for (Repository element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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+ */ + public final UnaryCallablefuture = repositoryManagerClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = repositoryManagerClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
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+ * + * @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. + * + *()) + * .build(); + * TestIamPermissionsResponse response = repositoryManagerClient.testIamPermissions(request); + * } + * }
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+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = + * repositoryManagerClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
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
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= RepositoryManagerClient =======================
+ *
+ * Service Description: Manages connections to source code repostiories.
+ *
+ * Sample for RepositoryManagerClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcRepositoryManagerCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public 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{@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.
+ *
+ *