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

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: Add support for dataproc BatchController service (#719)
* feat: Add support for dataproc BatchController service

PiperOrigin-RevId: 404333740

Source-Link: googleapis/googleapis@5088bd7

Source-Link: googleapis/googleapis-gen@44b8707
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDRiODcwNzgzYzE5NDM3NzFiY2RlYzc0OGFlNGQ1MjA4YzNkN2YwZSJ9

* 🦉 Updates from OwlBot

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Oct 21, 2021
1 parent 51cd3d2 commit 4556a3f
Show file tree
Hide file tree
Showing 35 changed files with 25,082 additions and 0 deletions.

Large diffs are not rendered by default.

@@ -0,0 +1,232 @@
/*
* Copyright 2021 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.cloud.dataproc.v1;

import static com.google.cloud.dataproc.v1.BatchControllerClient.ListBatchesPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.dataproc.v1.stub.BatchControllerStubSettings;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Settings class to configure an instance of {@link BatchControllerClient}.
*
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (dataproc.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
*
* <p>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.
*
* <p>For example, to set the total timeout of getBatch to 30 seconds:
*
* <pre>{@code
* BatchControllerSettings.Builder batchControllerSettingsBuilder =
* BatchControllerSettings.newBuilder();
* batchControllerSettingsBuilder
* .getBatchSettings()
* .setRetrySettings(
* batchControllerSettingsBuilder
* .getBatchSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* BatchControllerSettings batchControllerSettings = batchControllerSettingsBuilder.build();
* }</pre>
*/
@Generated("by gapic-generator-java")
public class BatchControllerSettings extends ClientSettings<BatchControllerSettings> {

/** Returns the object with the settings used for calls to createBatch. */
public UnaryCallSettings<CreateBatchRequest, Operation> createBatchSettings() {
return ((BatchControllerStubSettings) getStubSettings()).createBatchSettings();
}

/** Returns the object with the settings used for calls to createBatch. */
public OperationCallSettings<CreateBatchRequest, Batch, BatchOperationMetadata>
createBatchOperationSettings() {
return ((BatchControllerStubSettings) getStubSettings()).createBatchOperationSettings();
}

/** Returns the object with the settings used for calls to getBatch. */
public UnaryCallSettings<GetBatchRequest, Batch> getBatchSettings() {
return ((BatchControllerStubSettings) getStubSettings()).getBatchSettings();
}

/** Returns the object with the settings used for calls to listBatches. */
public PagedCallSettings<ListBatchesRequest, ListBatchesResponse, ListBatchesPagedResponse>
listBatchesSettings() {
return ((BatchControllerStubSettings) getStubSettings()).listBatchesSettings();
}

/** Returns the object with the settings used for calls to deleteBatch. */
public UnaryCallSettings<DeleteBatchRequest, Empty> deleteBatchSettings() {
return ((BatchControllerStubSettings) getStubSettings()).deleteBatchSettings();
}

public static final BatchControllerSettings create(BatchControllerStubSettings stub)
throws IOException {
return new BatchControllerSettings.Builder(stub.toBuilder()).build();
}

/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return BatchControllerStubSettings.defaultExecutorProviderBuilder();
}

/** Returns the default service endpoint. */
public static String getDefaultEndpoint() {
return BatchControllerStubSettings.getDefaultEndpoint();
}

/** Returns the default service scopes. */
public static List<String> getDefaultServiceScopes() {
return BatchControllerStubSettings.getDefaultServiceScopes();
}

/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
return BatchControllerStubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return BatchControllerStubSettings.defaultGrpcTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return BatchControllerStubSettings.defaultTransportChannelProvider();
}

@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return BatchControllerStubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
}

/** Returns a builder containing all the values of this settings class. */
public Builder toBuilder() {
return new Builder(this);
}

protected BatchControllerSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}

/** Builder for BatchControllerSettings. */
public static class Builder extends ClientSettings.Builder<BatchControllerSettings, Builder> {

protected Builder() throws IOException {
this(((ClientContext) null));
}

protected Builder(ClientContext clientContext) {
super(BatchControllerStubSettings.newBuilder(clientContext));
}

protected Builder(BatchControllerSettings settings) {
super(settings.getStubSettings().toBuilder());
}

protected Builder(BatchControllerStubSettings.Builder stubSettings) {
super(stubSettings);
}

private static Builder createDefault() {
return new Builder(BatchControllerStubSettings.newBuilder());
}

public BatchControllerStubSettings.Builder getStubSettingsBuilder() {
return ((BatchControllerStubSettings.Builder) getStubSettings());
}

/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
}

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

/** Returns the builder for the settings used for calls to createBatch. */
public OperationCallSettings.Builder<CreateBatchRequest, Batch, BatchOperationMetadata>
createBatchOperationSettings() {
return getStubSettingsBuilder().createBatchOperationSettings();
}

/** Returns the builder for the settings used for calls to getBatch. */
public UnaryCallSettings.Builder<GetBatchRequest, Batch> getBatchSettings() {
return getStubSettingsBuilder().getBatchSettings();
}

/** Returns the builder for the settings used for calls to listBatches. */
public PagedCallSettings.Builder<
ListBatchesRequest, ListBatchesResponse, ListBatchesPagedResponse>
listBatchesSettings() {
return getStubSettingsBuilder().listBatchesSettings();
}

/** Returns the builder for the settings used for calls to deleteBatch. */
public UnaryCallSettings.Builder<DeleteBatchRequest, Empty> deleteBatchSettings() {
return getStubSettingsBuilder().deleteBatchSettings();
}

@Override
public BatchControllerSettings build() throws IOException {
return new BatchControllerSettings(this);
}
}
}
Expand Up @@ -29,6 +29,27 @@
}
}
},
"BatchController": {
"clients": {
"grpc": {
"libraryClient": "BatchControllerClient",
"rpcs": {
"CreateBatch": {
"methods": ["createBatchAsync", "createBatchAsync", "createBatchAsync", "createBatchOperationCallable", "createBatchCallable"]
},
"DeleteBatch": {
"methods": ["deleteBatch", "deleteBatch", "deleteBatch", "deleteBatchCallable"]
},
"GetBatch": {
"methods": ["getBatch", "getBatch", "getBatch", "getBatchCallable"]
},
"ListBatches": {
"methods": ["listBatches", "listBatches", "listBatches", "listBatchesPagedCallable", "listBatchesCallable"]
}
}
}
}
},
"ClusterController": {
"clients": {
"grpc": {
Expand Down
Expand Up @@ -33,6 +33,19 @@
* }
* }</pre>
*
* <p>======================= BatchControllerClient =======================
*
* <p>Service Description: The BatchController provides methods to manage batch workloads.
*
* <p>Sample for BatchControllerClient:
*
* <pre>{@code
* try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
* BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
* Batch response = batchControllerClient.getBatch(name);
* }
* }</pre>
*
* <p>======================= ClusterControllerClient =======================
*
* <p>Service Description: The ClusterControllerService provides methods to manage clusters of
Expand Down
@@ -0,0 +1,76 @@
/*
* Copyright 2021 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.cloud.dataproc.v1.stub;

import static com.google.cloud.dataproc.v1.BatchControllerClient.ListBatchesPagedResponse;

import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dataproc.v1.Batch;
import com.google.cloud.dataproc.v1.BatchOperationMetadata;
import com.google.cloud.dataproc.v1.CreateBatchRequest;
import com.google.cloud.dataproc.v1.DeleteBatchRequest;
import com.google.cloud.dataproc.v1.GetBatchRequest;
import com.google.cloud.dataproc.v1.ListBatchesRequest;
import com.google.cloud.dataproc.v1.ListBatchesResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Empty;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Base stub class for the BatchController service API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public abstract class BatchControllerStub implements BackgroundResource {

public OperationsStub getOperationsStub() {
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
}

public OperationCallable<CreateBatchRequest, Batch, BatchOperationMetadata>
createBatchOperationCallable() {
throw new UnsupportedOperationException("Not implemented: createBatchOperationCallable()");
}

public UnaryCallable<CreateBatchRequest, Operation> createBatchCallable() {
throw new UnsupportedOperationException("Not implemented: createBatchCallable()");
}

public UnaryCallable<GetBatchRequest, Batch> getBatchCallable() {
throw new UnsupportedOperationException("Not implemented: getBatchCallable()");
}

public UnaryCallable<ListBatchesRequest, ListBatchesPagedResponse> listBatchesPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listBatchesPagedCallable()");
}

public UnaryCallable<ListBatchesRequest, ListBatchesResponse> listBatchesCallable() {
throw new UnsupportedOperationException("Not implemented: listBatchesCallable()");
}

public UnaryCallable<DeleteBatchRequest, Empty> deleteBatchCallable() {
throw new UnsupportedOperationException("Not implemented: deleteBatchCallable()");
}

@Override
public abstract void close();
}

0 comments on commit 4556a3f

Please sign in to comment.