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

Commit

Permalink
feat: add a new EkmService API (#712)
Browse files Browse the repository at this point in the history
* feat: add a new EkmService API

PiperOrigin-RevId: 425982419

Source-Link: googleapis/googleapis@8dff569

Source-Link: googleapis/googleapis-gen@b1538df
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjE1MzhkZjE2NDM5MjI2MDZkMDBlYzAzNjVjMWUwYTUxYmZiY2FiZiJ9

* 🦉 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 Feb 3, 2022
1 parent cfbfc03 commit 659a232
Show file tree
Hide file tree
Showing 127 changed files with 29,230 additions and 6,451 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
/*
* 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.kms.v1;

import static com.google.cloud.kms.v1.EkmServiceClient.ListEkmConnectionsPagedResponse;

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.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.kms.v1.stub.EkmServiceStubSettings;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
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 EkmServiceClient}.
*
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (cloudkms.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 getEkmConnection to 30 seconds:
*
* <pre>{@code
* EkmServiceSettings.Builder ekmServiceSettingsBuilder = EkmServiceSettings.newBuilder();
* ekmServiceSettingsBuilder
* .getEkmConnectionSettings()
* .setRetrySettings(
* ekmServiceSettingsBuilder
* .getEkmConnectionSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* EkmServiceSettings ekmServiceSettings = ekmServiceSettingsBuilder.build();
* }</pre>
*/
@Generated("by gapic-generator-java")
public class EkmServiceSettings extends ClientSettings<EkmServiceSettings> {

/** Returns the object with the settings used for calls to listEkmConnections. */
public PagedCallSettings<
ListEkmConnectionsRequest, ListEkmConnectionsResponse, ListEkmConnectionsPagedResponse>
listEkmConnectionsSettings() {
return ((EkmServiceStubSettings) getStubSettings()).listEkmConnectionsSettings();
}

/** Returns the object with the settings used for calls to getEkmConnection. */
public UnaryCallSettings<GetEkmConnectionRequest, EkmConnection> getEkmConnectionSettings() {
return ((EkmServiceStubSettings) getStubSettings()).getEkmConnectionSettings();
}

/** Returns the object with the settings used for calls to createEkmConnection. */
public UnaryCallSettings<CreateEkmConnectionRequest, EkmConnection>
createEkmConnectionSettings() {
return ((EkmServiceStubSettings) getStubSettings()).createEkmConnectionSettings();
}

/** Returns the object with the settings used for calls to updateEkmConnection. */
public UnaryCallSettings<UpdateEkmConnectionRequest, EkmConnection>
updateEkmConnectionSettings() {
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConnectionSettings();
}

/** Returns the object with the settings used for calls to setIamPolicy. */
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return ((EkmServiceStubSettings) getStubSettings()).setIamPolicySettings();
}

/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((EkmServiceStubSettings) getStubSettings()).getIamPolicySettings();
}

/** Returns the object with the settings used for calls to testIamPermissions. */
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return ((EkmServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
}

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

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

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

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

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

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

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

@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return EkmServiceStubSettings.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 EkmServiceSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}

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

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

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

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

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

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

public EkmServiceStubSettings.Builder getStubSettingsBuilder() {
return ((EkmServiceStubSettings.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 listEkmConnections. */
public PagedCallSettings.Builder<
ListEkmConnectionsRequest, ListEkmConnectionsResponse, ListEkmConnectionsPagedResponse>
listEkmConnectionsSettings() {
return getStubSettingsBuilder().listEkmConnectionsSettings();
}

/** Returns the builder for the settings used for calls to getEkmConnection. */
public UnaryCallSettings.Builder<GetEkmConnectionRequest, EkmConnection>
getEkmConnectionSettings() {
return getStubSettingsBuilder().getEkmConnectionSettings();
}

/** Returns the builder for the settings used for calls to createEkmConnection. */
public UnaryCallSettings.Builder<CreateEkmConnectionRequest, EkmConnection>
createEkmConnectionSettings() {
return getStubSettingsBuilder().createEkmConnectionSettings();
}

/** Returns the builder for the settings used for calls to updateEkmConnection. */
public UnaryCallSettings.Builder<UpdateEkmConnectionRequest, EkmConnection>
updateEkmConnectionSettings() {
return getStubSettingsBuilder().updateEkmConnectionSettings();
}

/** Returns the builder for the settings used for calls to setIamPolicy. */
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return getStubSettingsBuilder().setIamPolicySettings();
}

/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
}

/** Returns the builder for the settings used for calls to testIamPermissions. */
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return getStubSettingsBuilder().testIamPermissionsSettings();
}

@Override
public EkmServiceSettings build() throws IOException {
return new EkmServiceSettings(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,8 @@ public final UnaryCallable<DecryptRequest, DecryptResponse> decryptCallable() {
* @param digest Optional. The digest of the data to sign. The digest must be produced with the
* same digest algorithm as specified by the key version's
* [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
* <p>This field may not be supplied if
* [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Digest digest) {
Expand Down Expand Up @@ -2983,6 +2985,8 @@ public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Di
* @param digest Optional. The digest of the data to sign. The digest must be produced with the
* same digest algorithm as specified by the key version's
* [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
* <p>This field may not be supplied if
* [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AsymmetricSignResponse asymmetricSign(String name, Digest digest) {
Expand Down Expand Up @@ -3515,8 +3519,8 @@ public final UnaryCallable<MacVerifyRequest, MacVerifyResponse> macVerifyCallabl
* @param lengthBytes The length in bytes of the amount of randomness to retrieve. Minimum 8
* bytes, maximum 1024 bytes.
* @param protectionLevel The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when
* generating the random data. Defaults to
* [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
* generating the random data. Currently, only [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]
* protection level is supported.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GenerateRandomBytesResponse generateRandomBytes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@
"protoPackage": "google.cloud.kms.v1",
"libraryPackage": "com.google.cloud.kms.v1",
"services": {
"EkmService": {
"clients": {
"grpc": {
"libraryClient": "EkmServiceClient",
"rpcs": {
"CreateEkmConnection": {
"methods": ["createEkmConnection", "createEkmConnection", "createEkmConnection", "createEkmConnectionCallable"]
},
"GetEkmConnection": {
"methods": ["getEkmConnection", "getEkmConnection", "getEkmConnection", "getEkmConnectionCallable"]
},
"GetIamPolicy": {
"methods": ["getIamPolicy", "getIamPolicyCallable"]
},
"ListEkmConnections": {
"methods": ["listEkmConnections", "listEkmConnections", "listEkmConnections", "listEkmConnectionsPagedCallable", "listEkmConnectionsCallable"]
},
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
},
"UpdateEkmConnection": {
"methods": ["updateEkmConnection", "updateEkmConnection", "updateEkmConnectionCallable"]
}
}
}
}
},
"KeyManagementService": {
"clients": {
"grpc": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= EkmServiceClient =======================
*
* <p>Service Description: Google Cloud Key Management EKM Service
*
* <p>Manages external cryptographic keys and operations using those keys. Implements a REST model
* with the following objects:
*
* <ul>
* <li>[EkmConnection][google.cloud.kms.v1.EkmConnection]
* </ul>
*
* <p>Sample for EkmServiceClient:
*
* <pre>{@code
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
* EkmConnectionName name = EkmConnectionName.of("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]");
* EkmConnection response = ekmServiceClient.getEkmConnection(name);
* }
* }</pre>
*
* <p>======================= KeyManagementServiceClient =======================
*
* <p>Service Description: Google Cloud Key Management Service
Expand Down

0 comments on commit 659a232

Please sign in to comment.