diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClient.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClient.java index 9bd11b64..797c8f93 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClient.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1; import com.google.api.core.ApiFunction; @@ -62,7 +63,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Creates and manages builds on Google Cloud Platform. * @@ -75,17 +76,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
- *   String projectId = "";
- *   String triggerId = "";
- *   cloudBuildClient.deleteBuildTrigger(projectId, triggerId);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the cloudBuildClient object to clean up resources such as + *

Note: close() needs to be called on the CloudBuildClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -113,30 +104,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * CloudBuildSettings cloudBuildSettings =
  *     CloudBuildSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * CloudBuildClient cloudBuildClient =
- *     CloudBuildClient.create(cloudBuildSettings);
- * 
- * 
+ * CloudBuildClient cloudBuildClient = CloudBuildClient.create(cloudBuildSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * CloudBuildSettings cloudBuildSettings =
  *     CloudBuildSettings.newBuilder().setEndpoint(myEndpoint).build();
- * CloudBuildClient cloudBuildClient =
- *     CloudBuildClient.create(cloudBuildSettings);
- * 
- * 
+ * CloudBuildClient cloudBuildClient = CloudBuildClient.create(cloudBuildSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class CloudBuildClient implements BackgroundResource { private final CloudBuildSettings settings; private final CloudBuildStub stub; @@ -157,7 +144,7 @@ public static final CloudBuildClient create(CloudBuildSettings settings) throws /** * Constructs an instance of CloudBuildClient, using the given stub for making calls. This is for - * advanced usage - prefer to use CloudBuildSettings}. + * advanced usage - prefer using create(CloudBuildSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final CloudBuildClient create(CloudBuildStub stub) { @@ -194,235 +181,21 @@ public CloudBuildStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists previously requested builds. - * - *

Previously requested builds may still be in-progress, or may have finished successfully or - * unsuccessfully. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String filter = "";
-   *   for (Build element : cloudBuildClient.listBuilds(projectId, filter).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @param projectId Required. ID of the project. - * @param filter The raw filter text to constrain the results. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBuildsPagedResponse listBuilds(String projectId, String filter) { - ListBuildsRequest request = - ListBuildsRequest.newBuilder().setProjectId(projectId).setFilter(filter).build(); - return listBuilds(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists previously requested builds. - * - *

Previously requested builds may still be in-progress, or may have finished successfully or - * unsuccessfully. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   ListBuildsRequest request = ListBuildsRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .build();
-   *   for (Build element : cloudBuildClient.listBuilds(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * - * @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 ListBuildsPagedResponse listBuilds(ListBuildsRequest request) { - return listBuildsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists previously requested builds. - * - *

Previously requested builds may still be in-progress, or may have finished successfully or - * unsuccessfully. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   ListBuildsRequest request = ListBuildsRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .build();
-   *   ApiFuture<ListBuildsPagedResponse> future = cloudBuildClient.listBuildsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Build element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable listBuildsPagedCallable() { - return stub.listBuildsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Lists previously requested builds. - * - *

Previously requested builds may still be in-progress, or may have finished successfully or - * unsuccessfully. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   ListBuildsRequest request = ListBuildsRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .build();
-   *   while (true) {
-   *     ListBuildsResponse response = cloudBuildClient.listBuildsCallable().call(request);
-   *     for (Build element : response.getBuildsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
- */ - public final UnaryCallable listBuildsCallable() { - return stub.listBuildsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a `BuildTrigger` by its project ID and trigger ID. - * - *

This API is experimental. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   cloudBuildClient.deleteBuildTrigger(projectId, triggerId);
-   * }
-   * 
- * - * @param projectId Required. ID of the project that owns the trigger. - * @param triggerId Required. ID of the `BuildTrigger` to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBuildTrigger(String projectId, String triggerId) { - DeleteBuildTriggerRequest request = - DeleteBuildTriggerRequest.newBuilder() - .setProjectId(projectId) - .setTriggerId(triggerId) - .build(); - deleteBuildTrigger(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a `BuildTrigger` by its project ID and trigger ID. - * - *

This API is experimental. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   DeleteBuildTriggerRequest request = DeleteBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .build();
-   *   cloudBuildClient.deleteBuildTrigger(request);
-   * }
-   * 
- * - * @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 void deleteBuildTrigger(DeleteBuildTriggerRequest request) { - deleteBuildTriggerCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes a `BuildTrigger` by its project ID and trigger ID. - * - *

This API is experimental. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   DeleteBuildTriggerRequest request = DeleteBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .build();
-   *   ApiFuture<Void> future = cloudBuildClient.deleteBuildTriggerCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteBuildTriggerCallable() { - return stub.deleteBuildTriggerCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a build with the specified configuration. * *

This method returns a long-running `Operation`, which includes the build ID. Pass the build * ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   Build build = Build.newBuilder().build();
-   *   Build response = cloudBuildClient.createBuildAsync(projectId, build).get();
-   * }
-   * 
- * * @param projectId Required. ID of the project. * @param build Required. Build resource to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createBuildAsync( String projectId, Build build) { CreateBuildRequest request = @@ -430,38 +203,22 @@ public final OperationFuture createBuildAsync( return createBuildAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a build with the specified configuration. * *

This method returns a long-running `Operation`, which includes the build ID. Pass the build * ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   Build build = Build.newBuilder().build();
-   *   CreateBuildRequest request = CreateBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setBuild(build)
-   *     .build();
-   *   Build response = cloudBuildClient.createBuildAsync(request).get();
-   * }
-   * 
- * * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createBuildAsync( CreateBuildRequest request) { return createBuildOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a build with the specified configuration. * @@ -469,28 +226,13 @@ public final OperationFuture createBuildAsync( * ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   Build build = Build.newBuilder().build();
-   *   CreateBuildRequest request = CreateBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setBuild(build)
-   *     .build();
-   *   OperationFuture<Build, BuildOperationMetadata> future = cloudBuildClient.createBuildOperationCallable().futureCall(request);
-   *   // Do something
-   *   Build response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable createBuildOperationCallable() { return stub.createBuildOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Starts a build with the specified configuration. * @@ -498,42 +240,18 @@ public final OperationFuture createBuildAsync( * ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`). * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   Build build = Build.newBuilder().build();
-   *   CreateBuildRequest request = CreateBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setBuild(build)
-   *     .build();
-   *   ApiFuture<Operation> future = cloudBuildClient.createBuildCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createBuildCallable() { return stub.createBuildCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a previously requested build. * *

The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or * `WORKING`), and timing information. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   Build response = cloudBuildClient.getBuild(projectId, id);
-   * }
-   * 
- * * @param projectId Required. ID of the project. * @param id Required. ID of the build. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -544,27 +262,13 @@ public final Build getBuild(String projectId, String id) { return getBuild(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a previously requested build. * *

The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or * `WORKING`), and timing information. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   GetBuildRequest request = GetBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   Build response = cloudBuildClient.getBuild(request);
-   * }
-   * 
- * * @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 */ @@ -572,7 +276,7 @@ public final Build getBuild(GetBuildRequest request) { return getBuildCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a previously requested build. * @@ -580,38 +284,71 @@ public final Build getBuild(GetBuildRequest request) { * `WORKING`), and timing information. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   GetBuildRequest request = GetBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   ApiFuture<Build> future = cloudBuildClient.getBuildCallable().futureCall(request);
-   *   // Do something
-   *   Build response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getBuildCallable() { return stub.getBuildCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Cancels a build in progress. + * Lists previously requested builds. + * + *

Previously requested builds may still be in-progress, or may have finished successfully or + * unsuccessfully. + * + * @param projectId Required. ID of the project. + * @param filter The raw filter text to constrain the results. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBuildsPagedResponse listBuilds(String projectId, String filter) { + ListBuildsRequest request = + ListBuildsRequest.newBuilder().setProjectId(projectId).setFilter(filter).build(); + return listBuilds(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists previously requested builds. + * + *

Previously requested builds may still be in-progress, or may have finished successfully or + * unsuccessfully. + * + * @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 ListBuildsPagedResponse listBuilds(ListBuildsRequest request) { + return listBuildsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists previously requested builds. + * + *

Previously requested builds may still be in-progress, or may have finished successfully or + * unsuccessfully. * *

Sample code: + */ + public final UnaryCallable listBuildsPagedCallable() { + return stub.listBuildsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists previously requested builds. + * + *

Previously requested builds may still be in-progress, or may have finished successfully or + * unsuccessfully. * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   Build response = cloudBuildClient.cancelBuild(projectId, id);
-   * }
-   * 
+ *

Sample code: + */ + public final UnaryCallable listBuildsCallable() { + return stub.listBuildsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels a build in progress. * * @param projectId Required. ID of the project. * @param id Required. ID of the build. @@ -623,24 +360,10 @@ public final Build cancelBuild(String projectId, String id) { return cancelBuild(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Cancels a build in progress. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   CancelBuildRequest request = CancelBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   Build response = cloudBuildClient.cancelBuild(request);
-   * }
-   * 
- * * @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 */ @@ -648,31 +371,17 @@ public final Build cancelBuild(CancelBuildRequest request) { return cancelBuildCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Cancels a build in progress. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   CancelBuildRequest request = CancelBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   ApiFuture<Build> future = cloudBuildClient.cancelBuildCallable().futureCall(request);
-   *   // Do something
-   *   Build response = future.get();
-   * }
-   * 
*/ public final UnaryCallable cancelBuildCallable() { return stub.cancelBuildCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new build based on the specified build. * @@ -681,40 +390,35 @@ public final UnaryCallable cancelBuildCallable() { * *

For triggered builds: * - *

* Triggered builds resolve to a precise revision; therefore a retry of a triggered build - * will result in a build that uses the same revision. + *

    + *
  • Triggered builds resolve to a precise revision; therefore a retry of a triggered build + * will result in a build that uses the same revision. + *
* *

For non-triggered builds that specify `RepoSource`: * - *

* If the original build built from the tip of a branch, the retried build will build - * from the tip of that branch, which may not be the same revision as the original build. * If - * the original build specified a commit sha or revision ID, the retried build will use the - * identical source. + *

    + *
  • If the original build built from the tip of a branch, the retried build will build from + * the tip of that branch, which may not be the same revision as the original build. + *
  • If the original build specified a commit sha or revision ID, the retried build will use + * the identical source. + *
* *

For builds that specify `StorageSource`: * - *

* If the original build pulled source from Google Cloud Storage without specifying the - * generation of the object, the new build will use the current object, which may be different - * from the original build source. * If the original build pulled source from Cloud Storage - * and specified the generation of the object, the new build will attempt to use the same object, - * which may or may not be available depending on the bucket's lifecycle management settings. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   Build response = cloudBuildClient.retryBuildAsync(projectId, id).get();
-   * }
-   * 
+ *
    + *
  • If the original build pulled source from Google Cloud Storage without specifying the + * generation of the object, the new build will use the current object, which may be + * different from the original build source. + *
  • If the original build pulled source from Cloud Storage and specified the generation of + * the object, the new build will attempt to use the same object, which may or may not be + * available depending on the bucket's lifecycle management settings. + *
* * @param projectId Required. ID of the project. * @param id Required. Build ID of the original build. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture retryBuildAsync( String projectId, String id) { RetryBuildRequest request = @@ -722,7 +426,7 @@ public final OperationFuture retryBuildAsync( return retryBuildAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new build based on the specified build. * @@ -731,49 +435,40 @@ public final OperationFuture retryBuildAsync( * *

For triggered builds: * - *

* Triggered builds resolve to a precise revision; therefore a retry of a triggered build - * will result in a build that uses the same revision. + *

    + *
  • Triggered builds resolve to a precise revision; therefore a retry of a triggered build + * will result in a build that uses the same revision. + *
* *

For non-triggered builds that specify `RepoSource`: * - *

* If the original build built from the tip of a branch, the retried build will build - * from the tip of that branch, which may not be the same revision as the original build. * If - * the original build specified a commit sha or revision ID, the retried build will use the - * identical source. + *

    + *
  • If the original build built from the tip of a branch, the retried build will build from + * the tip of that branch, which may not be the same revision as the original build. + *
  • If the original build specified a commit sha or revision ID, the retried build will use + * the identical source. + *
* *

For builds that specify `StorageSource`: * - *

* If the original build pulled source from Google Cloud Storage without specifying the - * generation of the object, the new build will use the current object, which may be different - * from the original build source. * If the original build pulled source from Cloud Storage - * and specified the generation of the object, the new build will attempt to use the same object, - * which may or may not be available depending on the bucket's lifecycle management settings. - * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   RetryBuildRequest request = RetryBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   Build response = cloudBuildClient.retryBuildAsync(request).get();
-   * }
-   * 
+ *
    + *
  • If the original build pulled source from Google Cloud Storage without specifying the + * generation of the object, the new build will use the current object, which may be + * different from the original build source. + *
  • If the original build pulled source from Cloud Storage and specified the generation of + * the object, the new build will attempt to use the same object, which may or may not be + * available depending on the bucket's lifecycle management settings. + *
* * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture retryBuildAsync( RetryBuildRequest request) { return retryBuildOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new build based on the specified build. * @@ -782,47 +477,39 @@ public final OperationFuture retryBuildAsync( * *

For triggered builds: * - *

* Triggered builds resolve to a precise revision; therefore a retry of a triggered build - * will result in a build that uses the same revision. + *

    + *
  • Triggered builds resolve to a precise revision; therefore a retry of a triggered build + * will result in a build that uses the same revision. + *
* *

For non-triggered builds that specify `RepoSource`: * - *

* If the original build built from the tip of a branch, the retried build will build - * from the tip of that branch, which may not be the same revision as the original build. * If - * the original build specified a commit sha or revision ID, the retried build will use the - * identical source. + *

    + *
  • If the original build built from the tip of a branch, the retried build will build from + * the tip of that branch, which may not be the same revision as the original build. + *
  • If the original build specified a commit sha or revision ID, the retried build will use + * the identical source. + *
* *

For builds that specify `StorageSource`: * - *

* If the original build pulled source from Google Cloud Storage without specifying the - * generation of the object, the new build will use the current object, which may be different - * from the original build source. * If the original build pulled source from Cloud Storage - * and specified the generation of the object, the new build will attempt to use the same object, - * which may or may not be available depending on the bucket's lifecycle management settings. + *

    + *
  • If the original build pulled source from Google Cloud Storage without specifying the + * generation of the object, the new build will use the current object, which may be + * different from the original build source. + *
  • If the original build pulled source from Cloud Storage and specified the generation of + * the object, the new build will attempt to use the same object, which may or may not be + * available depending on the bucket's lifecycle management settings. + *
* *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   RetryBuildRequest request = RetryBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   OperationFuture<Build, BuildOperationMetadata> future = cloudBuildClient.retryBuildOperationCallable().futureCall(request);
-   *   // Do something
-   *   Build response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable retryBuildOperationCallable() { return stub.retryBuildOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new build based on the specified build. * @@ -831,60 +518,43 @@ public final OperationFuture retryBuildAsync( * *

For triggered builds: * - *

* Triggered builds resolve to a precise revision; therefore a retry of a triggered build - * will result in a build that uses the same revision. + *

    + *
  • Triggered builds resolve to a precise revision; therefore a retry of a triggered build + * will result in a build that uses the same revision. + *
* *

For non-triggered builds that specify `RepoSource`: * - *

* If the original build built from the tip of a branch, the retried build will build - * from the tip of that branch, which may not be the same revision as the original build. * If - * the original build specified a commit sha or revision ID, the retried build will use the - * identical source. + *

    + *
  • If the original build built from the tip of a branch, the retried build will build from + * the tip of that branch, which may not be the same revision as the original build. + *
  • If the original build specified a commit sha or revision ID, the retried build will use + * the identical source. + *
* *

For builds that specify `StorageSource`: * - *

* If the original build pulled source from Google Cloud Storage without specifying the - * generation of the object, the new build will use the current object, which may be different - * from the original build source. * If the original build pulled source from Cloud Storage - * and specified the generation of the object, the new build will attempt to use the same object, - * which may or may not be available depending on the bucket's lifecycle management settings. + *

    + *
  • If the original build pulled source from Google Cloud Storage without specifying the + * generation of the object, the new build will use the current object, which may be + * different from the original build source. + *
  • If the original build pulled source from Cloud Storage and specified the generation of + * the object, the new build will attempt to use the same object, which may or may not be + * available depending on the bucket's lifecycle management settings. + *
* *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String id = "";
-   *   RetryBuildRequest request = RetryBuildRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setId(id)
-   *     .build();
-   *   ApiFuture<Operation> future = cloudBuildClient.retryBuildCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable retryBuildCallable() { return stub.retryBuildCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new `BuildTrigger`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   BuildTrigger trigger = BuildTrigger.newBuilder().build();
-   *   BuildTrigger response = cloudBuildClient.createBuildTrigger(projectId, trigger);
-   * }
-   * 
- * * @param projectId Required. ID of the project for which to configure automatic builds. * @param trigger Required. `BuildTrigger` to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -895,26 +565,12 @@ public final BuildTrigger createBuildTrigger(String projectId, BuildTrigger trig return createBuildTrigger(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new `BuildTrigger`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   BuildTrigger trigger = BuildTrigger.newBuilder().build();
-   *   CreateBuildTriggerRequest request = CreateBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTrigger(trigger)
-   *     .build();
-   *   BuildTrigger response = cloudBuildClient.createBuildTrigger(request);
-   * }
-   * 
- * * @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 */ @@ -922,48 +578,24 @@ public final BuildTrigger createBuildTrigger(CreateBuildTriggerRequest request) return createBuildTriggerCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new `BuildTrigger`. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   BuildTrigger trigger = BuildTrigger.newBuilder().build();
-   *   CreateBuildTriggerRequest request = CreateBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTrigger(trigger)
-   *     .build();
-   *   ApiFuture<BuildTrigger> future = cloudBuildClient.createBuildTriggerCallable().futureCall(request);
-   *   // Do something
-   *   BuildTrigger response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createBuildTriggerCallable() { return stub.createBuildTriggerCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a `BuildTrigger`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   BuildTrigger response = cloudBuildClient.getBuildTrigger(projectId, triggerId);
-   * }
-   * 
- * * @param projectId Required. ID of the project that owns the trigger. * @param triggerId Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -974,26 +606,12 @@ public final BuildTrigger getBuildTrigger(String projectId, String triggerId) { return getBuildTrigger(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a `BuildTrigger`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   GetBuildTriggerRequest request = GetBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .build();
-   *   BuildTrigger response = cloudBuildClient.getBuildTrigger(request);
-   * }
-   * 
- * * @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 */ @@ -1001,49 +619,24 @@ public final BuildTrigger getBuildTrigger(GetBuildTriggerRequest request) { return getBuildTriggerCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a `BuildTrigger`. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   GetBuildTriggerRequest request = GetBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .build();
-   *   ApiFuture<BuildTrigger> future = cloudBuildClient.getBuildTriggerCallable().futureCall(request);
-   *   // Do something
-   *   BuildTrigger response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getBuildTriggerCallable() { return stub.getBuildTriggerCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists existing `BuildTrigger`s. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   for (BuildTrigger element : cloudBuildClient.listBuildTriggers(projectId).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param projectId Required. ID of the project for which to list BuildTriggers. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1053,26 +646,12 @@ public final ListBuildTriggersPagedResponse listBuildTriggers(String projectId) return listBuildTriggers(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists existing `BuildTrigger`s. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   ListBuildTriggersRequest request = ListBuildTriggersRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .build();
-   *   for (BuildTrigger element : cloudBuildClient.listBuildTriggers(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @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 */ @@ -1080,83 +659,81 @@ public final ListBuildTriggersPagedResponse listBuildTriggers(ListBuildTriggersR return listBuildTriggersPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists existing `BuildTrigger`s. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   ListBuildTriggersRequest request = ListBuildTriggersRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .build();
-   *   ApiFuture<ListBuildTriggersPagedResponse> future = cloudBuildClient.listBuildTriggersPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (BuildTrigger element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listBuildTriggersPagedCallable() { return stub.listBuildTriggersPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists existing `BuildTrigger`s. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   ListBuildTriggersRequest request = ListBuildTriggersRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .build();
-   *   while (true) {
-   *     ListBuildTriggersResponse response = cloudBuildClient.listBuildTriggersCallable().call(request);
-   *     for (BuildTrigger element : response.getTriggersList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listBuildTriggersCallable() { return stub.listBuildTriggersCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a `BuildTrigger` by its project ID and trigger ID. + * Deletes a `BuildTrigger` by its project ID and trigger ID. + * + *

This API is experimental. + * + * @param projectId Required. ID of the project that owns the trigger. + * @param triggerId Required. ID of the `BuildTrigger` to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBuildTrigger(String projectId, String triggerId) { + DeleteBuildTriggerRequest request = + DeleteBuildTriggerRequest.newBuilder() + .setProjectId(projectId) + .setTriggerId(triggerId) + .build(); + deleteBuildTrigger(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a `BuildTrigger` by its project ID and trigger ID. + * + *

This API is experimental. + * + * @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 void deleteBuildTrigger(DeleteBuildTriggerRequest request) { + deleteBuildTriggerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a `BuildTrigger` by its project ID and trigger ID. * *

This API is experimental. * *

Sample code: + */ + public final UnaryCallable deleteBuildTriggerCallable() { + return stub.deleteBuildTriggerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a `BuildTrigger` by its project ID and trigger ID. * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   BuildTrigger trigger = BuildTrigger.newBuilder().build();
-   *   BuildTrigger response = cloudBuildClient.updateBuildTrigger(projectId, triggerId, trigger);
-   * }
-   * 
+ *

This API is experimental. * * @param projectId Required. ID of the project that owns the trigger. * @param triggerId Required. ID of the `BuildTrigger` to update. @@ -1174,28 +751,12 @@ public final BuildTrigger updateBuildTrigger( return updateBuildTrigger(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a `BuildTrigger` by its project ID and trigger ID. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   BuildTrigger trigger = BuildTrigger.newBuilder().build();
-   *   UpdateBuildTriggerRequest request = UpdateBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .setTrigger(trigger)
-   *     .build();
-   *   BuildTrigger response = cloudBuildClient.updateBuildTrigger(request);
-   * }
-   * 
- * * @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 */ @@ -1203,56 +764,27 @@ public final BuildTrigger updateBuildTrigger(UpdateBuildTriggerRequest request) return updateBuildTriggerCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates a `BuildTrigger` by its project ID and trigger ID. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   BuildTrigger trigger = BuildTrigger.newBuilder().build();
-   *   UpdateBuildTriggerRequest request = UpdateBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .setTrigger(trigger)
-   *     .build();
-   *   ApiFuture<BuildTrigger> future = cloudBuildClient.updateBuildTriggerCallable().futureCall(request);
-   *   // Do something
-   *   BuildTrigger response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateBuildTriggerCallable() { return stub.updateBuildTriggerCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs a `BuildTrigger` at a particular source revision. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   RepoSource source = RepoSource.newBuilder().build();
-   *   Build response = cloudBuildClient.runBuildTriggerAsync(projectId, triggerId, source).get();
-   * }
-   * 
- * * @param projectId Required. ID of the project. * @param triggerId Required. ID of the trigger. * @param source Required. Source to build against this trigger. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture runBuildTriggerAsync( String projectId, String triggerId, RepoSource source) { RunBuildTriggerRequest request = @@ -1264,105 +796,45 @@ public final OperationFuture runBuildTriggerAsync return runBuildTriggerAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs a `BuildTrigger` at a particular source revision. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   RepoSource source = RepoSource.newBuilder().build();
-   *   RunBuildTriggerRequest request = RunBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .setSource(source)
-   *     .build();
-   *   Build response = cloudBuildClient.runBuildTriggerAsync(request).get();
-   * }
-   * 
- * * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture runBuildTriggerAsync( RunBuildTriggerRequest request) { return runBuildTriggerOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs a `BuildTrigger` at a particular source revision. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   RepoSource source = RepoSource.newBuilder().build();
-   *   RunBuildTriggerRequest request = RunBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .setSource(source)
-   *     .build();
-   *   OperationFuture<Build, BuildOperationMetadata> future = cloudBuildClient.runBuildTriggerOperationCallable().futureCall(request);
-   *   // Do something
-   *   Build response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable runBuildTriggerOperationCallable() { return stub.runBuildTriggerOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Runs a `BuildTrigger` at a particular source revision. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   String projectId = "";
-   *   String triggerId = "";
-   *   RepoSource source = RepoSource.newBuilder().build();
-   *   RunBuildTriggerRequest request = RunBuildTriggerRequest.newBuilder()
-   *     .setProjectId(projectId)
-   *     .setTriggerId(triggerId)
-   *     .setSource(source)
-   *     .build();
-   *   ApiFuture<Operation> future = cloudBuildClient.runBuildTriggerCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable runBuildTriggerCallable() { return stub.runBuildTriggerCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a `WorkerPool` to run the builds, and returns the new worker pool. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   CreateWorkerPoolRequest request = CreateWorkerPoolRequest.newBuilder().build();
-   *   WorkerPool response = cloudBuildClient.createWorkerPool(request);
-   * }
-   * 
- * * @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 */ @@ -1370,42 +842,24 @@ public final WorkerPool createWorkerPool(CreateWorkerPoolRequest request) { return createWorkerPoolCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a `WorkerPool` to run the builds, and returns the new worker pool. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   CreateWorkerPoolRequest request = CreateWorkerPoolRequest.newBuilder().build();
-   *   ApiFuture<WorkerPool> future = cloudBuildClient.createWorkerPoolCallable().futureCall(request);
-   *   // Do something
-   *   WorkerPool response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createWorkerPoolCallable() { return stub.createWorkerPoolCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a `WorkerPool`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   GetWorkerPoolRequest request = GetWorkerPoolRequest.newBuilder().build();
-   *   WorkerPool response = cloudBuildClient.getWorkerPool(request);
-   * }
-   * 
- * * @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 */ @@ -1413,42 +867,24 @@ public final WorkerPool getWorkerPool(GetWorkerPoolRequest request) { return getWorkerPoolCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns information about a `WorkerPool`. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   GetWorkerPoolRequest request = GetWorkerPoolRequest.newBuilder().build();
-   *   ApiFuture<WorkerPool> future = cloudBuildClient.getWorkerPoolCallable().futureCall(request);
-   *   // Do something
-   *   WorkerPool response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getWorkerPoolCallable() { return stub.getWorkerPoolCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a `WorkerPool` by its project ID and WorkerPool name. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   DeleteWorkerPoolRequest request = DeleteWorkerPoolRequest.newBuilder().build();
-   *   cloudBuildClient.deleteWorkerPool(request);
-   * }
-   * 
- * * @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 */ @@ -1456,42 +892,24 @@ public final void deleteWorkerPool(DeleteWorkerPoolRequest request) { deleteWorkerPoolCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a `WorkerPool` by its project ID and WorkerPool name. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   DeleteWorkerPoolRequest request = DeleteWorkerPoolRequest.newBuilder().build();
-   *   ApiFuture<Void> future = cloudBuildClient.deleteWorkerPoolCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteWorkerPoolCallable() { return stub.deleteWorkerPoolCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a `WorkerPool`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   UpdateWorkerPoolRequest request = UpdateWorkerPoolRequest.newBuilder().build();
-   *   WorkerPool response = cloudBuildClient.updateWorkerPool(request);
-   * }
-   * 
- * * @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 */ @@ -1499,42 +917,24 @@ public final WorkerPool updateWorkerPool(UpdateWorkerPoolRequest request) { return updateWorkerPoolCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Update a `WorkerPool`. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   UpdateWorkerPoolRequest request = UpdateWorkerPoolRequest.newBuilder().build();
-   *   ApiFuture<WorkerPool> future = cloudBuildClient.updateWorkerPoolCallable().futureCall(request);
-   *   // Do something
-   *   WorkerPool response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateWorkerPoolCallable() { return stub.updateWorkerPoolCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List project's `WorkerPools`. * *

This API is experimental. * - *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   ListWorkerPoolsRequest request = ListWorkerPoolsRequest.newBuilder().build();
-   *   ListWorkerPoolsResponse response = cloudBuildClient.listWorkerPools(request);
-   * }
-   * 
- * * @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 */ @@ -1542,22 +942,13 @@ public final ListWorkerPoolsResponse listWorkerPools(ListWorkerPoolsRequest requ return listWorkerPoolsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * List project's `WorkerPools`. * *

This API is experimental. * *

Sample code: - * - *


-   * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
-   *   ListWorkerPoolsRequest request = ListWorkerPoolsRequest.newBuilder().build();
-   *   ApiFuture<ListWorkerPoolsResponse> future = cloudBuildClient.listWorkerPoolsCallable().futureCall(request);
-   *   // Do something
-   *   ListWorkerPoolsResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable listWorkerPoolsCallable() { diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildSettings.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildSettings.java index 9db0d8a1..bcbd31e9 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildSettings.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse; @@ -60,7 +61,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link CloudBuildClient}. * @@ -75,35 +76,24 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteBuildTrigger to 30 seconds: + *

For example, to set the total timeout of getBuild to 30 seconds: * - *

- * 
- * CloudBuildSettings.Builder cloudBuildSettingsBuilder =
- *     CloudBuildSettings.newBuilder();
+ * 
{@code
+ * CloudBuildSettings.Builder cloudBuildSettingsBuilder = CloudBuildSettings.newBuilder();
  * cloudBuildSettingsBuilder
- *     .deleteBuildTriggerSettings()
+ *     .getBuildSettings()
  *     .setRetrySettings(
- *         cloudBuildSettingsBuilder.deleteBuildTriggerSettings().getRetrySettings().toBuilder()
+ *         cloudBuildSettingsBuilder
+ *             .getBuildSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * CloudBuildSettings cloudBuildSettings = cloudBuildSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class CloudBuildSettings extends ClientSettings { - /** Returns the object with the settings used for calls to listBuilds. */ - public PagedCallSettings - listBuildsSettings() { - return ((CloudBuildStubSettings) getStubSettings()).listBuildsSettings(); - } - - /** Returns the object with the settings used for calls to deleteBuildTrigger. */ - public UnaryCallSettings deleteBuildTriggerSettings() { - return ((CloudBuildStubSettings) getStubSettings()).deleteBuildTriggerSettings(); - } /** Returns the object with the settings used for calls to createBuild. */ public UnaryCallSettings createBuildSettings() { @@ -111,8 +101,6 @@ public UnaryCallSettings createBuildSettings() { } /** Returns the object with the settings used for calls to createBuild. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings createBuildOperationSettings() { return ((CloudBuildStubSettings) getStubSettings()).createBuildOperationSettings(); @@ -123,6 +111,12 @@ public UnaryCallSettings getBuildSettings() { return ((CloudBuildStubSettings) getStubSettings()).getBuildSettings(); } + /** Returns the object with the settings used for calls to listBuilds. */ + public PagedCallSettings + listBuildsSettings() { + return ((CloudBuildStubSettings) getStubSettings()).listBuildsSettings(); + } + /** Returns the object with the settings used for calls to cancelBuild. */ public UnaryCallSettings cancelBuildSettings() { return ((CloudBuildStubSettings) getStubSettings()).cancelBuildSettings(); @@ -134,8 +128,6 @@ public UnaryCallSettings retryBuildSettings() { } /** Returns the object with the settings used for calls to retryBuild. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings retryBuildOperationSettings() { return ((CloudBuildStubSettings) getStubSettings()).retryBuildOperationSettings(); @@ -158,6 +150,11 @@ public UnaryCallSettings getBuildTriggerSe return ((CloudBuildStubSettings) getStubSettings()).listBuildTriggersSettings(); } + /** Returns the object with the settings used for calls to deleteBuildTrigger. */ + public UnaryCallSettings deleteBuildTriggerSettings() { + return ((CloudBuildStubSettings) getStubSettings()).deleteBuildTriggerSettings(); + } + /** Returns the object with the settings used for calls to updateBuildTrigger. */ public UnaryCallSettings updateBuildTriggerSettings() { return ((CloudBuildStubSettings) getStubSettings()).updateBuildTriggerSettings(); @@ -169,8 +166,6 @@ public UnaryCallSettings runBuildTriggerSetti } /** Returns the object with the settings used for calls to runBuildTrigger. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings runBuildTriggerOperationSettings() { return ((CloudBuildStubSettings) getStubSettings()).runBuildTriggerOperationSettings(); @@ -261,18 +256,15 @@ protected CloudBuildSettings(Builder settingsBuilder) throws IOException { /** Builder for CloudBuildSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(CloudBuildStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(CloudBuildStubSettings.newBuilder()); - } - protected Builder(CloudBuildSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -281,11 +273,15 @@ protected Builder(CloudBuildStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(CloudBuildStubSettings.newBuilder()); + } + public CloudBuildStubSettings.Builder getStubSettingsBuilder() { return ((CloudBuildStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -298,26 +294,12 @@ public Builder applyToAllUnaryMethods( return this; } - /** Returns the builder for the settings used for calls to listBuilds. */ - public PagedCallSettings.Builder - listBuildsSettings() { - return getStubSettingsBuilder().listBuildsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteBuildTrigger. */ - public UnaryCallSettings.Builder - deleteBuildTriggerSettings() { - return getStubSettingsBuilder().deleteBuildTriggerSettings(); - } - /** Returns the builder for the settings used for calls to createBuild. */ public UnaryCallSettings.Builder createBuildSettings() { return getStubSettingsBuilder().createBuildSettings(); } /** Returns the builder for the settings used for calls to createBuild. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder createBuildOperationSettings() { return getStubSettingsBuilder().createBuildOperationSettings(); @@ -328,6 +310,12 @@ public UnaryCallSettings.Builder getBuildSettings() { return getStubSettingsBuilder().getBuildSettings(); } + /** Returns the builder for the settings used for calls to listBuilds. */ + public PagedCallSettings.Builder + listBuildsSettings() { + return getStubSettingsBuilder().listBuildsSettings(); + } + /** Returns the builder for the settings used for calls to cancelBuild. */ public UnaryCallSettings.Builder cancelBuildSettings() { return getStubSettingsBuilder().cancelBuildSettings(); @@ -339,8 +327,6 @@ public UnaryCallSettings.Builder retryBuildSetting } /** Returns the builder for the settings used for calls to retryBuild. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder retryBuildOperationSettings() { return getStubSettingsBuilder().retryBuildOperationSettings(); @@ -365,6 +351,12 @@ public UnaryCallSettings.Builder retryBuildSetting return getStubSettingsBuilder().listBuildTriggersSettings(); } + /** Returns the builder for the settings used for calls to deleteBuildTrigger. */ + public UnaryCallSettings.Builder + deleteBuildTriggerSettings() { + return getStubSettingsBuilder().deleteBuildTriggerSettings(); + } + /** Returns the builder for the settings used for calls to updateBuildTrigger. */ public UnaryCallSettings.Builder updateBuildTriggerSettings() { @@ -377,8 +369,6 @@ public UnaryCallSettings.Builder runBuildTrig } /** Returns the builder for the settings used for calls to runBuildTrigger. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder runBuildTriggerOperationSettings() { return getStubSettingsBuilder().runBuildTriggerOperationSettings(); diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/package-info.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/package-info.java index 10879727..ef5a18bc 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/package-info.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,11 +15,9 @@ */ /** - * A client to Cloud Build API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

================ CloudBuildClient ================ + *

======================= CloudBuildClient ======================= * *

Service Description: Creates and manages builds on Google Cloud Platform. * @@ -30,18 +28,8 @@ * of the build. * *

Sample for CloudBuildClient: - * - *

- * 
- * try (CloudBuildClient cloudBuildClient = CloudBuildClient.create()) {
- *   String projectId = "";
- *   String triggerId = "";
- *   cloudBuildClient.deleteBuildTrigger(projectId, triggerId);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.devtools.cloudbuild.v1; import javax.annotation.Generated; diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStub.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStub.java index 64d7a9de..81bd9be6 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStub.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1.stub; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -50,34 +50,19 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Cloud Build API. + * Base stub class for the CloudBuild service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class CloudBuildStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } - public UnaryCallable listBuildsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listBuildsPagedCallable()"); - } - - public UnaryCallable listBuildsCallable() { - throw new UnsupportedOperationException("Not implemented: listBuildsCallable()"); - } - - public UnaryCallable deleteBuildTriggerCallable() { - throw new UnsupportedOperationException("Not implemented: deleteBuildTriggerCallable()"); - } - - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createBuildOperationCallable() { throw new UnsupportedOperationException("Not implemented: createBuildOperationCallable()"); @@ -91,11 +76,18 @@ public UnaryCallable getBuildCallable() { throw new UnsupportedOperationException("Not implemented: getBuildCallable()"); } + public UnaryCallable listBuildsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBuildsPagedCallable()"); + } + + public UnaryCallable listBuildsCallable() { + throw new UnsupportedOperationException("Not implemented: listBuildsCallable()"); + } + public UnaryCallable cancelBuildCallable() { throw new UnsupportedOperationException("Not implemented: cancelBuildCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable retryBuildOperationCallable() { throw new UnsupportedOperationException("Not implemented: retryBuildOperationCallable()"); @@ -123,11 +115,14 @@ public UnaryCallable getBuildTriggerCallab throw new UnsupportedOperationException("Not implemented: listBuildTriggersCallable()"); } + public UnaryCallable deleteBuildTriggerCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBuildTriggerCallable()"); + } + public UnaryCallable updateBuildTriggerCallable() { throw new UnsupportedOperationException("Not implemented: updateBuildTriggerCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable runBuildTriggerOperationCallable() { throw new UnsupportedOperationException("Not implemented: runBuildTriggerOperationCallable()"); diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStubSettings.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStubSettings.java index e7ef2f3e..b2a0d56f 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStubSettings.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/CloudBuildStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1.stub; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse; @@ -78,7 +79,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link CloudBuildStub}. * @@ -93,36 +94,35 @@ *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

For example, to set the total timeout of deleteBuildTrigger to 30 seconds: + *

For example, to set the total timeout of getBuild to 30 seconds: * - *

- * 
- * CloudBuildStubSettings.Builder cloudBuildSettingsBuilder =
- *     CloudBuildStubSettings.newBuilder();
+ * 
{@code
+ * CloudBuildStubSettings.Builder cloudBuildSettingsBuilder = CloudBuildStubSettings.newBuilder();
  * cloudBuildSettingsBuilder
- *     .deleteBuildTriggerSettings()
+ *     .getBuildSettings()
  *     .setRetrySettings(
- *         cloudBuildSettingsBuilder.deleteBuildTriggerSettings().getRetrySettings().toBuilder()
+ *         cloudBuildSettingsBuilder
+ *             .getBuildSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * CloudBuildStubSettings cloudBuildSettings = cloudBuildSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class CloudBuildStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - private final PagedCallSettings - listBuildsSettings; - private final UnaryCallSettings deleteBuildTriggerSettings; private final UnaryCallSettings createBuildSettings; private final OperationCallSettings createBuildOperationSettings; private final UnaryCallSettings getBuildSettings; + private final PagedCallSettings + listBuildsSettings; private final UnaryCallSettings cancelBuildSettings; private final UnaryCallSettings retryBuildSettings; private final OperationCallSettings @@ -133,6 +133,7 @@ public class CloudBuildStubSettings extends StubSettings private final PagedCallSettings< ListBuildTriggersRequest, ListBuildTriggersResponse, ListBuildTriggersPagedResponse> listBuildTriggersSettings; + private final UnaryCallSettings deleteBuildTriggerSettings; private final UnaryCallSettings updateBuildTriggerSettings; private final UnaryCallSettings runBuildTriggerSettings; @@ -145,16 +146,119 @@ public class CloudBuildStubSettings extends StubSettings private final UnaryCallSettings listWorkerPoolsSettings; - /** Returns the object with the settings used for calls to listBuilds. */ - public PagedCallSettings - listBuildsSettings() { - return listBuildsSettings; - } + private static final PagedListDescriptor + LIST_BUILDS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } - /** Returns the object with the settings used for calls to deleteBuildTrigger. */ - public UnaryCallSettings deleteBuildTriggerSettings() { - return deleteBuildTriggerSettings; - } + @Override + public ListBuildsRequest injectToken(ListBuildsRequest payload, String token) { + return ListBuildsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBuildsRequest injectPageSize(ListBuildsRequest payload, int pageSize) { + return ListBuildsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBuildsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBuildsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBuildsResponse payload) { + return payload.getBuildsList() == null + ? ImmutableList.of() + : payload.getBuildsList(); + } + }; + + private static final PagedListDescriptor< + ListBuildTriggersRequest, ListBuildTriggersResponse, BuildTrigger> + LIST_BUILD_TRIGGERS_PAGE_STR_DESC = + new PagedListDescriptor< + ListBuildTriggersRequest, ListBuildTriggersResponse, BuildTrigger>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBuildTriggersRequest injectToken( + ListBuildTriggersRequest payload, String token) { + return ListBuildTriggersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBuildTriggersRequest injectPageSize( + ListBuildTriggersRequest payload, int pageSize) { + return ListBuildTriggersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBuildTriggersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBuildTriggersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBuildTriggersResponse payload) { + return payload.getTriggersList() == null + ? ImmutableList.of() + : payload.getTriggersList(); + } + }; + + private static final PagedListResponseFactory< + ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse> + LIST_BUILDS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBuildsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BUILDS_PAGE_STR_DESC, request, context); + return ListBuildsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBuildTriggersRequest, ListBuildTriggersResponse, ListBuildTriggersPagedResponse> + LIST_BUILD_TRIGGERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBuildTriggersRequest, + ListBuildTriggersResponse, + ListBuildTriggersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBuildTriggersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_BUILD_TRIGGERS_PAGE_STR_DESC, request, context); + return ListBuildTriggersPagedResponse.createAsync(pageContext, futureResponse); + } + }; /** Returns the object with the settings used for calls to createBuild. */ public UnaryCallSettings createBuildSettings() { @@ -162,7 +266,6 @@ public UnaryCallSettings createBuildSettings() { } /** Returns the object with the settings used for calls to createBuild. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings createBuildOperationSettings() { return createBuildOperationSettings; @@ -173,6 +276,12 @@ public UnaryCallSettings getBuildSettings() { return getBuildSettings; } + /** Returns the object with the settings used for calls to listBuilds. */ + public PagedCallSettings + listBuildsSettings() { + return listBuildsSettings; + } + /** Returns the object with the settings used for calls to cancelBuild. */ public UnaryCallSettings cancelBuildSettings() { return cancelBuildSettings; @@ -184,7 +293,6 @@ public UnaryCallSettings retryBuildSettings() { } /** Returns the object with the settings used for calls to retryBuild. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings retryBuildOperationSettings() { return retryBuildOperationSettings; @@ -207,6 +315,11 @@ public UnaryCallSettings getBuildTriggerSe return listBuildTriggersSettings; } + /** Returns the object with the settings used for calls to deleteBuildTrigger. */ + public UnaryCallSettings deleteBuildTriggerSettings() { + return deleteBuildTriggerSettings; + } + /** Returns the object with the settings used for calls to updateBuildTrigger. */ public UnaryCallSettings updateBuildTriggerSettings() { return updateBuildTriggerSettings; @@ -218,7 +331,6 @@ public UnaryCallSettings runBuildTriggerSetti } /** Returns the object with the settings used for calls to runBuildTrigger. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings runBuildTriggerOperationSettings() { return runBuildTriggerOperationSettings; @@ -256,10 +368,10 @@ public CloudBuildStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcCloudBuildStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -319,17 +431,17 @@ public Builder toBuilder() { protected CloudBuildStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); - listBuildsSettings = settingsBuilder.listBuildsSettings().build(); - deleteBuildTriggerSettings = settingsBuilder.deleteBuildTriggerSettings().build(); createBuildSettings = settingsBuilder.createBuildSettings().build(); createBuildOperationSettings = settingsBuilder.createBuildOperationSettings().build(); getBuildSettings = settingsBuilder.getBuildSettings().build(); + listBuildsSettings = settingsBuilder.listBuildsSettings().build(); cancelBuildSettings = settingsBuilder.cancelBuildSettings().build(); retryBuildSettings = settingsBuilder.retryBuildSettings().build(); retryBuildOperationSettings = settingsBuilder.retryBuildOperationSettings().build(); createBuildTriggerSettings = settingsBuilder.createBuildTriggerSettings().build(); getBuildTriggerSettings = settingsBuilder.getBuildTriggerSettings().build(); listBuildTriggersSettings = settingsBuilder.listBuildTriggersSettings().build(); + deleteBuildTriggerSettings = settingsBuilder.deleteBuildTriggerSettings().build(); updateBuildTriggerSettings = settingsBuilder.updateBuildTriggerSettings().build(); runBuildTriggerSettings = settingsBuilder.runBuildTriggerSettings().build(); runBuildTriggerOperationSettings = settingsBuilder.runBuildTriggerOperationSettings().build(); @@ -340,133 +452,16 @@ protected CloudBuildStubSettings(Builder settingsBuilder) throws IOException { listWorkerPoolsSettings = settingsBuilder.listWorkerPoolsSettings().build(); } - private static final PagedListDescriptor - LIST_BUILDS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListBuildsRequest injectToken(ListBuildsRequest payload, String token) { - return ListBuildsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListBuildsRequest injectPageSize(ListBuildsRequest payload, int pageSize) { - return ListBuildsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListBuildsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListBuildsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListBuildsResponse payload) { - return payload.getBuildsList() != null - ? payload.getBuildsList() - : ImmutableList.of(); - } - }; - - private static final PagedListDescriptor< - ListBuildTriggersRequest, ListBuildTriggersResponse, BuildTrigger> - LIST_BUILD_TRIGGERS_PAGE_STR_DESC = - new PagedListDescriptor< - ListBuildTriggersRequest, ListBuildTriggersResponse, BuildTrigger>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListBuildTriggersRequest injectToken( - ListBuildTriggersRequest payload, String token) { - return ListBuildTriggersRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListBuildTriggersRequest injectPageSize( - ListBuildTriggersRequest payload, int pageSize) { - return ListBuildTriggersRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListBuildTriggersRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListBuildTriggersResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListBuildTriggersResponse payload) { - return payload.getTriggersList() != null - ? payload.getTriggersList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse> - LIST_BUILDS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBuildsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_BUILDS_PAGE_STR_DESC, request, context); - return ListBuildsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListBuildTriggersRequest, ListBuildTriggersResponse, ListBuildTriggersPagedResponse> - LIST_BUILD_TRIGGERS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListBuildTriggersRequest, - ListBuildTriggersResponse, - ListBuildTriggersPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBuildTriggersRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_BUILD_TRIGGERS_PAGE_STR_DESC, request, context); - return ListBuildTriggersPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for CloudBuildStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - - private final PagedCallSettings.Builder< - ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse> - listBuildsSettings; - private final UnaryCallSettings.Builder - deleteBuildTriggerSettings; private final UnaryCallSettings.Builder createBuildSettings; private final OperationCallSettings.Builder createBuildOperationSettings; private final UnaryCallSettings.Builder getBuildSettings; + private final PagedCallSettings.Builder< + ListBuildsRequest, ListBuildsResponse, ListBuildsPagedResponse> + listBuildsSettings; private final UnaryCallSettings.Builder cancelBuildSettings; private final UnaryCallSettings.Builder retryBuildSettings; private final OperationCallSettings.Builder @@ -478,6 +473,8 @@ public static class Builder extends StubSettings.Builder listBuildTriggersSettings; + private final UnaryCallSettings.Builder + deleteBuildTriggerSettings; private final UnaryCallSettings.Builder updateBuildTriggerSettings; private final UnaryCallSettings.Builder @@ -494,7 +491,6 @@ public static class Builder extends StubSettings.Builder listWorkerPoolsSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -502,13 +498,12 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -519,84 +514,108 @@ public static class Builder extends StubSettings.Builder>of( + createBuildSettings, + getBuildSettings, listBuildsSettings, + cancelBuildSettings, + retryBuildSettings, + createBuildTriggerSettings, + getBuildTriggerSettings, + listBuildTriggersSettings, deleteBuildTriggerSettings, + updateBuildTriggerSettings, + runBuildTriggerSettings, + createWorkerPoolSettings, + getWorkerPoolSettings, + deleteWorkerPoolSettings, + updateWorkerPoolSettings, + listWorkerPoolsSettings); + initDefaults(this); + } + + protected Builder(CloudBuildStubSettings settings) { + super(settings); + + createBuildSettings = settings.createBuildSettings.toBuilder(); + createBuildOperationSettings = settings.createBuildOperationSettings.toBuilder(); + getBuildSettings = settings.getBuildSettings.toBuilder(); + listBuildsSettings = settings.listBuildsSettings.toBuilder(); + cancelBuildSettings = settings.cancelBuildSettings.toBuilder(); + retryBuildSettings = settings.retryBuildSettings.toBuilder(); + retryBuildOperationSettings = settings.retryBuildOperationSettings.toBuilder(); + createBuildTriggerSettings = settings.createBuildTriggerSettings.toBuilder(); + getBuildTriggerSettings = settings.getBuildTriggerSettings.toBuilder(); + listBuildTriggersSettings = settings.listBuildTriggersSettings.toBuilder(); + deleteBuildTriggerSettings = settings.deleteBuildTriggerSettings.toBuilder(); + updateBuildTriggerSettings = settings.updateBuildTriggerSettings.toBuilder(); + runBuildTriggerSettings = settings.runBuildTriggerSettings.toBuilder(); + runBuildTriggerOperationSettings = settings.runBuildTriggerOperationSettings.toBuilder(); + createWorkerPoolSettings = settings.createWorkerPoolSettings.toBuilder(); + getWorkerPoolSettings = settings.getWorkerPoolSettings.toBuilder(); + deleteWorkerPoolSettings = settings.deleteWorkerPoolSettings.toBuilder(); + updateWorkerPoolSettings = settings.updateWorkerPoolSettings.toBuilder(); + listWorkerPoolsSettings = settings.listWorkerPoolsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( createBuildSettings, getBuildSettings, + listBuildsSettings, cancelBuildSettings, retryBuildSettings, createBuildTriggerSettings, getBuildTriggerSettings, listBuildTriggersSettings, + deleteBuildTriggerSettings, updateBuildTriggerSettings, runBuildTriggerSettings, createWorkerPoolSettings, @@ -604,31 +623,20 @@ protected Builder(ClientContext clientContext) { deleteWorkerPoolSettings, updateWorkerPoolSettings, listWorkerPoolsSettings); - - initDefaults(this); } private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - - builder - .listBuildsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .deleteBuildTriggerSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - builder .createBuildSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) @@ -636,8 +644,13 @@ private static Builder initDefaults(Builder builder) { builder .getBuildSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listBuildsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .cancelBuildSettings() @@ -656,13 +669,18 @@ private static Builder initDefaults(Builder builder) { builder .getBuildTriggerSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listBuildTriggersSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteBuildTriggerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateBuildTriggerSettings() @@ -681,8 +699,8 @@ private static Builder initDefaults(Builder builder) { builder .getWorkerPoolSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteWorkerPoolSettings() @@ -696,8 +714,9 @@ private static Builder initDefaults(Builder builder) { builder .listWorkerPoolsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createBuildOperationSettings() .setInitialCallSettings( @@ -712,14 +731,15 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .retryBuildOperationSettings() .setInitialCallSettings( @@ -734,14 +754,15 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .runBuildTriggerOperationSettings() .setInitialCallSettings( @@ -757,62 +778,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(CloudBuildStubSettings settings) { - super(settings); - - listBuildsSettings = settings.listBuildsSettings.toBuilder(); - deleteBuildTriggerSettings = settings.deleteBuildTriggerSettings.toBuilder(); - createBuildSettings = settings.createBuildSettings.toBuilder(); - createBuildOperationSettings = settings.createBuildOperationSettings.toBuilder(); - getBuildSettings = settings.getBuildSettings.toBuilder(); - cancelBuildSettings = settings.cancelBuildSettings.toBuilder(); - retryBuildSettings = settings.retryBuildSettings.toBuilder(); - retryBuildOperationSettings = settings.retryBuildOperationSettings.toBuilder(); - createBuildTriggerSettings = settings.createBuildTriggerSettings.toBuilder(); - getBuildTriggerSettings = settings.getBuildTriggerSettings.toBuilder(); - listBuildTriggersSettings = settings.listBuildTriggersSettings.toBuilder(); - updateBuildTriggerSettings = settings.updateBuildTriggerSettings.toBuilder(); - runBuildTriggerSettings = settings.runBuildTriggerSettings.toBuilder(); - runBuildTriggerOperationSettings = settings.runBuildTriggerOperationSettings.toBuilder(); - createWorkerPoolSettings = settings.createWorkerPoolSettings.toBuilder(); - getWorkerPoolSettings = settings.getWorkerPoolSettings.toBuilder(); - deleteWorkerPoolSettings = settings.deleteWorkerPoolSettings.toBuilder(); - updateWorkerPoolSettings = settings.updateWorkerPoolSettings.toBuilder(); - listWorkerPoolsSettings = settings.listWorkerPoolsSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listBuildsSettings, - deleteBuildTriggerSettings, - createBuildSettings, - getBuildSettings, - cancelBuildSettings, - retryBuildSettings, - createBuildTriggerSettings, - getBuildTriggerSettings, - listBuildTriggersSettings, - updateBuildTriggerSettings, - runBuildTriggerSettings, - createWorkerPoolSettings, - getWorkerPoolSettings, - deleteWorkerPoolSettings, - updateWorkerPoolSettings, - listWorkerPoolsSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -828,18 +806,6 @@ public Builder applyToAllUnaryMethods( return unaryMethodSettingsBuilders; } - /** Returns the builder for the settings used for calls to listBuilds. */ - public PagedCallSettings.Builder - listBuildsSettings() { - return listBuildsSettings; - } - - /** Returns the builder for the settings used for calls to deleteBuildTrigger. */ - public UnaryCallSettings.Builder - deleteBuildTriggerSettings() { - return deleteBuildTriggerSettings; - } - /** Returns the builder for the settings used for calls to createBuild. */ public UnaryCallSettings.Builder createBuildSettings() { return createBuildSettings; @@ -858,6 +824,12 @@ public UnaryCallSettings.Builder getBuildSettings() { return getBuildSettings; } + /** Returns the builder for the settings used for calls to listBuilds. */ + public PagedCallSettings.Builder + listBuildsSettings() { + return listBuildsSettings; + } + /** Returns the builder for the settings used for calls to cancelBuild. */ public UnaryCallSettings.Builder cancelBuildSettings() { return cancelBuildSettings; @@ -895,6 +867,12 @@ public UnaryCallSettings.Builder retryBuildSetting return listBuildTriggersSettings; } + /** Returns the builder for the settings used for calls to deleteBuildTrigger. */ + public UnaryCallSettings.Builder + deleteBuildTriggerSettings() { + return deleteBuildTriggerSettings; + } + /** Returns the builder for the settings used for calls to updateBuildTrigger. */ public UnaryCallSettings.Builder updateBuildTriggerSettings() { diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildCallableFactory.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildCallableFactory.java index befd88f1..e76f31fd 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildCallableFactory.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Cloud Build API. + * gRPC callable factory implementation for the CloudBuild service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcCloudBuildCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildStub.java b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildStub.java index 861976a5..c20c61f6 100644 --- a/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildStub.java +++ b/google-cloud-build/src/main/java/com/google/cloud/devtools/cloudbuild/v1/stub/GrpcCloudBuildStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1.stub; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -61,33 +61,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Cloud Build API. + * gRPC stub implementation for the CloudBuild service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcCloudBuildStub extends CloudBuildStub { - - private static final MethodDescriptor - listBuildsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.devtools.cloudbuild.v1.CloudBuild/ListBuilds") - .setRequestMarshaller(ProtoUtils.marshaller(ListBuildsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListBuildsResponse.getDefaultInstance())) - .build(); - private static final MethodDescriptor - deleteBuildTriggerMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteBuildTriggerRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); private static final MethodDescriptor createBuildMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -95,6 +76,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateBuildRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor getBuildMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -102,6 +84,16 @@ public class GrpcCloudBuildStub extends CloudBuildStub { .setRequestMarshaller(ProtoUtils.marshaller(GetBuildRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Build.getDefaultInstance())) .build(); + + private static final MethodDescriptor + listBuildsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v1.CloudBuild/ListBuilds") + .setRequestMarshaller(ProtoUtils.marshaller(ListBuildsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListBuildsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor cancelBuildMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -109,6 +101,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { .setRequestMarshaller(ProtoUtils.marshaller(CancelBuildRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Build.getDefaultInstance())) .build(); + private static final MethodDescriptor retryBuildMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -116,6 +109,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { .setRequestMarshaller(ProtoUtils.marshaller(RetryBuildRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor createBuildTriggerMethodDescriptor = MethodDescriptor.newBuilder() @@ -125,6 +119,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(CreateBuildTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BuildTrigger.getDefaultInstance())) .build(); + private static final MethodDescriptor getBuildTriggerMethodDescriptor = MethodDescriptor.newBuilder() @@ -134,6 +129,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(GetBuildTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BuildTrigger.getDefaultInstance())) .build(); + private static final MethodDescriptor listBuildTriggersMethodDescriptor = MethodDescriptor.newBuilder() @@ -144,6 +140,17 @@ public class GrpcCloudBuildStub extends CloudBuildStub { .setResponseMarshaller( ProtoUtils.marshaller(ListBuildTriggersResponse.getDefaultInstance())) .build(); + + private static final MethodDescriptor + deleteBuildTriggerMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteBuildTriggerRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateBuildTriggerMethodDescriptor = MethodDescriptor.newBuilder() @@ -153,6 +160,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(UpdateBuildTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BuildTrigger.getDefaultInstance())) .build(); + private static final MethodDescriptor runBuildTriggerMethodDescriptor = MethodDescriptor.newBuilder() @@ -162,6 +170,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(RunBuildTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor createWorkerPoolMethodDescriptor = MethodDescriptor.newBuilder() @@ -171,6 +180,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(CreateWorkerPoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(WorkerPool.getDefaultInstance())) .build(); + private static final MethodDescriptor getWorkerPoolMethodDescriptor = MethodDescriptor.newBuilder() @@ -180,6 +190,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(GetWorkerPoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(WorkerPool.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteWorkerPoolMethodDescriptor = MethodDescriptor.newBuilder() @@ -189,6 +200,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(DeleteWorkerPoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor updateWorkerPoolMethodDescriptor = MethodDescriptor.newBuilder() @@ -198,6 +210,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(UpdateWorkerPoolRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(WorkerPool.getDefaultInstance())) .build(); + private static final MethodDescriptor listWorkerPoolsMethodDescriptor = MethodDescriptor.newBuilder() @@ -209,16 +222,12 @@ public class GrpcCloudBuildStub extends CloudBuildStub { ProtoUtils.marshaller(ListWorkerPoolsResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - - private final UnaryCallable listBuildsCallable; - private final UnaryCallable listBuildsPagedCallable; - private final UnaryCallable deleteBuildTriggerCallable; private final UnaryCallable createBuildCallable; private final OperationCallable createBuildOperationCallable; private final UnaryCallable getBuildCallable; + private final UnaryCallable listBuildsCallable; + private final UnaryCallable listBuildsPagedCallable; private final UnaryCallable cancelBuildCallable; private final UnaryCallable retryBuildCallable; private final OperationCallable @@ -229,6 +238,7 @@ public class GrpcCloudBuildStub extends CloudBuildStub { listBuildTriggersCallable; private final UnaryCallable listBuildTriggersPagedCallable; + private final UnaryCallable deleteBuildTriggerCallable; private final UnaryCallable updateBuildTriggerCallable; private final UnaryCallable runBuildTriggerCallable; private final OperationCallable @@ -240,6 +250,8 @@ public class GrpcCloudBuildStub extends CloudBuildStub { private final UnaryCallable listWorkerPoolsCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcCloudBuildStub create(CloudBuildStubSettings settings) @@ -280,24 +292,6 @@ protected GrpcCloudBuildStub( this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - GrpcCallSettings listBuildsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listBuildsMethodDescriptor) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListBuildsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("project_id", String.valueOf(request.getProjectId())); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } - }) - .build(); - GrpcCallSettings deleteBuildTriggerTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteBuildTriggerMethodDescriptor) - .build(); GrpcCallSettings createBuildTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createBuildMethodDescriptor) @@ -306,8 +300,8 @@ public Map extract(ListBuildsRequest request) { @Override public Map extract(CreateBuildRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("project_id", String.valueOf(request.getProjectId())); params.put("parent", String.valueOf(request.getParent())); + params.put("project_id", String.valueOf(request.getProjectId())); return params.build(); } }) @@ -320,7 +314,23 @@ public Map extract(CreateBuildRequest request) { @Override public Map extract(GetBuildRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("id", String.valueOf(request.getId())); params.put("name", String.valueOf(request.getName())); + params.put("project_id", String.valueOf(request.getProjectId())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listBuildsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBuildsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListBuildsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + params.put("project_id", String.valueOf(request.getProjectId())); return params.build(); } }) @@ -333,7 +343,9 @@ public Map extract(GetBuildRequest request) { @Override public Map extract(CancelBuildRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("id", String.valueOf(request.getId())); params.put("name", String.valueOf(request.getName())); + params.put("project_id", String.valueOf(request.getProjectId())); return params.build(); } }) @@ -346,7 +358,9 @@ public Map extract(CancelBuildRequest request) { @Override public Map extract(RetryBuildRequest request) { ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("id", String.valueOf(request.getId())); params.put("name", String.valueOf(request.getName())); + params.put("project_id", String.valueOf(request.getProjectId())); return params.build(); } }) @@ -367,6 +381,16 @@ public Map extract(CreateBuildTriggerRequest request) { GrpcCallSettings getBuildTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getBuildTriggerMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetBuildTriggerRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + params.put("trigger_id", String.valueOf(request.getTriggerId())); + return params.build(); + } + }) .build(); GrpcCallSettings listBuildTriggersTransportSettings = @@ -382,13 +406,47 @@ public Map extract(ListBuildTriggersRequest request) { } }) .build(); + GrpcCallSettings deleteBuildTriggerTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBuildTriggerMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteBuildTriggerRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + params.put("trigger_id", String.valueOf(request.getTriggerId())); + return params.build(); + } + }) + .build(); GrpcCallSettings updateBuildTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateBuildTriggerMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateBuildTriggerRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + params.put("trigger_id", String.valueOf(request.getTriggerId())); + return params.build(); + } + }) .build(); GrpcCallSettings runBuildTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(runBuildTriggerMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(RunBuildTriggerRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project_id", String.valueOf(request.getProjectId())); + params.put("trigger_id", String.valueOf(request.getTriggerId())); + return params.build(); + } + }) .build(); GrpcCallSettings createWorkerPoolTransportSettings = GrpcCallSettings.newBuilder() @@ -412,17 +470,6 @@ public Map extract(ListBuildTriggersRequest request) { .setMethodDescriptor(listWorkerPoolsMethodDescriptor) .build(); - this.listBuildsCallable = - callableFactory.createUnaryCallable( - listBuildsTransportSettings, settings.listBuildsSettings(), clientContext); - this.listBuildsPagedCallable = - callableFactory.createPagedCallable( - listBuildsTransportSettings, settings.listBuildsSettings(), clientContext); - this.deleteBuildTriggerCallable = - callableFactory.createUnaryCallable( - deleteBuildTriggerTransportSettings, - settings.deleteBuildTriggerSettings(), - clientContext); this.createBuildCallable = callableFactory.createUnaryCallable( createBuildTransportSettings, settings.createBuildSettings(), clientContext); @@ -431,10 +478,16 @@ public Map extract(ListBuildTriggersRequest request) { createBuildTransportSettings, settings.createBuildOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.getBuildCallable = callableFactory.createUnaryCallable( getBuildTransportSettings, settings.getBuildSettings(), clientContext); + this.listBuildsCallable = + callableFactory.createUnaryCallable( + listBuildsTransportSettings, settings.listBuildsSettings(), clientContext); + this.listBuildsPagedCallable = + callableFactory.createPagedCallable( + listBuildsTransportSettings, settings.listBuildsSettings(), clientContext); this.cancelBuildCallable = callableFactory.createUnaryCallable( cancelBuildTransportSettings, settings.cancelBuildSettings(), clientContext); @@ -446,7 +499,7 @@ public Map extract(ListBuildTriggersRequest request) { retryBuildTransportSettings, settings.retryBuildOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.createBuildTriggerCallable = callableFactory.createUnaryCallable( createBuildTriggerTransportSettings, @@ -465,6 +518,11 @@ public Map extract(ListBuildTriggersRequest request) { listBuildTriggersTransportSettings, settings.listBuildTriggersSettings(), clientContext); + this.deleteBuildTriggerCallable = + callableFactory.createUnaryCallable( + deleteBuildTriggerTransportSettings, + settings.deleteBuildTriggerSettings(), + clientContext); this.updateBuildTriggerCallable = callableFactory.createUnaryCallable( updateBuildTriggerTransportSettings, @@ -478,7 +536,7 @@ public Map extract(ListBuildTriggersRequest request) { runBuildTriggerTransportSettings, settings.runBuildTriggerOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.createWorkerPoolCallable = callableFactory.createUnaryCallable( createWorkerPoolTransportSettings, settings.createWorkerPoolSettings(), clientContext); @@ -495,54 +553,48 @@ public Map extract(ListBuildTriggersRequest request) { callableFactory.createUnaryCallable( listWorkerPoolsTransportSettings, settings.listWorkerPoolsSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable listBuildsPagedCallable() { - return listBuildsPagedCallable; - } - - public UnaryCallable listBuildsCallable() { - return listBuildsCallable; - } - - public UnaryCallable deleteBuildTriggerCallable() { - return deleteBuildTriggerCallable; + public UnaryCallable createBuildCallable() { + return createBuildCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createBuildOperationCallable() { return createBuildOperationCallable; } - public UnaryCallable createBuildCallable() { - return createBuildCallable; - } - public UnaryCallable getBuildCallable() { return getBuildCallable; } + public UnaryCallable listBuildsCallable() { + return listBuildsCallable; + } + + public UnaryCallable listBuildsPagedCallable() { + return listBuildsPagedCallable; + } + public UnaryCallable cancelBuildCallable() { return cancelBuildCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable retryBuildCallable() { + return retryBuildCallable; + } + public OperationCallable retryBuildOperationCallable() { return retryBuildOperationCallable; } - public UnaryCallable retryBuildCallable() { - return retryBuildCallable; - } - public UnaryCallable createBuildTriggerCallable() { return createBuildTriggerCallable; } @@ -551,30 +603,33 @@ public UnaryCallable getBuildTriggerCallab return getBuildTriggerCallable; } + public UnaryCallable + listBuildTriggersCallable() { + return listBuildTriggersCallable; + } + public UnaryCallable listBuildTriggersPagedCallable() { return listBuildTriggersPagedCallable; } - public UnaryCallable - listBuildTriggersCallable() { - return listBuildTriggersCallable; + public UnaryCallable deleteBuildTriggerCallable() { + return deleteBuildTriggerCallable; } public UnaryCallable updateBuildTriggerCallable() { return updateBuildTriggerCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable runBuildTriggerCallable() { + return runBuildTriggerCallable; + } + public OperationCallable runBuildTriggerOperationCallable() { return runBuildTriggerOperationCallable; } - public UnaryCallable runBuildTriggerCallable() { - return runBuildTriggerCallable; - } - public UnaryCallable createWorkerPoolCallable() { return createWorkerPoolCallable; } diff --git a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java index 5dd4bbe5..b899d388 100644 --- a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java +++ b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/CloudBuildClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1; import static com.google.cloud.devtools.cloudbuild.v1.CloudBuildClient.ListBuildTriggersPagedResponse; @@ -26,10 +27,12 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; +import com.google.cloudbuild.v1.Artifacts; import com.google.cloudbuild.v1.Build; import com.google.cloudbuild.v1.BuildName; +import com.google.cloudbuild.v1.BuildOptions; +import com.google.cloudbuild.v1.BuildStep; import com.google.cloudbuild.v1.BuildTrigger; -import com.google.cloudbuild.v1.BuildTriggerName; import com.google.cloudbuild.v1.CancelBuildRequest; import com.google.cloudbuild.v1.CreateBuildRequest; import com.google.cloudbuild.v1.CreateBuildTriggerRequest; @@ -39,6 +42,7 @@ import com.google.cloudbuild.v1.GetBuildRequest; import com.google.cloudbuild.v1.GetBuildTriggerRequest; import com.google.cloudbuild.v1.GetWorkerPoolRequest; +import com.google.cloudbuild.v1.GitHubEventsConfig; import com.google.cloudbuild.v1.ListBuildTriggersRequest; import com.google.cloudbuild.v1.ListBuildTriggersResponse; import com.google.cloudbuild.v1.ListBuildsRequest; @@ -46,24 +50,33 @@ import com.google.cloudbuild.v1.ListWorkerPoolsRequest; import com.google.cloudbuild.v1.ListWorkerPoolsResponse; import com.google.cloudbuild.v1.RepoSource; +import com.google.cloudbuild.v1.Results; import com.google.cloudbuild.v1.RetryBuildRequest; import com.google.cloudbuild.v1.RunBuildTriggerRequest; -import com.google.cloudbuild.v1.ServiceAccountName; +import com.google.cloudbuild.v1.Secret; +import com.google.cloudbuild.v1.Source; +import com.google.cloudbuild.v1.SourceProvenance; +import com.google.cloudbuild.v1.TimeSpan; import com.google.cloudbuild.v1.UpdateBuildTriggerRequest; import com.google.cloudbuild.v1.UpdateWorkerPoolRequest; +import com.google.cloudbuild.v1.WorkerConfig; import com.google.cloudbuild.v1.WorkerPool; import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -71,31 +84,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class CloudBuildClientTest { - private static MockCloudBuild mockCloudBuild; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private CloudBuildClient client; + private static MockCloudBuild mockCloudBuild; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { mockCloudBuild = new MockCloudBuild(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockCloudBuild)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); CloudBuildSettings settings = CloudBuildSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -110,117 +123,33 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listBuildsTest() { - String nextPageToken = ""; - Build buildsElement = Build.newBuilder().build(); - List builds = Arrays.asList(buildsElement); - ListBuildsResponse expectedResponse = - ListBuildsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllBuilds(builds) - .build(); - mockCloudBuild.addResponse(expectedResponse); - - String projectId = "projectId-1969970175"; - String filter = "filter-1274492040"; - - ListBuildsPagedResponse pagedListResponse = client.listBuilds(projectId, filter); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBuildsList().get(0), resources.get(0)); - - List actualRequests = mockCloudBuild.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBuildsRequest actualRequest = (ListBuildsRequest) actualRequests.get(0); - - Assert.assertEquals(projectId, actualRequest.getProjectId()); - Assert.assertEquals(filter, actualRequest.getFilter()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void listBuildsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockCloudBuild.addException(exception); - - try { - String projectId = "projectId-1969970175"; - String filter = "filter-1274492040"; - - client.listBuilds(projectId, filter); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") - public void deleteBuildTriggerTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockCloudBuild.addResponse(expectedResponse); - - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; - - client.deleteBuildTrigger(projectId, triggerId); - - List actualRequests = mockCloudBuild.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBuildTriggerRequest actualRequest = (DeleteBuildTriggerRequest) actualRequests.get(0); - - Assert.assertEquals(projectId, actualRequest.getProjectId()); - Assert.assertEquals(triggerId, actualRequest.getTriggerId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void deleteBuildTriggerExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockCloudBuild.addException(exception); - - try { - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; - - client.deleteBuildTrigger(projectId, triggerId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - - @Test - @SuppressWarnings("all") public void createBuildTest() throws Exception { - BuildName name = BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]"); - String id = "id3355"; - String projectId2 = "projectId2939242356"; - String statusDetail = "statusDetail2089931070"; - String logsBucket = "logsBucket1565363834"; - String buildTriggerId = "buildTriggerId1105559411"; - String logUrl = "logUrl342054388"; - ServiceAccountName serviceAccount = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); Build expectedResponse = Build.newBuilder() - .setName(name.toString()) - .setId(id) - .setProjectId(projectId2) - .setStatusDetail(statusDetail) - .setLogsBucket(logsBucket) - .setBuildTriggerId(buildTriggerId) - .setLogUrl(logUrl) - .setServiceAccount(serviceAccount.toString()) + .setName(BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]").toString()) + .setId("id3355") + .setProjectId("projectId-894832108") + .setStatusDetail("statusDetail1651087075") + .setSource(Source.newBuilder().build()) + .addAllSteps(new ArrayList()) + .setResults(Results.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setFinishTime(Timestamp.newBuilder().build()) + .setTimeout(Duration.newBuilder().build()) + .addAllImages(new ArrayList()) + .setQueueTtl(Duration.newBuilder().build()) + .setArtifacts(Artifacts.newBuilder().build()) + .setLogsBucket("logsBucket1592573049") + .setSourceProvenance(SourceProvenance.newBuilder().build()) + .setBuildTriggerId("buildTriggerId781747749") + .setOptions(BuildOptions.newBuilder().build()) + .setLogUrl("logUrl-1097354357") + .putAllSubstitutions(new HashMap()) + .addAllTags(new ArrayList()) + .addAllSecrets(new ArrayList()) + .putAllTiming(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); Operation resultOperation = Operation.newBuilder() @@ -230,7 +159,7 @@ public void createBuildTest() throws Exception { .build(); mockCloudBuild.addResponse(resultOperation); - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; Build build = Build.newBuilder().build(); Build actualResponse = client.createBuildAsync(projectId, build).get(); @@ -238,7 +167,7 @@ public void createBuildTest() throws Exception { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBuildRequest actualRequest = (CreateBuildRequest) actualRequests.get(0); + CreateBuildRequest actualRequest = ((CreateBuildRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(build, actualRequest.getBuild()); @@ -249,49 +178,54 @@ public void createBuildTest() throws Exception { } @Test - @SuppressWarnings("all") public void createBuildExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; Build build = Build.newBuilder().build(); - client.createBuildAsync(projectId, build).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void getBuildTest() { - BuildName name = BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]"); - String id2 = "id23227150"; - String projectId2 = "projectId2939242356"; - String statusDetail = "statusDetail2089931070"; - String logsBucket = "logsBucket1565363834"; - String buildTriggerId = "buildTriggerId1105559411"; - String logUrl = "logUrl342054388"; - ServiceAccountName serviceAccount = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + public void getBuildTest() throws Exception { Build expectedResponse = Build.newBuilder() - .setName(name.toString()) - .setId(id2) - .setProjectId(projectId2) - .setStatusDetail(statusDetail) - .setLogsBucket(logsBucket) - .setBuildTriggerId(buildTriggerId) - .setLogUrl(logUrl) - .setServiceAccount(serviceAccount.toString()) + .setName(BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]").toString()) + .setId("id3355") + .setProjectId("projectId-894832108") + .setStatusDetail("statusDetail1651087075") + .setSource(Source.newBuilder().build()) + .addAllSteps(new ArrayList()) + .setResults(Results.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setFinishTime(Timestamp.newBuilder().build()) + .setTimeout(Duration.newBuilder().build()) + .addAllImages(new ArrayList()) + .setQueueTtl(Duration.newBuilder().build()) + .setArtifacts(Artifacts.newBuilder().build()) + .setLogsBucket("logsBucket1592573049") + .setSourceProvenance(SourceProvenance.newBuilder().build()) + .setBuildTriggerId("buildTriggerId781747749") + .setOptions(BuildOptions.newBuilder().build()) + .setLogUrl("logUrl-1097354357") + .putAllSubstitutions(new HashMap()) + .addAllTags(new ArrayList()) + .addAllSecrets(new ArrayList()) + .putAllTiming(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); mockCloudBuild.addResponse(expectedResponse); - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; String id = "id3355"; Build actualResponse = client.getBuild(projectId, id); @@ -299,7 +233,7 @@ public void getBuildTest() { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBuildRequest actualRequest = (GetBuildRequest) actualRequests.get(0); + GetBuildRequest actualRequest = ((GetBuildRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(id, actualRequest.getId()); @@ -310,47 +244,99 @@ public void getBuildTest() { } @Test - @SuppressWarnings("all") public void getBuildExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; String id = "id3355"; - client.getBuild(projectId, id); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. + } + } + + @Test + public void listBuildsTest() throws Exception { + Build responsesElement = Build.newBuilder().build(); + ListBuildsResponse expectedResponse = + ListBuildsResponse.newBuilder() + .setNextPageToken("") + .addAllBuilds(Arrays.asList(responsesElement)) + .build(); + mockCloudBuild.addResponse(expectedResponse); + + String projectId = "projectId-894832108"; + String filter = "filter-1274492040"; + + ListBuildsPagedResponse pagedListResponse = client.listBuilds(projectId, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBuildsList().get(0), resources.get(0)); + + List actualRequests = mockCloudBuild.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBuildsRequest actualRequest = ((ListBuildsRequest) actualRequests.get(0)); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBuildsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudBuild.addException(exception); + + try { + String projectId = "projectId-894832108"; + String filter = "filter-1274492040"; + client.listBuilds(projectId, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. } } @Test - @SuppressWarnings("all") - public void cancelBuildTest() { - BuildName name = BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]"); - String id2 = "id23227150"; - String projectId2 = "projectId2939242356"; - String statusDetail = "statusDetail2089931070"; - String logsBucket = "logsBucket1565363834"; - String buildTriggerId = "buildTriggerId1105559411"; - String logUrl = "logUrl342054388"; - ServiceAccountName serviceAccount = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + public void cancelBuildTest() throws Exception { Build expectedResponse = Build.newBuilder() - .setName(name.toString()) - .setId(id2) - .setProjectId(projectId2) - .setStatusDetail(statusDetail) - .setLogsBucket(logsBucket) - .setBuildTriggerId(buildTriggerId) - .setLogUrl(logUrl) - .setServiceAccount(serviceAccount.toString()) + .setName(BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]").toString()) + .setId("id3355") + .setProjectId("projectId-894832108") + .setStatusDetail("statusDetail1651087075") + .setSource(Source.newBuilder().build()) + .addAllSteps(new ArrayList()) + .setResults(Results.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setFinishTime(Timestamp.newBuilder().build()) + .setTimeout(Duration.newBuilder().build()) + .addAllImages(new ArrayList()) + .setQueueTtl(Duration.newBuilder().build()) + .setArtifacts(Artifacts.newBuilder().build()) + .setLogsBucket("logsBucket1592573049") + .setSourceProvenance(SourceProvenance.newBuilder().build()) + .setBuildTriggerId("buildTriggerId781747749") + .setOptions(BuildOptions.newBuilder().build()) + .setLogUrl("logUrl-1097354357") + .putAllSubstitutions(new HashMap()) + .addAllTags(new ArrayList()) + .addAllSecrets(new ArrayList()) + .putAllTiming(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); mockCloudBuild.addResponse(expectedResponse); - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; String id = "id3355"; Build actualResponse = client.cancelBuild(projectId, id); @@ -358,7 +344,7 @@ public void cancelBuildTest() { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CancelBuildRequest actualRequest = (CancelBuildRequest) actualRequests.get(0); + CancelBuildRequest actualRequest = ((CancelBuildRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(id, actualRequest.getId()); @@ -369,43 +355,48 @@ public void cancelBuildTest() { } @Test - @SuppressWarnings("all") public void cancelBuildExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; String id = "id3355"; - client.cancelBuild(projectId, id); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void retryBuildTest() throws Exception { - BuildName name = BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]"); - String id2 = "id23227150"; - String projectId2 = "projectId2939242356"; - String statusDetail = "statusDetail2089931070"; - String logsBucket = "logsBucket1565363834"; - String buildTriggerId = "buildTriggerId1105559411"; - String logUrl = "logUrl342054388"; - ServiceAccountName serviceAccount = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); Build expectedResponse = Build.newBuilder() - .setName(name.toString()) - .setId(id2) - .setProjectId(projectId2) - .setStatusDetail(statusDetail) - .setLogsBucket(logsBucket) - .setBuildTriggerId(buildTriggerId) - .setLogUrl(logUrl) - .setServiceAccount(serviceAccount.toString()) + .setName(BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]").toString()) + .setId("id3355") + .setProjectId("projectId-894832108") + .setStatusDetail("statusDetail1651087075") + .setSource(Source.newBuilder().build()) + .addAllSteps(new ArrayList()) + .setResults(Results.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setFinishTime(Timestamp.newBuilder().build()) + .setTimeout(Duration.newBuilder().build()) + .addAllImages(new ArrayList()) + .setQueueTtl(Duration.newBuilder().build()) + .setArtifacts(Artifacts.newBuilder().build()) + .setLogsBucket("logsBucket1592573049") + .setSourceProvenance(SourceProvenance.newBuilder().build()) + .setBuildTriggerId("buildTriggerId781747749") + .setOptions(BuildOptions.newBuilder().build()) + .setLogUrl("logUrl-1097354357") + .putAllSubstitutions(new HashMap()) + .addAllTags(new ArrayList()) + .addAllSecrets(new ArrayList()) + .putAllTiming(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); Operation resultOperation = Operation.newBuilder() @@ -415,7 +406,7 @@ public void retryBuildTest() throws Exception { .build(); mockCloudBuild.addResponse(resultOperation); - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; String id = "id3355"; Build actualResponse = client.retryBuildAsync(projectId, id).get(); @@ -423,7 +414,7 @@ public void retryBuildTest() throws Exception { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - RetryBuildRequest actualRequest = (RetryBuildRequest) actualRequests.get(0); + RetryBuildRequest actualRequest = ((RetryBuildRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(id, actualRequest.getId()); @@ -434,43 +425,41 @@ public void retryBuildTest() throws Exception { } @Test - @SuppressWarnings("all") public void retryBuildExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; String id = "id3355"; - client.retryBuildAsync(projectId, id).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void createBuildTriggerTest() { - String id = "id3355"; - String description = "description-1724546052"; - BuildTriggerName name = BuildTriggerName.of("[PROJECT]", "[TRIGGER]"); - String filename = "filename-734768633"; - boolean disabled = true; + public void createBuildTriggerTest() throws Exception { BuildTrigger expectedResponse = BuildTrigger.newBuilder() - .setId(id) - .setDescription(description) - .setName(name.toString()) - .setFilename(filename) - .setDisabled(disabled) + .setId("id3355") + .setDescription("description-1724546052") + .setName("name3373707") + .addAllTags(new ArrayList()) + .setTriggerTemplate(RepoSource.newBuilder().build()) + .setGithub(GitHubEventsConfig.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDisabled(true) + .putAllSubstitutions(new HashMap()) + .addAllIgnoredFiles(new ArrayList()) + .addAllIncludedFiles(new ArrayList()) .build(); mockCloudBuild.addResponse(expectedResponse); - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; BuildTrigger trigger = BuildTrigger.newBuilder().build(); BuildTrigger actualResponse = client.createBuildTrigger(projectId, trigger); @@ -478,7 +467,7 @@ public void createBuildTriggerTest() { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBuildTriggerRequest actualRequest = (CreateBuildTriggerRequest) actualRequests.get(0); + CreateBuildTriggerRequest actualRequest = ((CreateBuildTriggerRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(trigger, actualRequest.getTrigger()); @@ -489,49 +478,47 @@ public void createBuildTriggerTest() { } @Test - @SuppressWarnings("all") public void createBuildTriggerExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; BuildTrigger trigger = BuildTrigger.newBuilder().build(); - client.createBuildTrigger(projectId, trigger); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getBuildTriggerTest() { - String id = "id3355"; - String description = "description-1724546052"; - BuildTriggerName name = BuildTriggerName.of("[PROJECT]", "[TRIGGER]"); - String filename = "filename-734768633"; - boolean disabled = true; + public void getBuildTriggerTest() throws Exception { BuildTrigger expectedResponse = BuildTrigger.newBuilder() - .setId(id) - .setDescription(description) - .setName(name.toString()) - .setFilename(filename) - .setDisabled(disabled) + .setId("id3355") + .setDescription("description-1724546052") + .setName("name3373707") + .addAllTags(new ArrayList()) + .setTriggerTemplate(RepoSource.newBuilder().build()) + .setGithub(GitHubEventsConfig.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDisabled(true) + .putAllSubstitutions(new HashMap()) + .addAllIgnoredFiles(new ArrayList()) + .addAllIncludedFiles(new ArrayList()) .build(); mockCloudBuild.addResponse(expectedResponse); - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; BuildTrigger actualResponse = client.getBuildTrigger(projectId, triggerId); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBuildTriggerRequest actualRequest = (GetBuildTriggerRequest) actualRequests.get(0); + GetBuildTriggerRequest actualRequest = ((GetBuildTriggerRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(triggerId, actualRequest.getTriggerId()); @@ -542,46 +529,42 @@ public void getBuildTriggerTest() { } @Test - @SuppressWarnings("all") public void getBuildTriggerExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; - + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; client.getBuildTrigger(projectId, triggerId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listBuildTriggersTest() { - String nextPageToken = ""; - BuildTrigger triggersElement = BuildTrigger.newBuilder().build(); - List triggers = Arrays.asList(triggersElement); + public void listBuildTriggersTest() throws Exception { + BuildTrigger responsesElement = BuildTrigger.newBuilder().build(); ListBuildTriggersResponse expectedResponse = ListBuildTriggersResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllTriggers(triggers) + .setNextPageToken("") + .addAllTriggers(Arrays.asList(responsesElement)) .build(); mockCloudBuild.addResponse(expectedResponse); - String projectId = "projectId-1969970175"; + String projectId = "projectId-894832108"; ListBuildTriggersPagedResponse pagedListResponse = client.listBuildTriggers(projectId); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getTriggersList().get(0), resources.get(0)); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBuildTriggersRequest actualRequest = (ListBuildTriggersRequest) actualRequests.get(0); + ListBuildTriggersRequest actualRequest = ((ListBuildTriggersRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertTrue( @@ -591,41 +574,76 @@ public void listBuildTriggersTest() { } @Test - @SuppressWarnings("all") public void listBuildTriggersExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; - + String projectId = "projectId-894832108"; client.listBuildTriggers(projectId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateBuildTriggerTest() { - String id = "id3355"; - String description = "description-1724546052"; - BuildTriggerName name = BuildTriggerName.of("[PROJECT]", "[TRIGGER]"); - String filename = "filename-734768633"; - boolean disabled = true; + public void deleteBuildTriggerTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCloudBuild.addResponse(expectedResponse); + + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; + + client.deleteBuildTrigger(projectId, triggerId); + + List actualRequests = mockCloudBuild.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBuildTriggerRequest actualRequest = ((DeleteBuildTriggerRequest) actualRequests.get(0)); + + Assert.assertEquals(projectId, actualRequest.getProjectId()); + Assert.assertEquals(triggerId, actualRequest.getTriggerId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBuildTriggerExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudBuild.addException(exception); + + try { + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; + client.deleteBuildTrigger(projectId, triggerId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBuildTriggerTest() throws Exception { BuildTrigger expectedResponse = BuildTrigger.newBuilder() - .setId(id) - .setDescription(description) - .setName(name.toString()) - .setFilename(filename) - .setDisabled(disabled) + .setId("id3355") + .setDescription("description-1724546052") + .setName("name3373707") + .addAllTags(new ArrayList()) + .setTriggerTemplate(RepoSource.newBuilder().build()) + .setGithub(GitHubEventsConfig.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setDisabled(true) + .putAllSubstitutions(new HashMap()) + .addAllIgnoredFiles(new ArrayList()) + .addAllIncludedFiles(new ArrayList()) .build(); mockCloudBuild.addResponse(expectedResponse); - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; BuildTrigger trigger = BuildTrigger.newBuilder().build(); BuildTrigger actualResponse = client.updateBuildTrigger(projectId, triggerId, trigger); @@ -633,7 +651,7 @@ public void updateBuildTriggerTest() { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateBuildTriggerRequest actualRequest = (UpdateBuildTriggerRequest) actualRequests.get(0); + UpdateBuildTriggerRequest actualRequest = ((UpdateBuildTriggerRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(triggerId, actualRequest.getTriggerId()); @@ -645,44 +663,49 @@ public void updateBuildTriggerTest() { } @Test - @SuppressWarnings("all") public void updateBuildTriggerExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; BuildTrigger trigger = BuildTrigger.newBuilder().build(); - client.updateBuildTrigger(projectId, triggerId, trigger); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void runBuildTriggerTest() throws Exception { - BuildName name = BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]"); - String id = "id3355"; - String projectId2 = "projectId2939242356"; - String statusDetail = "statusDetail2089931070"; - String logsBucket = "logsBucket1565363834"; - String buildTriggerId = "buildTriggerId1105559411"; - String logUrl = "logUrl342054388"; - ServiceAccountName serviceAccount = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); Build expectedResponse = Build.newBuilder() - .setName(name.toString()) - .setId(id) - .setProjectId(projectId2) - .setStatusDetail(statusDetail) - .setLogsBucket(logsBucket) - .setBuildTriggerId(buildTriggerId) - .setLogUrl(logUrl) - .setServiceAccount(serviceAccount.toString()) + .setName(BuildName.ofProjectBuildName("[PROJECT]", "[BUILD]").toString()) + .setId("id3355") + .setProjectId("projectId-894832108") + .setStatusDetail("statusDetail1651087075") + .setSource(Source.newBuilder().build()) + .addAllSteps(new ArrayList()) + .setResults(Results.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setFinishTime(Timestamp.newBuilder().build()) + .setTimeout(Duration.newBuilder().build()) + .addAllImages(new ArrayList()) + .setQueueTtl(Duration.newBuilder().build()) + .setArtifacts(Artifacts.newBuilder().build()) + .setLogsBucket("logsBucket1592573049") + .setSourceProvenance(SourceProvenance.newBuilder().build()) + .setBuildTriggerId("buildTriggerId781747749") + .setOptions(BuildOptions.newBuilder().build()) + .setLogUrl("logUrl-1097354357") + .putAllSubstitutions(new HashMap()) + .addAllTags(new ArrayList()) + .addAllSecrets(new ArrayList()) + .putAllTiming(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); Operation resultOperation = Operation.newBuilder() @@ -692,8 +715,8 @@ public void runBuildTriggerTest() throws Exception { .build(); mockCloudBuild.addResponse(resultOperation); - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; RepoSource source = RepoSource.newBuilder().build(); Build actualResponse = client.runBuildTriggerAsync(projectId, triggerId, source).get(); @@ -701,7 +724,7 @@ public void runBuildTriggerTest() throws Exception { List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - RunBuildTriggerRequest actualRequest = (RunBuildTriggerRequest) actualRequests.get(0); + RunBuildTriggerRequest actualRequest = ((RunBuildTriggerRequest) actualRequests.get(0)); Assert.assertEquals(projectId, actualRequest.getProjectId()); Assert.assertEquals(triggerId, actualRequest.getTriggerId()); @@ -713,50 +736,54 @@ public void runBuildTriggerTest() throws Exception { } @Test - @SuppressWarnings("all") public void runBuildTriggerExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - String projectId = "projectId-1969970175"; - String triggerId = "triggerId1363517698"; + String projectId = "projectId-894832108"; + String triggerId = "triggerId-648752909"; RepoSource source = RepoSource.newBuilder().build(); - client.runBuildTriggerAsync(projectId, triggerId, source).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void createWorkerPoolTest() { - String name = "name3373707"; - String projectId = "projectId-1969970175"; - String serviceAccountEmail = "serviceAccountEmail-1300473088"; - long workerCount = 372044046L; + public void createWorkerPoolTest() throws Exception { WorkerPool expectedResponse = WorkerPool.newBuilder() - .setName(name) - .setProjectId(projectId) - .setServiceAccountEmail(serviceAccountEmail) - .setWorkerCount(workerCount) + .setName("name3373707") + .setProjectId("projectId-894832108") + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setWorkerCount(372044046) + .setWorkerConfig(WorkerConfig.newBuilder().build()) + .addAllRegions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) .build(); mockCloudBuild.addResponse(expectedResponse); - CreateWorkerPoolRequest request = CreateWorkerPoolRequest.newBuilder().build(); + CreateWorkerPoolRequest request = + CreateWorkerPoolRequest.newBuilder() + .setParent("parent-995424086") + .setWorkerPool(WorkerPool.newBuilder().build()) + .build(); WorkerPool actualResponse = client.createWorkerPool(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateWorkerPoolRequest actualRequest = (CreateWorkerPoolRequest) actualRequests.get(0); + CreateWorkerPoolRequest actualRequest = ((CreateWorkerPoolRequest) actualRequests.get(0)); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getWorkerPool(), actualRequest.getWorkerPool()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -764,46 +791,49 @@ public void createWorkerPoolTest() { } @Test - @SuppressWarnings("all") public void createWorkerPoolExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - CreateWorkerPoolRequest request = CreateWorkerPoolRequest.newBuilder().build(); - + CreateWorkerPoolRequest request = + CreateWorkerPoolRequest.newBuilder() + .setParent("parent-995424086") + .setWorkerPool(WorkerPool.newBuilder().build()) + .build(); client.createWorkerPool(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getWorkerPoolTest() { - String name = "name3373707"; - String projectId = "projectId-1969970175"; - String serviceAccountEmail = "serviceAccountEmail-1300473088"; - long workerCount = 372044046L; + public void getWorkerPoolTest() throws Exception { WorkerPool expectedResponse = WorkerPool.newBuilder() - .setName(name) - .setProjectId(projectId) - .setServiceAccountEmail(serviceAccountEmail) - .setWorkerCount(workerCount) + .setName("name3373707") + .setProjectId("projectId-894832108") + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setWorkerCount(372044046) + .setWorkerConfig(WorkerConfig.newBuilder().build()) + .addAllRegions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) .build(); mockCloudBuild.addResponse(expectedResponse); - GetWorkerPoolRequest request = GetWorkerPoolRequest.newBuilder().build(); + GetWorkerPoolRequest request = GetWorkerPoolRequest.newBuilder().setName("name3373707").build(); WorkerPool actualResponse = client.getWorkerPool(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetWorkerPoolRequest actualRequest = (GetWorkerPoolRequest) actualRequests.get(0); + GetWorkerPoolRequest actualRequest = ((GetWorkerPoolRequest) actualRequests.get(0)); + Assert.assertEquals(request.getName(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -811,35 +841,35 @@ public void getWorkerPoolTest() { } @Test - @SuppressWarnings("all") public void getWorkerPoolExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - GetWorkerPoolRequest request = GetWorkerPoolRequest.newBuilder().build(); - + GetWorkerPoolRequest request = + GetWorkerPoolRequest.newBuilder().setName("name3373707").build(); client.getWorkerPool(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteWorkerPoolTest() { + public void deleteWorkerPoolTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockCloudBuild.addResponse(expectedResponse); - DeleteWorkerPoolRequest request = DeleteWorkerPoolRequest.newBuilder().build(); + DeleteWorkerPoolRequest request = + DeleteWorkerPoolRequest.newBuilder().setName("name3373707").build(); client.deleteWorkerPool(request); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteWorkerPoolRequest actualRequest = (DeleteWorkerPoolRequest) actualRequests.get(0); + DeleteWorkerPoolRequest actualRequest = ((DeleteWorkerPoolRequest) actualRequests.get(0)); + Assert.assertEquals(request.getName(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -847,46 +877,51 @@ public void deleteWorkerPoolTest() { } @Test - @SuppressWarnings("all") public void deleteWorkerPoolExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - DeleteWorkerPoolRequest request = DeleteWorkerPoolRequest.newBuilder().build(); - + DeleteWorkerPoolRequest request = + DeleteWorkerPoolRequest.newBuilder().setName("name3373707").build(); client.deleteWorkerPool(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateWorkerPoolTest() { - String name = "name3373707"; - String projectId = "projectId-1969970175"; - String serviceAccountEmail = "serviceAccountEmail-1300473088"; - long workerCount = 372044046L; + public void updateWorkerPoolTest() throws Exception { WorkerPool expectedResponse = WorkerPool.newBuilder() - .setName(name) - .setProjectId(projectId) - .setServiceAccountEmail(serviceAccountEmail) - .setWorkerCount(workerCount) + .setName("name3373707") + .setProjectId("projectId-894832108") + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setWorkerCount(372044046) + .setWorkerConfig(WorkerConfig.newBuilder().build()) + .addAllRegions(new ArrayList()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) .build(); mockCloudBuild.addResponse(expectedResponse); - UpdateWorkerPoolRequest request = UpdateWorkerPoolRequest.newBuilder().build(); + UpdateWorkerPoolRequest request = + UpdateWorkerPoolRequest.newBuilder() + .setName("name3373707") + .setWorkerPool(WorkerPool.newBuilder().build()) + .build(); WorkerPool actualResponse = client.updateWorkerPool(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateWorkerPoolRequest actualRequest = (UpdateWorkerPoolRequest) actualRequests.get(0); + UpdateWorkerPoolRequest actualRequest = ((UpdateWorkerPoolRequest) actualRequests.get(0)); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getWorkerPool(), actualRequest.getWorkerPool()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -894,36 +929,40 @@ public void updateWorkerPoolTest() { } @Test - @SuppressWarnings("all") public void updateWorkerPoolExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - UpdateWorkerPoolRequest request = UpdateWorkerPoolRequest.newBuilder().build(); - + UpdateWorkerPoolRequest request = + UpdateWorkerPoolRequest.newBuilder() + .setName("name3373707") + .setWorkerPool(WorkerPool.newBuilder().build()) + .build(); client.updateWorkerPool(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listWorkerPoolsTest() { - ListWorkerPoolsResponse expectedResponse = ListWorkerPoolsResponse.newBuilder().build(); + public void listWorkerPoolsTest() throws Exception { + ListWorkerPoolsResponse expectedResponse = + ListWorkerPoolsResponse.newBuilder().addAllWorkerPools(new ArrayList()).build(); mockCloudBuild.addResponse(expectedResponse); - ListWorkerPoolsRequest request = ListWorkerPoolsRequest.newBuilder().build(); + ListWorkerPoolsRequest request = + ListWorkerPoolsRequest.newBuilder().setParent("parent-995424086").build(); ListWorkerPoolsResponse actualResponse = client.listWorkerPools(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockCloudBuild.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListWorkerPoolsRequest actualRequest = (ListWorkerPoolsRequest) actualRequests.get(0); + ListWorkerPoolsRequest actualRequest = ((ListWorkerPoolsRequest) actualRequests.get(0)); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -931,18 +970,17 @@ public void listWorkerPoolsTest() { } @Test - @SuppressWarnings("all") public void listWorkerPoolsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockCloudBuild.addException(exception); try { - ListWorkerPoolsRequest request = ListWorkerPoolsRequest.newBuilder().build(); - + ListWorkerPoolsRequest request = + ListWorkerPoolsRequest.newBuilder().setParent("parent-995424086").build(); client.listWorkerPools(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuild.java b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuild.java index 47433a16..19e27ed5 100644 --- a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuild.java +++ b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuild.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockCloudBuild implements MockGrpcService { private final MockCloudBuildImpl serviceImpl; diff --git a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuildImpl.java b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuildImpl.java index 117a0492..e71eeb41 100644 --- a/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuildImpl.java +++ b/google-cloud-build/src/test/java/com/google/cloud/devtools/cloudbuild/v1/MockCloudBuildImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.devtools.cloudbuild.v1; import com.google.api.core.BetaApi; @@ -47,9 +48,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockCloudBuildImpl extends CloudBuildImplBase { private List requests; private Queue responses; @@ -85,10 +87,10 @@ public void createBuild(CreateBuildRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -99,10 +101,10 @@ public void getBuild(GetBuildRequest request, StreamObserver responseObse Object response = responses.remove(); if (response instanceof Build) { requests.add(request); - responseObserver.onNext((Build) response); + responseObserver.onNext(((Build) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -114,10 +116,10 @@ public void listBuilds( Object response = responses.remove(); if (response instanceof ListBuildsResponse) { requests.add(request); - responseObserver.onNext((ListBuildsResponse) response); + responseObserver.onNext(((ListBuildsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -128,10 +130,10 @@ public void cancelBuild(CancelBuildRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Build) { requests.add(request); - responseObserver.onNext((Build) response); + responseObserver.onNext(((Build) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -142,10 +144,10 @@ public void retryBuild(RetryBuildRequest request, StreamObserver resp Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -157,10 +159,10 @@ public void createBuildTrigger( Object response = responses.remove(); if (response instanceof BuildTrigger) { requests.add(request); - responseObserver.onNext((BuildTrigger) response); + responseObserver.onNext(((BuildTrigger) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -172,10 +174,10 @@ public void getBuildTrigger( Object response = responses.remove(); if (response instanceof BuildTrigger) { requests.add(request); - responseObserver.onNext((BuildTrigger) response); + responseObserver.onNext(((BuildTrigger) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -188,10 +190,10 @@ public void listBuildTriggers( Object response = responses.remove(); if (response instanceof ListBuildTriggersResponse) { requests.add(request); - responseObserver.onNext((ListBuildTriggersResponse) response); + responseObserver.onNext(((ListBuildTriggersResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -203,10 +205,10 @@ public void deleteBuildTrigger( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -218,10 +220,10 @@ public void updateBuildTrigger( Object response = responses.remove(); if (response instanceof BuildTrigger) { requests.add(request); - responseObserver.onNext((BuildTrigger) response); + responseObserver.onNext(((BuildTrigger) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -233,10 +235,10 @@ public void runBuildTrigger( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -248,10 +250,10 @@ public void createWorkerPool( Object response = responses.remove(); if (response instanceof WorkerPool) { requests.add(request); - responseObserver.onNext((WorkerPool) response); + responseObserver.onNext(((WorkerPool) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -263,10 +265,10 @@ public void getWorkerPool( Object response = responses.remove(); if (response instanceof WorkerPool) { requests.add(request); - responseObserver.onNext((WorkerPool) response); + responseObserver.onNext(((WorkerPool) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -278,10 +280,10 @@ public void deleteWorkerPool( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -293,10 +295,10 @@ public void updateWorkerPool( Object response = responses.remove(); if (response instanceof WorkerPool) { requests.add(request); - responseObserver.onNext((WorkerPool) response); + responseObserver.onNext(((WorkerPool) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -308,10 +310,10 @@ public void listWorkerPools( Object response = responses.remove(); if (response instanceof ListWorkerPoolsResponse) { requests.add(request); - responseObserver.onNext((ListWorkerPoolsResponse) response); + responseObserver.onNext(((ListWorkerPoolsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildName.java index b4a9c677..b243331b 100644 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildName.java +++ b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,51 +26,54 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class BuildName implements ResourceName { - - @Deprecated - protected BuildName() {} - - private static final PathTemplate PROJECT_BUILD_PATH_TEMPLATE = + private static final PathTemplate PROJECT_BUILD = PathTemplate.createWithoutUrlEncoding("projects/{project}/builds/{build}"); - private static final PathTemplate PROJECT_LOCATION_BUILD_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_BUILD = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/builds/{build}"); - private volatile Map fieldValuesMap; private PathTemplate pathTemplate; private String fixedValue; + private final String project; + private final String build; + private final String location; - private String project; - private String build; - private String location; - - public String getProject() { - return project; - } - - public String getBuild() { - return build; - } - - public String getLocation() { - return location; + @Deprecated + protected BuildName() { + project = null; + build = null; + location = null; } private BuildName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); build = Preconditions.checkNotNull(builder.getBuild()); - pathTemplate = PROJECT_BUILD_PATH_TEMPLATE; + location = null; + pathTemplate = PROJECT_BUILD; } private BuildName(ProjectLocationBuildBuilder builder) { project = Preconditions.checkNotNull(builder.getProject()); location = Preconditions.checkNotNull(builder.getLocation()); build = Preconditions.checkNotNull(builder.getBuild()); - pathTemplate = PROJECT_LOCATION_BUILD_PATH_TEMPLATE; + pathTemplate = PROJECT_LOCATION_BUILD; + } + + public String getProject() { + return project; + } + + public String getBuild() { + return build; + } + + public String getLocation() { + return location; } public static Builder newBuilder() { @@ -92,12 +95,12 @@ public Builder toBuilder() { } public static BuildName of(String project, String build) { - return newProjectBuildBuilder().setProject(project).setBuild(build).build(); + return newBuilder().setProject(project).setBuild(build).build(); } @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static BuildName ofProjectBuildName(String project, String build) { - return newProjectBuildBuilder().setProject(project).setBuild(build).build(); + return newBuilder().setProject(project).setBuild(build).build(); } @BetaApi("The static create methods are not stable yet and may be changed in the future.") @@ -134,15 +137,15 @@ public static BuildName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - if (PROJECT_BUILD_PATH_TEMPLATE.matches(formattedString)) { - Map matchMap = PROJECT_BUILD_PATH_TEMPLATE.match(formattedString); + if (PROJECT_BUILD.matches(formattedString)) { + Map matchMap = PROJECT_BUILD.match(formattedString); return ofProjectBuildName(matchMap.get("project"), matchMap.get("build")); - } else if (PROJECT_LOCATION_BUILD_PATH_TEMPLATE.matches(formattedString)) { - Map matchMap = PROJECT_LOCATION_BUILD_PATH_TEMPLATE.match(formattedString); + } else if (PROJECT_LOCATION_BUILD.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_BUILD.match(formattedString); return ofProjectLocationBuildName( matchMap.get("project"), matchMap.get("location"), matchMap.get("build")); } - throw new ValidationException("JobName.parse: formattedString not in valid format"); + throw new ValidationException("BuildName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -166,8 +169,8 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_BUILD_PATH_TEMPLATE.matches(formattedString) - || PROJECT_LOCATION_BUILD_PATH_TEMPLATE.matches(formattedString); + return PROJECT_BUILD.matches(formattedString) + || PROJECT_LOCATION_BUILD.matches(formattedString); } @Override @@ -201,9 +204,36 @@ public String toString() { return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + BuildName that = ((BuildName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.build, that.build) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(build); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + /** Builder for projects/{project}/builds/{build}. */ public static class Builder { - private String project; private String build; @@ -229,9 +259,8 @@ public Builder setBuild(String build) { private Builder(BuildName buildName) { Preconditions.checkArgument( - buildName.pathTemplate == PROJECT_BUILD_PATH_TEMPLATE, - "toBuilder is only supported when BuildName has the pattern of " - + "projects/{project}/builds/{build}."); + Objects.equals(buildName.pathTemplate, PROJECT_BUILD), + "toBuilder is only supported when BuildName has the pattern of projects/{project}/builds/{build}"); project = buildName.project; build = buildName.build; } @@ -244,12 +273,11 @@ public BuildName build() { /** Builder for projects/{project}/locations/{location}/builds/{build}. */ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectLocationBuildBuilder { - private String project; private String location; private String build; - private ProjectLocationBuildBuilder() {} + protected ProjectLocationBuildBuilder() {} public String getProject() { return project; @@ -282,32 +310,4 @@ public BuildName build() { return new BuildName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - BuildName that = (BuildName) o; - return (Objects.equals(this.project, that.project)) - && (Objects.equals(this.build, that.build)) - && (Objects.equals(this.location, that.location)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(build); - h *= 1000003; - h ^= Objects.hashCode(location); - return h; - } } diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerName.java deleted file mode 100644 index 3d8597ea..00000000 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerName.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloudbuild.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") -public class BuildTriggerName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/triggers/{trigger}"); - - private volatile Map fieldValuesMap; - - private final String project; - private final String trigger; - - public String getProject() { - return project; - } - - public String getTrigger() { - return trigger; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private BuildTriggerName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - trigger = Preconditions.checkNotNull(builder.getTrigger()); - } - - public static BuildTriggerName of(String project, String trigger) { - return newBuilder().setProject(project).setTrigger(trigger).build(); - } - - public static String format(String project, String trigger) { - return newBuilder().setProject(project).setTrigger(trigger).build().toString(); - } - - public static BuildTriggerName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "BuildTriggerName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("trigger")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList(values.size()); - for (BuildTriggerName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("trigger", trigger); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "trigger", trigger); - } - - /** Builder for BuildTriggerName. */ - public static class Builder { - - private String project; - private String trigger; - - public String getProject() { - return project; - } - - public String getTrigger() { - return trigger; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setTrigger(String trigger) { - this.trigger = trigger; - return this; - } - - private Builder() {} - - private Builder(BuildTriggerName buildTriggerName) { - project = buildTriggerName.project; - trigger = buildTriggerName.trigger; - } - - public BuildTriggerName build() { - return new BuildTriggerName(this); - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof BuildTriggerName) { - BuildTriggerName that = (BuildTriggerName) o; - return (this.project.equals(that.project)) && (this.trigger.equals(that.trigger)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= trigger.hashCode(); - return h; - } -} diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/LocationName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/LocationName.java deleted file mode 100644 index 0d474ff2..00000000 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/LocationName.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloudbuild.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") -public class LocationName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - - private volatile Map fieldValuesMap; - - private final String project; - private final String location; - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private LocationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - } - - public static LocationName of(String project, String location) { - return newBuilder().setProject(project).setLocation(location).build(); - } - - public static String format(String project, String location) { - return newBuilder().setProject(project).setLocation(location).build().toString(); - } - - public static LocationName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "LocationName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList(values.size()); - for (LocationName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "location", location); - } - - /** Builder for LocationName. */ - public static class Builder { - - private String project; - private String location; - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - private Builder() {} - - private Builder(LocationName locationName) { - project = locationName.project; - location = locationName.location; - } - - public LocationName build() { - return new LocationName(this); - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof LocationName) { - LocationName that = (LocationName) o; - return (this.project.equals(that.project)) && (this.location.equals(that.location)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - return h; - } -} diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ProjectName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ProjectName.java deleted file mode 100644 index f7bce1e5..00000000 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ProjectName.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloudbuild.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") -public class ProjectName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}"); - - private volatile Map fieldValuesMap; - - private final String project; - - public String getProject() { - return project; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ProjectName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - } - - public static ProjectName of(String project) { - return newBuilder().setProject(project).build(); - } - - public static String format(String project) { - return newBuilder().setProject(project).build().toString(); - } - - public static ProjectName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "ProjectName.parse: formattedString not in valid format"); - return of(matchMap.get("project")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList(values.size()); - for (ProjectName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate("project", project); - } - - /** Builder for ProjectName. */ - public static class Builder { - - private String project; - - public String getProject() { - return project; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - private Builder() {} - - private Builder(ProjectName projectName) { - project = projectName.project; - } - - public ProjectName build() { - return new ProjectName(this); - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ProjectName) { - ProjectName that = (ProjectName) o; - return (this.project.equals(that.project)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - return h; - } -} diff --git a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ServiceAccountName.java b/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ServiceAccountName.java deleted file mode 100644 index a7bf0ad8..00000000 --- a/proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ServiceAccountName.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloudbuild.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") -public class ServiceAccountName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding("projects/{project}/serviceAccounts/{service_account}"); - - private volatile Map fieldValuesMap; - - private final String project; - private final String serviceAccount; - - public String getProject() { - return project; - } - - public String getServiceAccount() { - return serviceAccount; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - private ServiceAccountName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - serviceAccount = Preconditions.checkNotNull(builder.getServiceAccount()); - } - - public static ServiceAccountName of(String project, String serviceAccount) { - return newBuilder().setProject(project).setServiceAccount(serviceAccount).build(); - } - - public static String format(String project, String serviceAccount) { - return newBuilder().setProject(project).setServiceAccount(serviceAccount).build().toString(); - } - - public static ServiceAccountName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "ServiceAccountName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("service_account")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList(values.size()); - for (ServiceAccountName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); - } - - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("serviceAccount", serviceAccount); - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "service_account", serviceAccount); - } - - /** Builder for ServiceAccountName. */ - public static class Builder { - - private String project; - private String serviceAccount; - - public String getProject() { - return project; - } - - public String getServiceAccount() { - return serviceAccount; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setServiceAccount(String serviceAccount) { - this.serviceAccount = serviceAccount; - return this; - } - - private Builder() {} - - private Builder(ServiceAccountName serviceAccountName) { - project = serviceAccountName.project; - serviceAccount = serviceAccountName.serviceAccount; - } - - public ServiceAccountName build() { - return new ServiceAccountName(this); - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof ServiceAccountName) { - ServiceAccountName that = (ServiceAccountName) o; - return (this.project.equals(that.project)) - && (this.serviceAccount.equals(that.serviceAccount)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= serviceAccount.hashCode(); - return h; - } -} diff --git a/synth.metadata b/synth.metadata index bea8fcde..0c464378 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,15 +11,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-cloudbuild.git", - "sha": "300be2caba192cdb6efb6b7fbb9147c6bae2dfc3" + "sha": "7727552b9ec7f9f4ac4559a373341a5004539af7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "bc18612d35891d88bcac57c85d79db93f4f29028", - "internalRef": "331027363" + "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19", + "internalRef": "346372957" } }, { @@ -135,7 +135,6 @@ "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildStep.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildStepOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTrigger.java", - "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerName.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuildTriggerOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuiltImage.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/BuiltImageOrBuilder.java", @@ -176,10 +175,8 @@ "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ListWorkerPoolsRequestOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ListWorkerPoolsResponse.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ListWorkerPoolsResponseOrBuilder.java", - "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/LocationName.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Network.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/NetworkOrBuilder.java", - "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ProjectName.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PullRequestFilter.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PullRequestFilterOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/PushFilter.java", @@ -194,7 +191,6 @@ "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/RunBuildTriggerRequestOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Secret.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SecretOrBuilder.java", - "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/ServiceAccountName.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/Source.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SourceOrBuilder.java", "proto-google-cloud-build-v1/src/main/java/com/google/cloudbuild/v1/SourceProvenance.java",