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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * Server response = cloudFtpClient.getServer(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the CloudFtpClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
| Method | + *Description | + *Method Variants | + *
|---|---|---|
ListServers |
+ * Lists Servers in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetServer |
+ * Gets details of a single Server. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateServer |
+ * Creates a new Server in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateServer |
+ * Updates the parameters of a single Server. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteServer |
+ * Deletes a single Server. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListUsers |
+ * Lists Users in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetUser |
+ * Gets details of a single User. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateUser |
+ * Creates a new User in a given project and location and Server. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateUser |
+ * Updates the parameters of a single User. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteUser |
+ * Deletes a single User. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
StartServer |
+ * Starts a stopping/stopped Server. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
StopServer |
+ * Stops an active Server. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListLocations |
+ * Lists information about the supported locations for this service. + * This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: ***Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. + * For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetLocation |
+ * Gets information about a location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return 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 CloudFtpSettings 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
+ * CloudFtpSettings cloudFtpSettings =
+ * CloudFtpSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * CloudFtpClient cloudFtpClient = CloudFtpClient.create(cloudFtpSettings);
+ * }
+ *
+ * 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
+ * CloudFtpSettings cloudFtpSettings =
+ * CloudFtpSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudFtpClient cloudFtpClient = CloudFtpClient.create(cloudFtpSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@Generated("by gapic-generator-java") +public class CloudFtpClient implements BackgroundResource { + private final @Nullable CloudFtpSettings settings; + private final CloudFtpStub stub; + private final OperationsClient httpJsonOperationsClient; + + /** Constructs an instance of CloudFtpClient with default settings. */ + public static final CloudFtpClient create() throws IOException { + return create(CloudFtpSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudFtpClient, 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 CloudFtpClient create(CloudFtpSettings settings) throws IOException { + return new CloudFtpClient(settings); + } + + /** + * Constructs an instance of CloudFtpClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(CloudFtpSettings). + */ + public static final CloudFtpClient create(CloudFtpStub stub) { + return new CloudFtpClient(stub); + } + + /** + * Constructs an instance of CloudFtpClient, 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 CloudFtpClient(CloudFtpSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudFtpStubSettings) settings.getStubSettings()).createStub(); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected CloudFtpClient(CloudFtpStub stub) { + this.settings = null; + this.stub = stub; + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final @Nullable CloudFtpSettings getSettings() { + return settings; + } + + public CloudFtpStub 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 OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Servers 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Server element : cloudFtpClient.listServers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListServersRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListServersPagedResponse listServers(@Nullable LocationName parent) {
+ ListServersRequest request =
+ ListServersRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listServers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Servers 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Server element : cloudFtpClient.listServers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListServersRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListServersPagedResponse listServers(String parent) {
+ ListServersRequest request = ListServersRequest.newBuilder().setParent(parent).build();
+ return listServers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Servers 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListServersRequest request =
+ * ListServersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setView(ServerView.forNumber(0))
+ * .build();
+ * for (Server element : cloudFtpClient.listServers(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 ListServersPagedResponse listServers(ListServersRequest request) {
+ return listServersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Servers 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListServersRequest request =
+ * ListServersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setView(ServerView.forNumber(0))
+ * .build();
+ * ApiFuture future = cloudFtpClient.listServersPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Server element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListServersRequest request =
+ * ListServersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setView(ServerView.forNumber(0))
+ * .build();
+ * while (true) {
+ * ListServersResponse response = cloudFtpClient.listServersCallable().call(request);
+ * for (Server element : response.getServersList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * Server response = cloudFtpClient.getServer(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Server getServer(@Nullable ServerName name) {
+ GetServerRequest request =
+ GetServerRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getServer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single Server.
+ *
+ * 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
+ * Server response = cloudFtpClient.getServer(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Server getServer(String name) {
+ GetServerRequest request = GetServerRequest.newBuilder().setName(name).build();
+ return getServer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single Server.
+ *
+ * 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * GetServerRequest request =
+ * GetServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setView(ServerView.forNumber(0))
+ * .build();
+ * Server response = cloudFtpClient.getServer(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 Server getServer(GetServerRequest request) {
+ return getServerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single Server.
+ *
+ * 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * GetServerRequest request =
+ * GetServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setView(ServerView.forNumber(0))
+ * .build();
+ * ApiFuture future = cloudFtpClient.getServerCallable().futureCall(request);
+ * // Do something.
+ * Server response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Server server = Server.newBuilder().build();
+ * String serverId = "serverId1379103678";
+ * Server response = cloudFtpClient.createServerAsync(parent, server, serverId).get();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param server Required. The resource being created
+ * @param serverId Required. A unique ID for the server. Must start with a lowercase letter, and
+ * end with a lowercase letter or number. Can contain lowercase letters, numbers, and hyphens.
+ * Maximum length is 30 characters.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Server server = Server.newBuilder().build();
+ * String serverId = "serverId1379103678";
+ * Server response = cloudFtpClient.createServerAsync(parent, server, serverId).get();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param server Required. The resource being created
+ * @param serverId Required. A unique ID for the server. Must start with a lowercase letter, and
+ * end with a lowercase letter or number. Can contain lowercase letters, numbers, and hyphens.
+ * Maximum length is 30 characters.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * CreateServerRequest request =
+ * CreateServerRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setServerId("serverId1379103678")
+ * .setServer(Server.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Server response = cloudFtpClient.createServerAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * CreateServerRequest request =
+ * CreateServerRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setServerId("serverId1379103678")
+ * .setServer(Server.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.createServerOperationCallable().futureCall(request);
+ * // Do something.
+ * Server response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * CreateServerRequest request =
+ * CreateServerRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setServerId("serverId1379103678")
+ * .setServer(Server.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future = cloudFtpClient.createServerCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * Server server = Server.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Server response = cloudFtpClient.updateServerAsync(server, updateMask).get();
+ * }
+ * }
+ *
+ * @param server Required. The resource being updated
+ * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the
+ * Server resource by the update. The fields specified in the update_mask are relative to the
+ * resource, not the full request. A field will be overwritten if it is in the mask. If the
+ * user does not provide a mask then all fields present in the request will be overwritten.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UpdateServerRequest request =
+ * UpdateServerRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setServer(Server.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Server response = cloudFtpClient.updateServerAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UpdateServerRequest request =
+ * UpdateServerRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setServer(Server.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.updateServerOperationCallable().futureCall(request);
+ * // Do something.
+ * Server response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UpdateServerRequest request =
+ * UpdateServerRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setServer(Server.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future = cloudFtpClient.updateServerCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * cloudFtpClient.deleteServerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
+ * cloudFtpClient.deleteServerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * DeleteServerRequest request =
+ * DeleteServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * cloudFtpClient.deleteServerAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * DeleteServerRequest request =
+ * DeleteServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.deleteServerOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * DeleteServerRequest request =
+ * DeleteServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * ApiFuture future = cloudFtpClient.deleteServerCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * for (User element : cloudFtpClient.listUsers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListUsersRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListUsersPagedResponse listUsers(@Nullable ServerName parent) {
+ ListUsersRequest request =
+ ListUsersRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listUsers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Users 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
+ * for (User element : cloudFtpClient.listUsers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListUsersRequest
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListUsersPagedResponse listUsers(String parent) {
+ ListUsersRequest request = ListUsersRequest.newBuilder().setParent(parent).build();
+ return listUsers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Users 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListUsersRequest request =
+ * ListUsersRequest.newBuilder()
+ * .setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setView(UserView.forNumber(0))
+ * .build();
+ * for (User element : cloudFtpClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) {
+ return listUsersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Users 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListUsersRequest request =
+ * ListUsersRequest.newBuilder()
+ * .setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setView(UserView.forNumber(0))
+ * .build();
+ * ApiFuture future = cloudFtpClient.listUsersPagedCallable().futureCall(request);
+ * // Do something.
+ * for (User element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListUsersRequest request =
+ * ListUsersRequest.newBuilder()
+ * .setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setView(UserView.forNumber(0))
+ * .build();
+ * while (true) {
+ * ListUsersResponse response = cloudFtpClient.listUsersCallable().call(request);
+ * for (User element : response.getUsersList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]");
+ * User response = cloudFtpClient.getUser(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final User getUser(@Nullable UserName name) {
+ GetUserRequest request =
+ GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getUser(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single User.
+ *
+ * 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString();
+ * User response = cloudFtpClient.getUser(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final User getUser(String name) {
+ GetUserRequest request = GetUserRequest.newBuilder().setName(name).build();
+ return getUser(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single User.
+ *
+ * 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * GetUserRequest request =
+ * GetUserRequest.newBuilder()
+ * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
+ * .setView(UserView.forNumber(0))
+ * .build();
+ * User response = cloudFtpClient.getUser(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 User getUser(GetUserRequest request) {
+ return getUserCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single User.
+ *
+ * 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * GetUserRequest request =
+ * GetUserRequest.newBuilder()
+ * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
+ * .setView(UserView.forNumber(0))
+ * .build();
+ * ApiFuture future = cloudFtpClient.getUserCallable().futureCall(request);
+ * // Do something.
+ * User response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * User user = User.newBuilder().build();
+ * String userId = "userId-836030906";
+ * User response = cloudFtpClient.createUserAsync(parent, user, userId).get();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param user Required. The resource being created
+ * @param userId Required. A unique user ID for the SFTP user. The user ID must start with a
+ * lowercase letter and can include lowercase letters, numbers, or hyphens.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String parent = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
+ * User user = User.newBuilder().build();
+ * String userId = "userId-836030906";
+ * User response = cloudFtpClient.createUserAsync(parent, user, userId).get();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param user Required. The resource being created
+ * @param userId Required. A unique user ID for the SFTP user. The user ID must start with a
+ * lowercase letter and can include lowercase letters, numbers, or hyphens.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * CreateUserRequest request =
+ * CreateUserRequest.newBuilder()
+ * .setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setUserId("userId-836030906")
+ * .setUser(User.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * User response = cloudFtpClient.createUserAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * CreateUserRequest request =
+ * CreateUserRequest.newBuilder()
+ * .setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setUserId("userId-836030906")
+ * .setUser(User.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.createUserOperationCallable().futureCall(request);
+ * // Do something.
+ * User response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * CreateUserRequest request =
+ * CreateUserRequest.newBuilder()
+ * .setParent(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .setUserId("userId-836030906")
+ * .setUser(User.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future = cloudFtpClient.createUserCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * User user = User.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * User response = cloudFtpClient.updateUserAsync(user, updateMask).get();
+ * }
+ * }
+ *
+ * @param user Required. The resource being updated
+ * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the
+ * User resource by the update. The fields specified in the update_mask are relative to the
+ * resource, not the full request. A field will be overwritten if it is in the mask. If the
+ * user does not provide a mask then all fields present in the request will be overwritten.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UpdateUserRequest request =
+ * UpdateUserRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setUser(User.newBuilder().build())
+ * .build();
+ * User response = cloudFtpClient.updateUserAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UpdateUserRequest request =
+ * UpdateUserRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setUser(User.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.updateUserOperationCallable().futureCall(request);
+ * // Do something.
+ * User response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UpdateUserRequest request =
+ * UpdateUserRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setUser(User.newBuilder().build())
+ * .build();
+ * ApiFuture future = cloudFtpClient.updateUserCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]");
+ * cloudFtpClient.deleteUserAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String name = UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString();
+ * cloudFtpClient.deleteUserAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * DeleteUserRequest request =
+ * DeleteUserRequest.newBuilder()
+ * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
+ * .setForce(true)
+ * .build();
+ * cloudFtpClient.deleteUserAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * DeleteUserRequest request =
+ * DeleteUserRequest.newBuilder()
+ * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
+ * .setForce(true)
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.deleteUserOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * DeleteUserRequest request =
+ * DeleteUserRequest.newBuilder()
+ * .setName(UserName.of("[PROJECT]", "[LOCATION]", "[SERVER]", "[USER]").toString())
+ * .setForce(true)
+ * .build();
+ * ApiFuture future = cloudFtpClient.deleteUserCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * Server response = cloudFtpClient.startServerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource Format:
+ * `projects/{project}/locations/{location}/servers/{server}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
+ * Server response = cloudFtpClient.startServerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource Format:
+ * `projects/{project}/locations/{location}/servers/{server}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * StartServerRequest request =
+ * StartServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * Server response = cloudFtpClient.startServerAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * StartServerRequest request =
+ * StartServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.startServerOperationCallable().futureCall(request);
+ * // Do something.
+ * Server response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * StartServerRequest request =
+ * StartServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * ApiFuture future = cloudFtpClient.startServerCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * Server response = cloudFtpClient.stopServerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource. Format:
+ * `projects/{project}/locations/{location}/servers/{server}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * String name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString();
+ * Server response = cloudFtpClient.stopServerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource. Format:
+ * `projects/{project}/locations/{location}/servers/{server}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * StopServerRequest request =
+ * StopServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * Server response = cloudFtpClient.stopServerAsync(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 OperationFutureSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * StopServerRequest request =
+ * StopServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * OperationFuture future =
+ * cloudFtpClient.stopServerOperationCallable().futureCall(request);
+ * // Do something.
+ * Server response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * StopServerRequest request =
+ * StopServerRequest.newBuilder()
+ * .setName(ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]").toString())
+ * .build();
+ * ApiFuture future = cloudFtpClient.stopServerCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThis method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *
For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and version. + * + *
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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : cloudFtpClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * This method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *
For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and version. + * + *
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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future = cloudFtpClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableThis method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *
For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and version. + * + *
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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = cloudFtpClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = cloudFtpClient.getLocation(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 Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a 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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = cloudFtpClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThe 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getServer: + * + *
{@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
+ * CloudFtpSettings.Builder cloudFtpSettingsBuilder = CloudFtpSettings.newBuilder();
+ * cloudFtpSettingsBuilder
+ * .getServerSettings()
+ * .setRetrySettings(
+ * cloudFtpSettingsBuilder
+ * .getServerSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * CloudFtpSettings cloudFtpSettings = cloudFtpSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createServer: + * + *
{@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
+ * CloudFtpSettings.Builder cloudFtpSettingsBuilder = CloudFtpSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * cloudFtpSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@NullMarked
+@Generated("by gapic-generator-java")
+public class CloudFtpSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= CloudFtpClient =======================
+ *
+ * Service Description: Service describing handlers for resources
+ *
+ * Sample for CloudFtpClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@NullMarked
+@Generated("by gapic-generator-java")
+public abstract class CloudFtpStub implements BackgroundResource {
+
+ public @Nullable OperationsStub getHttpJsonOperationsStub() {
+ throw new UnsupportedOperationException("Not implemented: getHttpJsonOperationsStub()");
+ }
+
+ public UnaryCallable 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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getServer:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createServer:
+ *
+ * {@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 (CloudFtpClient cloudFtpClient = CloudFtpClient.create()) {
+ * ServerName name = ServerName.of("[PROJECT]", "[LOCATION]", "[SERVER]");
+ * Server response = cloudFtpClient.getServer(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.ftp.v1;
+
+import javax.annotation.Generated;
diff --git a/java-ftp/google-cloud-ftp/src/main/java/com/google/cloud/ftp/v1/stub/CloudFtpStub.java b/java-ftp/google-cloud-ftp/src/main/java/com/google/cloud/ftp/v1/stub/CloudFtpStub.java
new file mode 100644
index 000000000000..5ef2de9c85e0
--- /dev/null
+++ b/java-ftp/google-cloud-ftp/src/main/java/com/google/cloud/ftp/v1/stub/CloudFtpStub.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.ftp.v1.stub;
+
+import static com.google.cloud.ftp.v1.CloudFtpClient.ListLocationsPagedResponse;
+import static com.google.cloud.ftp.v1.CloudFtpClient.ListServersPagedResponse;
+import static com.google.cloud.ftp.v1.CloudFtpClient.ListUsersPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.ftp.v1.CreateServerRequest;
+import com.google.cloud.ftp.v1.CreateUserRequest;
+import com.google.cloud.ftp.v1.DeleteServerRequest;
+import com.google.cloud.ftp.v1.DeleteUserRequest;
+import com.google.cloud.ftp.v1.GetServerRequest;
+import com.google.cloud.ftp.v1.GetUserRequest;
+import com.google.cloud.ftp.v1.ListServersRequest;
+import com.google.cloud.ftp.v1.ListServersResponse;
+import com.google.cloud.ftp.v1.ListUsersRequest;
+import com.google.cloud.ftp.v1.ListUsersResponse;
+import com.google.cloud.ftp.v1.OperationMetadata;
+import com.google.cloud.ftp.v1.Server;
+import com.google.cloud.ftp.v1.StartServerRequest;
+import com.google.cloud.ftp.v1.StopServerRequest;
+import com.google.cloud.ftp.v1.UpdateServerRequest;
+import com.google.cloud.ftp.v1.UpdateUserRequest;
+import com.google.cloud.ftp.v1.User;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the CloudFtp service API.
+ *
+ *
+ *
+ *
+ * {@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
+ * CloudFtpStubSettings.Builder cloudFtpSettingsBuilder = CloudFtpStubSettings.newBuilder();
+ * cloudFtpSettingsBuilder
+ * .getServerSettings()
+ * .setRetrySettings(
+ * cloudFtpSettingsBuilder
+ * .getServerSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * CloudFtpStubSettings cloudFtpSettings = cloudFtpSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * {@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
+ * CloudFtpStubSettings.Builder cloudFtpSettingsBuilder = CloudFtpStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * cloudFtpSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@NullMarked
+@Generated("by gapic-generator-java")
+@SuppressWarnings("CanonicalDuration")
+public class CloudFtpStubSettings extends StubSettings