-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[draft][4/5]Implement LRO unary rpc method's sample code #514
Changes from all commits
de732d4
e5df14b
81d71db
e214824
b9f8024
85b6f27
2ae0cce
e390c07
cc843c6
aa87b09
d164c52
f997138
e5e6014
260d668
6306d16
5b7a57c
0a5b153
4b74392
cacf7d0
afc5a36
9abb259
4d9e3d7
790cf67
5d53029
3a9e88c
a3f5f22
bb14577
d21b247
34877cf
06fe431
8c42a62
720aba1
3fbdd1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,7 +414,11 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() { | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); | ||
* String instance_id = "instance_id-2101995259"; | ||
* Instance instance = Instance.newBuilder().build(); | ||
* Operation response = | ||
* cloudRedisClient.createInstanceAsync(parent, instance_id, instance).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -463,7 +467,11 @@ public final OperationFuture<Instance, OperationMetadata> createInstanceAsync( | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* String parent = "parent-995424086"; | ||
* String instance_id = "instance_id-2101995259"; | ||
* Instance instance = Instance.newBuilder().build(); | ||
* Operation response = | ||
* cloudRedisClient.createInstanceAsync(parent, instance_id, instance).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -579,7 +587,9 @@ public final UnaryCallable<CreateInstanceRequest, Operation> createInstanceCalla | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* FieldMask update_mask = FieldMask.newBuilder().build(); | ||
* Instance instance = Instance.newBuilder().build(); | ||
* Operation response = cloudRedisClient.updateInstanceAsync(update_mask, instance).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -658,7 +668,9 @@ public final UnaryCallable<UpdateInstanceRequest, Operation> updateInstanceCalla | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); | ||
* String redis_version = "redis_version-685310444"; | ||
* Operation response = cloudRedisClient.upgradeInstanceAsync(name, redis_version).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -686,7 +698,9 @@ public final OperationFuture<Instance, OperationMetadata> upgradeInstanceAsync( | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* String name = "name3373707"; | ||
* String redis_version = "redis_version-685310444"; | ||
* Operation response = cloudRedisClient.upgradeInstanceAsync(name, redis_version).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -758,7 +772,9 @@ public final UnaryCallable<UpgradeInstanceRequest, Operation> upgradeInstanceCal | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* String name = "name3373707"; | ||
* InputConfig input_config = InputConfig.newBuilder().build(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's stick with the lowerCamelCase Java conventions. |
||
* Operation response = cloudRedisClient.importInstanceAsync(name, input_config).get(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we please look for applicable examples where the proto would return empty, and handle those as well? |
||
* } | ||
* }</pre> | ||
* | ||
|
@@ -847,7 +863,9 @@ public final UnaryCallable<ImportInstanceRequest, Operation> importInstanceCalla | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* String name = "name3373707"; | ||
* OutputConfig output_config = OutputConfig.newBuilder().build(); | ||
* Operation response = cloudRedisClient.exportInstanceAsync(name, output_config).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -929,7 +947,10 @@ public final UnaryCallable<ExportInstanceRequest, Operation> exportInstanceCalla | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); | ||
* FailoverInstanceRequest.DataProtectionMode data_protection_mode = | ||
* FailoverInstanceRequest.DataProtectionMode.forNumber(0); | ||
* Operation response = cloudRedisClient.failoverInstanceAsync(name, data_protection_mode).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -959,7 +980,10 @@ public final OperationFuture<Instance, OperationMetadata> failoverInstanceAsync( | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* String name = "name3373707"; | ||
* FailoverInstanceRequest.DataProtectionMode data_protection_mode = | ||
* FailoverInstanceRequest.DataProtectionMode.forNumber(0); | ||
* Operation response = cloudRedisClient.failoverInstanceAsync(name, data_protection_mode).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -1032,7 +1056,8 @@ public final UnaryCallable<FailoverInstanceRequest, Operation> failoverInstanceC | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); | ||
* Operation response = cloudRedisClient.deleteInstanceAsync(name).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
@@ -1057,7 +1082,8 @@ public final OperationFuture<Empty, OperationMetadata> deleteInstanceAsync(Insta | |
* | ||
* <pre>{@code | ||
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { | ||
* // Note: Not implemented yet, placeholder for lro Unary rpc method sample code. | ||
* String name = "name3373707"; | ||
* Operation response = cloudRedisClient.deleteInstanceAsync(name).get(); | ||
* } | ||
* }</pre> | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: fix consider method.outputType is VOID