Skip to content
Permalink
Browse files
fix: fix LRO annotations for method DiagnoseCluster. (#250)
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/fa501585-95fa-4c4d-9062-c23b3406d7ec/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 321255718
Source-Link: googleapis/googleapis@0e7900e
  • Loading branch information
yoshi-automation committed Jul 28, 2020
1 parent b2cb7c6 commit 50f0ad0e3f3184d227927c172a1055bbaa8bdcb0
@@ -607,7 +607,7 @@ public final UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallabl
* String projectId = "";
* String region = "";
* String clusterName = "";
* clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
* DiagnoseClusterResults response = clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
* }
* </code></pre>
*
@@ -619,8 +619,8 @@ public final UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallabl
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync(
String projectId, String region, String clusterName) {
public final OperationFuture<DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterAsync(String projectId, String region, String clusterName) {
DiagnoseClusterRequest request =
DiagnoseClusterRequest.newBuilder()
.setProjectId(projectId)
@@ -651,7 +651,7 @@ public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync
* .setRegion(region)
* .setClusterName(clusterName)
* .build();
* clusterControllerClient.diagnoseClusterAsync(request).get();
* DiagnoseClusterResults response = clusterControllerClient.diagnoseClusterAsync(request).get();
* }
* </code></pre>
*
@@ -660,8 +660,8 @@ public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync(
DiagnoseClusterRequest request) {
public final OperationFuture<DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterAsync(DiagnoseClusterRequest request) {
return diagnoseClusterOperationCallable().futureCall(request);
}

@@ -686,14 +686,15 @@ public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync
* .setRegion(region)
* .setClusterName(clusterName)
* .build();
* OperationFuture&lt;Empty, DiagnoseClusterResults&gt; future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
* OperationFuture&lt;DiagnoseClusterResults, ClusterOperationMetadata&gt; future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
* // Do something
* future.get();
* DiagnoseClusterResults response = future.get();
* }
* </code></pre>
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public final OperationCallable<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public final OperationCallable<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationCallable() {
return stub.diagnoseClusterOperationCallable();
}
@@ -721,7 +722,7 @@ public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync
* .build();
* ApiFuture&lt;Operation&gt; future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
* // Do something
* future.get();
* Operation response = future.get();
* }
* </code></pre>
*/
@@ -117,7 +117,8 @@ public UnaryCallSettings<DiagnoseClusterRequest, Operation> diagnoseClusterSetti
/** Returns the object with the settings used for calls to diagnoseCluster. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public OperationCallSettings<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationSettings() {
return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterOperationSettings();
}
@@ -277,7 +278,8 @@ public UnaryCallSettings.Builder<DiagnoseClusterRequest, Operation> diagnoseClus
/** Returns the builder for the settings used for calls to diagnoseCluster. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public OperationCallSettings.Builder<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationSettings() {
return getStubSettingsBuilder().diagnoseClusterOperationSettings();
}
@@ -82,7 +82,7 @@ public UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallable() {
}

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallable<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public OperationCallable<DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationCallable() {
throw new UnsupportedOperationException("Not implemented: diagnoseClusterOperationCallable()");
}
@@ -112,7 +112,8 @@ public class ClusterControllerStubSettings extends StubSettings<ClusterControlle
private final OperationCallSettings<DeleteClusterRequest, Empty, ClusterOperationMetadata>
deleteClusterOperationSettings;
private final UnaryCallSettings<DiagnoseClusterRequest, Operation> diagnoseClusterSettings;
private final OperationCallSettings<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
private final OperationCallSettings<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationSettings;
private final UnaryCallSettings<GetClusterRequest, Cluster> getClusterSettings;
private final PagedCallSettings<
@@ -162,7 +163,8 @@ public UnaryCallSettings<DiagnoseClusterRequest, Operation> diagnoseClusterSetti

/** Returns the object with the settings used for calls to diagnoseCluster. */
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallSettings<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public OperationCallSettings<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationSettings() {
return diagnoseClusterOperationSettings;
}
@@ -331,7 +333,7 @@ public static class Builder extends StubSettings.Builder<ClusterControllerStubSe
private final UnaryCallSettings.Builder<DiagnoseClusterRequest, Operation>
diagnoseClusterSettings;
private final OperationCallSettings.Builder<
DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationSettings;
private final UnaryCallSettings.Builder<GetClusterRequest, Cluster> getClusterSettings;
private final PagedCallSettings.Builder<
@@ -547,9 +549,9 @@ private static Builder initDefaults(Builder builder) {
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
ProtoOperationTransformers.ResponseTransformer.create(DiagnoseClusterResults.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(DiagnoseClusterResults.class))
ProtoOperationTransformers.MetadataTransformer.create(ClusterOperationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
@@ -652,7 +654,8 @@ public UnaryCallSettings.Builder<DiagnoseClusterRequest, Operation> diagnoseClus
/** Returns the builder for the settings used for calls to diagnoseCluster. */
@BetaApi(
"The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallSettings.Builder<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public OperationCallSettings.Builder<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationSettings() {
return diagnoseClusterOperationSettings;
}
@@ -120,7 +120,8 @@ public class GrpcClusterControllerStub extends ClusterControllerStub {
private final OperationCallable<DeleteClusterRequest, Empty, ClusterOperationMetadata>
deleteClusterOperationCallable;
private final UnaryCallable<DiagnoseClusterRequest, Operation> diagnoseClusterCallable;
private final OperationCallable<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
private final OperationCallable<
DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationCallable;
private final UnaryCallable<GetClusterRequest, Cluster> getClusterCallable;
private final UnaryCallable<ListClustersRequest, ListClustersResponse> listClustersCallable;
@@ -279,7 +280,7 @@ public UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallable() {
}

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallable<DiagnoseClusterRequest, Empty, DiagnoseClusterResults>
public OperationCallable<DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata>
diagnoseClusterOperationCallable() {
return diagnoseClusterOperationCallable;
}
@@ -276,7 +276,9 @@ public void deleteClusterExceptionTest() throws Exception {
@Test
@SuppressWarnings("all")
public void diagnoseClusterTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
String outputUri = "outputUri-1273518802";
DiagnoseClusterResults expectedResponse =
DiagnoseClusterResults.newBuilder().setOutputUri(outputUri).build();
Operation resultOperation =
Operation.newBuilder()
.setName("diagnoseClusterTest")
@@ -289,7 +291,8 @@ public void diagnoseClusterTest() throws Exception {
String region = "region-934795532";
String clusterName = "clusterName-1018081872";

Empty actualResponse = client.diagnoseClusterAsync(projectId, region, clusterName).get();
DiagnoseClusterResults actualResponse =
client.diagnoseClusterAsync(projectId, region, clusterName).get();
Assert.assertEquals(expectedResponse, actualResponse);

List<AbstractMessage> actualRequests = mockClusterController.getRequests();
@@ -308,7 +308,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "TypeB\003\340A\001\022\020\n\003key\030\002 \001(\tB\003\340A\001\022\023\n\006values\030\003 "
+ "\003(\tB\003\340A\001\"_\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\022"
+ "\n\016NO_RESERVATION\020\001\022\023\n\017ANY_RESERVATION\020\002\022"
+ "\030\n\024SPECIFIC_RESERVATION\020\0032\343\014\n\021ClusterCon"
+ "\030\n\024SPECIFIC_RESERVATION\020\0032\377\014\n\021ClusterCon"
+ "troller\022\200\002\n\rCreateCluster\022..google.cloud"
+ ".dataproc.v1.CreateClusterRequest\032\035.goog"
+ "le.longrunning.Operation\"\237\001\202\323\344\223\002>\"3/v1/p"
@@ -340,19 +340,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "google.cloud.dataproc.v1.ListClustersRes"
+ "ponse\"j\202\323\344\223\0025\0223/v1/projects/{project_id}"
+ "/regions/{region}/clusters\332A\021project_id,"
+ "region\332A\030project_id,region,filter\022\216\002\n\017Di"
+ "region\332A\030project_id,region,filter\022\252\002\n\017Di"
+ "agnoseCluster\0220.google.cloud.dataproc.v1"
+ ".DiagnoseClusterRequest\032\035.google.longrun"
+ "ning.Operation\"\251\001\202\323\344\223\002P\"K/v1/projects/{p"
+ "ning.Operation\"\305\001\202\323\344\223\002P\"K/v1/projects/{p"
+ "roject_id}/regions/{region}/clusters/{cl"
+ "uster_name}:diagnose:\001*\332A\036project_id,reg"
+ "ion,cluster_name\312A/\n\025google.protobuf.Emp"
+ "ty\022\026DiagnoseClusterResults\032K\312A\027dataproc."
+ "googleapis.com\322A.https://www.googleapis."
+ "com/auth/cloud-platformBq\n\034com.google.cl"
+ "oud.dataproc.v1B\rClustersProtoP\001Z@google"
+ ".golang.org/genproto/googleapis/cloud/da"
+ "taproc/v1;dataprocb\006proto3"
+ "ion,cluster_name\312AK\n\026DiagnoseClusterResu"
+ "lts\0221google.cloud.dataproc.v1.ClusterOpe"
+ "rationMetadata\032K\312A\027dataproc.googleapis.c"
+ "om\322A.https://www.googleapis.com/auth/clo"
+ "ud-platformBq\n\034com.google.cloud.dataproc"
+ ".v1B\rClustersProtoP\001Z@google.golang.org/"
+ "genproto/googleapis/cloud/dataproc/v1;da"
+ "taprocb\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -111,8 +111,8 @@ service ClusterController {
};
option (google.api.method_signature) = "project_id,region,cluster_name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "DiagnoseClusterResults"
response_type: "DiagnoseClusterResults"
metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata"
};
}
}
@@ -4,23 +4,23 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-dataproc.git",
"sha": "f246195ad7aa0fd04694256f885c09b22c10289b"
"sha": "bef1b0d43ffa90cf27303a87ce8e020083512841"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ec05fa81a492c84fbe5b85341738ced42604ce68",
"internalRef": "320442976"
"sha": "0e7900e3950d32ccafae22a2ccb85fa61ffe08f9",
"internalRef": "321255718"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ec05fa81a492c84fbe5b85341738ced42604ce68",
"internalRef": "320442976"
"sha": "0e7900e3950d32ccafae22a2ccb85fa61ffe08f9",
"internalRef": "321255718"
}
},
{

0 comments on commit 50f0ad0

Please sign in to comment.