Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add support for AUTH functionality
feat: add support for TLS functionality
feat: add secondary_ip_range field

PiperOrigin-RevId: 434816216

Source-Link: googleapis/googleapis@7cef847

Source-Link: https://github.com/googleapis/googleapis-gen/commit/b4cef4cabbed83b194cdc07ad847e97fdb233b3c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjRjZWY0Y2FiYmVkODNiMTk0Y2RjMDdhZDg0N2U5N2ZkYjIzM2IzYyJ9
  • Loading branch information
gcf-owl-bot[bot] committed Mar 15, 2022
commit a41351a383852a5a1237d5bca72928110e46bb1d
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
* defines the following resource model for managing Redis instances:
*
* <ul>
* <li>The service works with a collection of cloud projects, named: `/projects/&#42;`
* <li>Each project has a collection of available locations, named: `/locations/&#42;`
* <li>Each location has a collection of Redis instances, named: `/instances/&#42;`
* <li>As such, Redis instances are resources of the form:
* <li> The service works with a collection of cloud projects, named: `/projects/&#42;`
* <li> Each project has a collection of available locations, named: `/locations/&#42;`
* <li> Each location has a collection of Redis instances, named: `/instances/&#42;`
* <li> As such, Redis instances are resources of the form:
* `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
* </ul>
*
* <p>Note that location_id must be referring to a GCP `region`; for example:
*
* <ul>
* <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis`
* <li> `projects/redpepper-1290/locations/us-central1/instances/my-redis`
* </ul>
*
* <p>This class provides the ability to make remote calls to the backing service through method
Expand All @@ -79,13 +79,13 @@
* methods:
*
* <ol>
* <li>A "flattened" method. With this type of method, the fields of the request type have been
* <li> A "flattened" method. With this type of method, the fields of the request type have been
* converted into function parameters. It may be the case that not all fields are available as
* parameters, and not every API method will have a flattened method entry point.
* <li>A "request object" method. This type of method only takes one parameter, a request object,
* <li> A "request object" method. This type of method only takes one parameter, a request object,
* which must be constructed before the call. Not every API method will have a request object
* method.
* <li>A "callable" method. This type of method takes no parameters and returns an immutable API
* <li> A "callable" method. This type of method takes no parameters and returns an immutable API
* callable object, which can be used to initiate calls to the service.
* </ol>
*
Expand Down Expand Up @@ -188,7 +188,7 @@ public final OperationsClient getOperationsClient() {
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li> `projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand Down Expand Up @@ -225,7 +225,7 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) {
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li> `projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand Down Expand Up @@ -259,7 +259,7 @@ public final ListInstancesPagedResponse listInstances(String parent) {
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li> `projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand Down Expand Up @@ -296,7 +296,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li> `projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand Down Expand Up @@ -334,7 +334,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li> `projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand Down Expand Up @@ -461,6 +461,107 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
return stub.getInstanceCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
* will be empty. This information is not included in the details returned to GetInstance.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
* }
* }</pre>
*
* @param name Required. Redis instance resource name using the form:
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
* refers to a GCP region.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final InstanceAuthString getInstanceAuthString(InstanceName name) {
GetInstanceAuthStringRequest request =
GetInstanceAuthStringRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return getInstanceAuthString(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
* will be empty. This information is not included in the details returned to GetInstance.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
* InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
* }
* }</pre>
*
* @param name Required. Redis instance resource name using the form:
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
* refers to a GCP region.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final InstanceAuthString getInstanceAuthString(String name) {
GetInstanceAuthStringRequest request =
GetInstanceAuthStringRequest.newBuilder().setName(name).build();
return getInstanceAuthString(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
* will be empty. This information is not included in the details returned to GetInstance.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* GetInstanceAuthStringRequest request =
* GetInstanceAuthStringRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .build();
* InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request);
* }
* }</pre>
*
* @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 InstanceAuthString getInstanceAuthString(GetInstanceAuthStringRequest request) {
return getInstanceAuthStringCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
* will be empty. This information is not included in the details returned to GetInstance.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* GetInstanceAuthStringRequest request =
* GetInstanceAuthStringRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .build();
* ApiFuture<InstanceAuthString> future =
* cloudRedisClient.getInstanceAuthStringCallable().futureCall(request);
* // Do something.
* InstanceAuthString response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<GetInstanceAuthStringRequest, InstanceAuthString>
getInstanceAuthStringCallable() {
return stub.getInstanceAuthStringCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a Redis instance based on the specified tier and memory size.
Expand Down Expand Up @@ -492,11 +593,11 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
* @param instanceId Required. The logical name of the Redis instance in the customer project with
* the following restrictions:
* <ul>
* <li>Must contain only lowercase letters, numbers, and hyphens.
* <li>Must start with a letter.
* <li>Must be between 1-40 characters.
* <li>Must end with a number or a letter.
* <li>Must be unique within the customer project / location
* <li> Must contain only lowercase letters, numbers, and hyphens.
* <li> Must start with a letter.
* <li> Must be between 1-40 characters.
* <li> Must end with a number or a letter.
* <li> Must be unique within the customer project / location
* </ul>
*
* @param instance Required. A Redis [Instance] resource
Expand Down Expand Up @@ -544,11 +645,11 @@ public final OperationFuture<Instance, OperationMetadata> createInstanceAsync(
* @param instanceId Required. The logical name of the Redis instance in the customer project with
* the following restrictions:
* <ul>
* <li>Must contain only lowercase letters, numbers, and hyphens.
* <li>Must start with a letter.
* <li>Must be between 1-40 characters.
* <li>Must end with a number or a letter.
* <li>Must be unique within the customer project / location
* <li> Must contain only lowercase letters, numbers, and hyphens.
* <li> Must start with a letter.
* <li> Must be between 1-40 characters.
* <li> Must end with a number or a letter.
* <li> Must be unique within the customer project / location
* </ul>
*
* @param instance Required. A Redis [Instance] resource
Expand Down Expand Up @@ -1454,10 +1555,7 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted

public static class ListInstancesPagedResponse
extends AbstractPagedListResponse<
ListInstancesRequest,
ListInstancesResponse,
Instance,
ListInstancesPage,
ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage,
ListInstancesFixedSizeCollection> {

public static ApiFuture<ListInstancesPagedResponse> createAsync(
Expand Down Expand Up @@ -1507,10 +1605,7 @@ public ApiFuture<ListInstancesPage> createPageAsync(

public static class ListInstancesFixedSizeCollection
extends AbstractFixedSizeCollection<
ListInstancesRequest,
ListInstancesResponse,
Instance,
ListInstancesPage,
ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage,
ListInstancesFixedSizeCollection> {

private ListInstancesFixedSizeCollection(List<ListInstancesPage> pages, int collectionSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.redis.v1.stub.CloudRedisStubSettings;
Expand All @@ -44,9 +45,9 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (redis.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* <li> The default service address (redis.googleapis.com) and default port (443) are used.
* <li> Credentials are acquired automatically through Application Default Credentials.
* <li> Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
*
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
Expand Down Expand Up @@ -82,6 +83,12 @@ public UnaryCallSettings<GetInstanceRequest, Instance> getInstanceSettings() {
return ((CloudRedisStubSettings) getStubSettings()).getInstanceSettings();
}

/** Returns the object with the settings used for calls to getInstanceAuthString. */
public UnaryCallSettings<GetInstanceAuthStringRequest, InstanceAuthString>
getInstanceAuthStringSettings() {
return ((CloudRedisStubSettings) getStubSettings()).getInstanceAuthStringSettings();
}

/** Returns the object with the settings used for calls to createInstance. */
public UnaryCallSettings<CreateInstanceRequest, Operation> createInstanceSettings() {
return ((CloudRedisStubSettings) getStubSettings()).createInstanceSettings();
Expand Down Expand Up @@ -267,6 +274,12 @@ public UnaryCallSettings.Builder<GetInstanceRequest, Instance> getInstanceSettin
return getStubSettingsBuilder().getInstanceSettings();
}

/** Returns the builder for the settings used for calls to getInstanceAuthString. */
public UnaryCallSettings.Builder<GetInstanceAuthStringRequest, InstanceAuthString>
getInstanceAuthStringSettings() {
return getStubSettingsBuilder().getInstanceAuthStringSettings();
}

/** Returns the builder for the settings used for calls to createInstance. */
public UnaryCallSettings.Builder<CreateInstanceRequest, Operation> createInstanceSettings() {
return getStubSettingsBuilder().createInstanceSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"GetInstance": {
"methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"]
},
"GetInstanceAuthString": {
"methods": ["getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthStringCallable"]
},
"ImportInstance": {
"methods": ["importInstanceAsync", "importInstanceAsync", "importInstanceOperationCallable", "importInstanceCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
* defines the following resource model for managing Redis instances:
*
* <ul>
* <li>The service works with a collection of cloud projects, named: `/projects/&#42;`
* <li>Each project has a collection of available locations, named: `/locations/&#42;`
* <li>Each location has a collection of Redis instances, named: `/instances/&#42;`
* <li>As such, Redis instances are resources of the form:
* <li> The service works with a collection of cloud projects, named: `/projects/&#42;`
* <li> Each project has a collection of available locations, named: `/locations/&#42;`
* <li> Each location has a collection of Redis instances, named: `/instances/&#42;`
* <li> As such, Redis instances are resources of the form:
* `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
* </ul>
*
* <p>Note that location_id must be referring to a GCP `region`; for example:
*
* <ul>
* <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis`
* <li> `projects/redpepper-1290/locations/us-central1/instances/my-redis`
* </ul>
*
* <p>Sample for CloudRedisClient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
import com.google.cloud.redis.v1.DeleteInstanceRequest;
import com.google.cloud.redis.v1.ExportInstanceRequest;
import com.google.cloud.redis.v1.FailoverInstanceRequest;
import com.google.cloud.redis.v1.GetInstanceAuthStringRequest;
import com.google.cloud.redis.v1.GetInstanceRequest;
import com.google.cloud.redis.v1.ImportInstanceRequest;
import com.google.cloud.redis.v1.Instance;
import com.google.cloud.redis.v1.InstanceAuthString;
import com.google.cloud.redis.v1.ListInstancesRequest;
import com.google.cloud.redis.v1.ListInstancesResponse;
import com.google.cloud.redis.v1.OperationMetadata;
Expand Down Expand Up @@ -64,6 +66,11 @@ public UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
throw new UnsupportedOperationException("Not implemented: getInstanceCallable()");
}

public UnaryCallable<GetInstanceAuthStringRequest, InstanceAuthString>
getInstanceAuthStringCallable() {
throw new UnsupportedOperationException("Not implemented: getInstanceAuthStringCallable()");
}

public OperationCallable<CreateInstanceRequest, Instance, OperationMetadata>
createInstanceOperationCallable() {
throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()");
Expand Down
Loading