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

Commit fa85233

Browse files
yoshi-automationdinagraves
authored andcommitted
chore: migrate cloudbuild to Java microgenerator
Committer: @miraleung PiperOrigin-RevId: 346132650 Source-Author: Google APIs <[email protected]> Source-Date: Mon Dec 7 11:03:53 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 08869d766d1c5ad0950ba24e9707339024ab63be Source-Link: googleapis/googleapis@08869d7
1 parent c743159 commit fa85233

File tree

16 files changed

+1246
-2537
lines changed

16 files changed

+1246
-2537
lines changed

google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClient.java

Lines changed: 238 additions & 847 deletions
Large diffs are not rendered by default.

google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildSettings.java

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.google.cloud.devtools.cloudbuild.v1;
1718

1819
import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse;
@@ -60,7 +61,7 @@
6061
import java.util.List;
6162
import javax.annotation.Generated;
6263

63-
// AUTO-GENERATED DOCUMENTATION AND CLASS
64+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
6465
/**
6566
* Settings class to configure an instance of {@link CloudBuildClient}.
6667
*
@@ -75,44 +76,31 @@
7576
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
7677
* build() is called, the tree of builders is called to create the complete settings object.
7778
*
78-
* <p>For example, to set the total timeout of deleteBuildTrigger to 30 seconds:
79+
* <p>For example, to set the total timeout of getBuild to 30 seconds:
7980
*
80-
* <pre>
81-
* <code>
82-
* CloudBuildSettings.Builder cloudBuildSettingsBuilder =
83-
* CloudBuildSettings.newBuilder();
81+
* <pre>{@code
82+
* CloudBuildSettings.Builder cloudBuildSettingsBuilder = CloudBuildSettings.newBuilder();
8483
* cloudBuildSettingsBuilder
85-
* .deleteBuildTriggerSettings()
84+
* .getBuildSettings()
8685
* .setRetrySettings(
87-
* cloudBuildSettingsBuilder.deleteBuildTriggerSettings().getRetrySettings().toBuilder()
86+
* cloudBuildSettingsBuilder
87+
* .getBuildSettings()
88+
* .getRetrySettings()
89+
* .toBuilder()
8890
* .setTotalTimeout(Duration.ofSeconds(30))
8991
* .build());
9092
* CloudBuildSettings cloudBuildSettings = cloudBuildSettingsBuilder.build();
91-
* </code>
92-
* </pre>
93+
* }</pre>
9394
*/
94-
@Generated("by gapic-generator")
95-
@BetaApi
95+
@Generated("by gapic-generator-java")
9696
public class CloudBuildSettings extends ClientSettings<CloudBuildSettings> {
97-
/** Returns the object with the settings used for calls to listBuilds. */
98-
public PagedCallSettings<ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse>
99-
listBuildsSettings() {
100-
return ((CloudBuildStubSettings) getStubSettings()).listBuildsSettings();
101-
}
102-
103-
/** Returns the object with the settings used for calls to deleteBuildTrigger. */
104-
public UnaryCallSettings<DeleteBuildTriggerRequest, Empty> deleteBuildTriggerSettings() {
105-
return ((CloudBuildStubSettings) getStubSettings()).deleteBuildTriggerSettings();
106-
}
10797

10898
/** Returns the object with the settings used for calls to createBuild. */
10999
public UnaryCallSettings<CreateBuildRequest, Operation> createBuildSettings() {
110100
return ((CloudBuildStubSettings) getStubSettings()).createBuildSettings();
111101
}
112102

113103
/** Returns the object with the settings used for calls to createBuild. */
114-
@BetaApi(
115-
"The surface for long-running operations is not stable yet and may change in the future.")
116104
public OperationCallSettings<CreateBuildRequest, Build, BuildOperationMetadata>
117105
createBuildOperationSettings() {
118106
return ((CloudBuildStubSettings) getStubSettings()).createBuildOperationSettings();
@@ -123,6 +111,12 @@ public UnaryCallSettings<GetBuildRequest, Build> getBuildSettings() {
123111
return ((CloudBuildStubSettings) getStubSettings()).getBuildSettings();
124112
}
125113

114+
/** Returns the object with the settings used for calls to listBuilds. */
115+
public PagedCallSettings<ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse>
116+
listBuildsSettings() {
117+
return ((CloudBuildStubSettings) getStubSettings()).listBuildsSettings();
118+
}
119+
126120
/** Returns the object with the settings used for calls to cancelBuild. */
127121
public UnaryCallSettings<CancelBuildRequest, Build> cancelBuildSettings() {
128122
return ((CloudBuildStubSettings) getStubSettings()).cancelBuildSettings();
@@ -134,8 +128,6 @@ public UnaryCallSettings<RetryBuildRequest, Operation> retryBuildSettings() {
134128
}
135129

136130
/** Returns the object with the settings used for calls to retryBuild. */
137-
@BetaApi(
138-
"The surface for long-running operations is not stable yet and may change in the future.")
139131
public OperationCallSettings<RetryBuildRequest, Build, BuildOperationMetadata>
140132
retryBuildOperationSettings() {
141133
return ((CloudBuildStubSettings) getStubSettings()).retryBuildOperationSettings();
@@ -158,6 +150,11 @@ public UnaryCallSettings<GetBuildTriggerRequest, BuildTrigger> getBuildTriggerSe
158150
return ((CloudBuildStubSettings) getStubSettings()).listBuildTriggersSettings();
159151
}
160152

153+
/** Returns the object with the settings used for calls to deleteBuildTrigger. */
154+
public UnaryCallSettings<DeleteBuildTriggerRequest, Empty> deleteBuildTriggerSettings() {
155+
return ((CloudBuildStubSettings) getStubSettings()).deleteBuildTriggerSettings();
156+
}
157+
161158
/** Returns the object with the settings used for calls to updateBuildTrigger. */
162159
public UnaryCallSettings<UpdateBuildTriggerRequest, BuildTrigger> updateBuildTriggerSettings() {
163160
return ((CloudBuildStubSettings) getStubSettings()).updateBuildTriggerSettings();
@@ -169,8 +166,6 @@ public UnaryCallSettings<RunBuildTriggerRequest, Operation> runBuildTriggerSetti
169166
}
170167

171168
/** Returns the object with the settings used for calls to runBuildTrigger. */
172-
@BetaApi(
173-
"The surface for long-running operations is not stable yet and may change in the future.")
174169
public OperationCallSettings<RunBuildTriggerRequest, Build, BuildOperationMetadata>
175170
runBuildTriggerOperationSettings() {
176171
return ((CloudBuildStubSettings) getStubSettings()).runBuildTriggerOperationSettings();
@@ -261,18 +256,15 @@ protected CloudBuildSettings(Builder settingsBuilder) throws IOException {
261256

262257
/** Builder for CloudBuildSettings. */
263258
public static class Builder extends ClientSettings.Builder<CloudBuildSettings, Builder> {
259+
264260
protected Builder() throws IOException {
265-
this((ClientContext) null);
261+
this(((ClientContext) null));
266262
}
267263

268264
protected Builder(ClientContext clientContext) {
269265
super(CloudBuildStubSettings.newBuilder(clientContext));
270266
}
271267

272-
private static Builder createDefault() {
273-
return new Builder(CloudBuildStubSettings.newBuilder());
274-
}
275-
276268
protected Builder(CloudBuildSettings settings) {
277269
super(settings.getStubSettings().toBuilder());
278270
}
@@ -281,11 +273,15 @@ protected Builder(CloudBuildStubSettings.Builder stubSettings) {
281273
super(stubSettings);
282274
}
283275

276+
private static Builder createDefault() {
277+
return new Builder(CloudBuildStubSettings.newBuilder());
278+
}
279+
284280
public CloudBuildStubSettings.Builder getStubSettingsBuilder() {
285281
return ((CloudBuildStubSettings.Builder) getStubSettings());
286282
}
287283

288-
// NEXT_MAJOR_VER: remove 'throws Exception'
284+
// NEXT_MAJOR_VER: remove 'throws Exception'.
289285
/**
290286
* Applies the given settings updater function to all of the unary API methods in this service.
291287
*
@@ -298,26 +294,12 @@ public Builder applyToAllUnaryMethods(
298294
return this;
299295
}
300296

301-
/** Returns the builder for the settings used for calls to listBuilds. */
302-
public PagedCallSettings.Builder<ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse>
303-
listBuildsSettings() {
304-
return getStubSettingsBuilder().listBuildsSettings();
305-
}
306-
307-
/** Returns the builder for the settings used for calls to deleteBuildTrigger. */
308-
public UnaryCallSettings.Builder<DeleteBuildTriggerRequest, Empty>
309-
deleteBuildTriggerSettings() {
310-
return getStubSettingsBuilder().deleteBuildTriggerSettings();
311-
}
312-
313297
/** Returns the builder for the settings used for calls to createBuild. */
314298
public UnaryCallSettings.Builder<CreateBuildRequest, Operation> createBuildSettings() {
315299
return getStubSettingsBuilder().createBuildSettings();
316300
}
317301

318302
/** Returns the builder for the settings used for calls to createBuild. */
319-
@BetaApi(
320-
"The surface for long-running operations is not stable yet and may change in the future.")
321303
public OperationCallSettings.Builder<CreateBuildRequest, Build, BuildOperationMetadata>
322304
createBuildOperationSettings() {
323305
return getStubSettingsBuilder().createBuildOperationSettings();
@@ -328,6 +310,12 @@ public UnaryCallSettings.Builder<GetBuildRequest, Build> getBuildSettings() {
328310
return getStubSettingsBuilder().getBuildSettings();
329311
}
330312

313+
/** Returns the builder for the settings used for calls to listBuilds. */
314+
public PagedCallSettings.Builder<ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse>
315+
listBuildsSettings() {
316+
return getStubSettingsBuilder().listBuildsSettings();
317+
}
318+
331319
/** Returns the builder for the settings used for calls to cancelBuild. */
332320
public UnaryCallSettings.Builder<CancelBuildRequest, Build> cancelBuildSettings() {
333321
return getStubSettingsBuilder().cancelBuildSettings();
@@ -339,8 +327,6 @@ public UnaryCallSettings.Builder<RetryBuildRequest, Operation> retryBuildSetting
339327
}
340328

341329
/** Returns the builder for the settings used for calls to retryBuild. */
342-
@BetaApi(
343-
"The surface for long-running operations is not stable yet and may change in the future.")
344330
public OperationCallSettings.Builder<RetryBuildRequest, Build, BuildOperationMetadata>
345331
retryBuildOperationSettings() {
346332
return getStubSettingsBuilder().retryBuildOperationSettings();
@@ -365,6 +351,12 @@ public UnaryCallSettings.Builder<RetryBuildRequest, Operation> retryBuildSetting
365351
return getStubSettingsBuilder().listBuildTriggersSettings();
366352
}
367353

354+
/** Returns the builder for the settings used for calls to deleteBuildTrigger. */
355+
public UnaryCallSettings.Builder<DeleteBuildTriggerRequest, Empty>
356+
deleteBuildTriggerSettings() {
357+
return getStubSettingsBuilder().deleteBuildTriggerSettings();
358+
}
359+
368360
/** Returns the builder for the settings used for calls to updateBuildTrigger. */
369361
public UnaryCallSettings.Builder<UpdateBuildTriggerRequest, BuildTrigger>
370362
updateBuildTriggerSettings() {
@@ -377,8 +369,6 @@ public UnaryCallSettings.Builder<RunBuildTriggerRequest, Operation> runBuildTrig
377369
}
378370

379371
/** Returns the builder for the settings used for calls to runBuildTrigger. */
380-
@BetaApi(
381-
"The surface for long-running operations is not stable yet and may change in the future.")
382372
public OperationCallSettings.Builder<RunBuildTriggerRequest, Build, BuildOperationMetadata>
383373
runBuildTriggerOperationSettings() {
384374
return getStubSettingsBuilder().runBuildTriggerOperationSettings();

google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/package-info.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,11 +15,9 @@
1515
*/
1616

1717
/**
18-
* A client to Cloud Build API.
18+
* The interfaces provided are listed below, along with usage samples.
1919
*
20-
* <p>The interfaces provided are listed below, along with usage samples.
21-
*
22-
* <p>================ CloudBuildClient ================
20+
* <p>======================= CloudBuildClient =======================
2321
*
2422
* <p>Service Description: Creates and manages builds on Google Cloud Platform.
2523
*
@@ -30,18 +28,8 @@
3028
* of the build.
3129
*
3230
* <p>Sample for CloudBuildClient:
33-
*
34-
* <pre>
35-
* <code>
36-
* try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
37-
* String projectId = "";
38-
* String triggerId = "";
39-
* cloudBuildClient.deleteBuildTrigger(projectId, triggerId);
40-
* }
41-
* </code>
42-
* </pre>
4331
*/
44-
@Generated("by gapic-generator")
32+
@Generated("by gapic-generator-java")
4533
package com.google.cloud.devtools.cloudbuild.v1;
4634

4735
import javax.annotation.Generated;

google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStub.java

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package com.google.cloud.devtools.cloudbuild.v1.stub;
1718

1819
import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse;
1920
import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildsPagedResponse;
2021

21-
import com.google.api.core.BetaApi;
2222
import com.google.api.gax.core.BackgroundResource;
2323
import com.google.api.gax.rpc.OperationCallable;
2424
import com.google.api.gax.rpc.UnaryCallable;
@@ -50,34 +50,19 @@
5050
import com.google.protobuf.Empty;
5151
import javax.annotation.Generated;
5252

53-
// AUTO-GENERATED DOCUMENTATION AND CLASS
53+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
5454
/**
55-
* Base stub class for Cloud Build API.
55+
* Base stub class for the CloudBuild service API.
5656
*
5757
* <p>This class is for advanced usage and reflects the underlying API directly.
5858
*/
5959
@Generated("by gapic-generator")
60-
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
6160
public abstract class CloudBuildStub implements BackgroundResource {
6261

63-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
6462
public OperationsStub getOperationsStub() {
6563
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
6664
}
6765

68-
public UnaryCallable<ListBuildsRequest, ListBuildsPagedResponse> listBuildsPagedCallable() {
69-
throw new UnsupportedOperationException("Not implemented: listBuildsPagedCallable()");
70-
}
71-
72-
public UnaryCallable<ListBuildsRequest, ListBuildsResponse> listBuildsCallable() {
73-
throw new UnsupportedOperationException("Not implemented: listBuildsCallable()");
74-
}
75-
76-
public UnaryCallable<DeleteBuildTriggerRequest, Empty> deleteBuildTriggerCallable() {
77-
throw new UnsupportedOperationException("Not implemented: deleteBuildTriggerCallable()");
78-
}
79-
80-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
8166
public OperationCallable<CreateBuildRequest, Build, BuildOperationMetadata>
8267
createBuildOperationCallable() {
8368
throw new UnsupportedOperationException("Not implemented: createBuildOperationCallable()");
@@ -91,11 +76,18 @@ public UnaryCallable<GetBuildRequest, Build> getBuildCallable() {
9176
throw new UnsupportedOperationException("Not implemented: getBuildCallable()");
9277
}
9378

79+
public UnaryCallable<ListBuildsRequest, ListBuildsPagedResponse> listBuildsPagedCallable() {
80+
throw new UnsupportedOperationException("Not implemented: listBuildsPagedCallable()");
81+
}
82+
83+
public UnaryCallable<ListBuildsRequest, ListBuildsResponse> listBuildsCallable() {
84+
throw new UnsupportedOperationException("Not implemented: listBuildsCallable()");
85+
}
86+
9487
public UnaryCallable<CancelBuildRequest, Build> cancelBuildCallable() {
9588
throw new UnsupportedOperationException("Not implemented: cancelBuildCallable()");
9689
}
9790

98-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
9991
public OperationCallable<RetryBuildRequest, Build, BuildOperationMetadata>
10092
retryBuildOperationCallable() {
10193
throw new UnsupportedOperationException("Not implemented: retryBuildOperationCallable()");
@@ -123,11 +115,14 @@ public UnaryCallable<GetBuildTriggerRequest, BuildTrigger> getBuildTriggerCallab
123115
throw new UnsupportedOperationException("Not implemented: listBuildTriggersCallable()");
124116
}
125117

118+
public UnaryCallable<DeleteBuildTriggerRequest, Empty> deleteBuildTriggerCallable() {
119+
throw new UnsupportedOperationException("Not implemented: deleteBuildTriggerCallable()");
120+
}
121+
126122
public UnaryCallable<UpdateBuildTriggerRequest, BuildTrigger> updateBuildTriggerCallable() {
127123
throw new UnsupportedOperationException("Not implemented: updateBuildTriggerCallable()");
128124
}
129125

130-
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
131126
public OperationCallable<RunBuildTriggerRequest, Build, BuildOperationMetadata>
132127
runBuildTriggerOperationCallable() {
133128
throw new UnsupportedOperationException("Not implemented: runBuildTriggerOperationCallable()");

0 commit comments

Comments
 (0)