Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
fix: [Cloud Memorystore for Redis] Add missing fields for TLS and Mai…
Browse files Browse the repository at this point in the history
…ntenance Window features (#583)

* fix: [Cloud Memorystore for Redis] Add missing fields for TLS and Maintenance Window features

PiperOrigin-RevId: 421360191

Source-Link: googleapis/googleapis@3e958c3

Source-Link: googleapis/googleapis-gen@f6580f0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjY1ODBmMDIzNDNkOGFkYjQ5YzE3MGY4ZTkxNjAxMTNiZmJiZDJiMyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jan 14, 2022
1 parent f1efdd1 commit 6ac4ac8
Show file tree
Hide file tree
Showing 35 changed files with 13,433 additions and 637 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.google.protobuf.Any;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import com.google.protobuf.Timestamp;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -463,6 +464,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 @@ -1418,6 +1520,159 @@ public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCalla
return stub.deleteInstanceCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* RescheduleMaintenanceRequest.RescheduleType rescheduleType =
* RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
* Timestamp scheduleTime = Timestamp.newBuilder().build();
* Instance response =
* cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
* }
* }</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.
* @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time
* as well.
* @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if
* reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Instance, Any> rescheduleMaintenanceAsync(
InstanceName name,
RescheduleMaintenanceRequest.RescheduleType rescheduleType,
Timestamp scheduleTime) {
RescheduleMaintenanceRequest request =
RescheduleMaintenanceRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setRescheduleType(rescheduleType)
.setScheduleTime(scheduleTime)
.build();
return rescheduleMaintenanceAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
* RescheduleMaintenanceRequest.RescheduleType rescheduleType =
* RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
* Timestamp scheduleTime = Timestamp.newBuilder().build();
* Instance response =
* cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
* }
* }</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.
* @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time
* as well.
* @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if
* reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Instance, Any> rescheduleMaintenanceAsync(
String name,
RescheduleMaintenanceRequest.RescheduleType rescheduleType,
Timestamp scheduleTime) {
RescheduleMaintenanceRequest request =
RescheduleMaintenanceRequest.newBuilder()
.setName(name)
.setRescheduleType(rescheduleType)
.setScheduleTime(scheduleTime)
.build();
return rescheduleMaintenanceAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* RescheduleMaintenanceRequest request =
* RescheduleMaintenanceRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .setScheduleTime(Timestamp.newBuilder().build())
* .build();
* Instance response = cloudRedisClient.rescheduleMaintenanceAsync(request).get();
* }
* }</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 OperationFuture<Instance, Any> rescheduleMaintenanceAsync(
RescheduleMaintenanceRequest request) {
return rescheduleMaintenanceOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* RescheduleMaintenanceRequest request =
* RescheduleMaintenanceRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .setScheduleTime(Timestamp.newBuilder().build())
* .build();
* OperationFuture<Instance, Any> future =
* cloudRedisClient.rescheduleMaintenanceOperationCallable().futureCall(request);
* // Do something.
* Instance response = future.get();
* }
* }</pre>
*/
public final OperationCallable<RescheduleMaintenanceRequest, Instance, Any>
rescheduleMaintenanceOperationCallable() {
return stub.rescheduleMaintenanceOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* RescheduleMaintenanceRequest request =
* RescheduleMaintenanceRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .setScheduleTime(Timestamp.newBuilder().build())
* .build();
* ApiFuture<Operation> future =
* cloudRedisClient.rescheduleMaintenanceCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RescheduleMaintenanceRequest, Operation>
rescheduleMaintenanceCallable() {
return stub.rescheduleMaintenanceCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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 @@ -161,6 +167,18 @@ public UnaryCallSettings<DeleteInstanceRequest, Operation> deleteInstanceSetting
return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings();
}

/** Returns the object with the settings used for calls to rescheduleMaintenance. */
public UnaryCallSettings<RescheduleMaintenanceRequest, Operation>
rescheduleMaintenanceSettings() {
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceSettings();
}

/** Returns the object with the settings used for calls to rescheduleMaintenance. */
public OperationCallSettings<RescheduleMaintenanceRequest, Instance, Any>
rescheduleMaintenanceOperationSettings() {
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceOperationSettings();
}

public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException {
return new CloudRedisSettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -269,6 +287,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 Expand Up @@ -347,6 +371,18 @@ public UnaryCallSettings.Builder<DeleteInstanceRequest, Operation> deleteInstanc
return getStubSettingsBuilder().deleteInstanceOperationSettings();
}

/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
public UnaryCallSettings.Builder<RescheduleMaintenanceRequest, Operation>
rescheduleMaintenanceSettings() {
return getStubSettingsBuilder().rescheduleMaintenanceSettings();
}

/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
public OperationCallSettings.Builder<RescheduleMaintenanceRequest, Instance, Any>
rescheduleMaintenanceOperationSettings() {
return getStubSettingsBuilder().rescheduleMaintenanceOperationSettings();
}

@Override
public CloudRedisSettings build() throws IOException {
return new CloudRedisSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@
"GetInstance": {
"methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"]
},
"GetInstanceAuthString": {
"methods": ["getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthStringCallable"]
},
"ImportInstance": {
"methods": ["importInstanceAsync", "importInstanceAsync", "importInstanceOperationCallable", "importInstanceCallable"]
},
"ListInstances": {
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"]
},
"RescheduleMaintenance": {
"methods": ["rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceOperationCallable", "rescheduleMaintenanceCallable"]
},
"UpdateInstance": {
"methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"]
},
Expand Down
Loading

0 comments on commit 6ac4ac8

Please sign in to comment.