This repository was archived by the owner on Oct 2, 2023. It is now read-only.

File tree

127 files changed

+29230
-6451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searcx below for content that may be hidden.

127 files changed

+29230
-6451
lines changed
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.kms.v1;
18+
19+
import static com.google.cloud.kms.v1.EkmServiceClient.ListEkmConnectionsPagedResponse;
20+
21+
import com.google.api.core.ApiFunction;
22+
import com.google.api.core.BetaApi;
23+
import com.google.api.gax.core.GoogleCredentialsProvider;
24+
import com.google.api.gax.core.InstantiatingExecutorProvider;
25+
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
26+
import com.google.api.gax.rpc.ApiClientHeaderProvider;
27+
import com.google.api.gax.rpc.ClientContext;
28+
import com.google.api.gax.rpc.ClientSettings;
29+
import com.google.api.gax.rpc.PagedCallSettings;
30+
import com.google.api.gax.rpc.TransportChannelProvider;
31+
import com.google.api.gax.rpc.UnaryCallSettings;
32+
import com.google.cloud.kms.v1.stub.EkmServiceStubSettings;
33+
import com.google.iam.v1.GetIamPolicyRequest;
34+
import com.google.iam.v1.Policy;
35+
import com.google.iam.v1.SetIamPolicyRequest;
36+
import com.google.iam.v1.TestIamPermissionsRequest;
37+
import com.google.iam.v1.TestIamPermissionsResponse;
38+
import java.io.IOException;
39+
import java.util.List;
40+
import javax.annotation.Generated;
41+
42+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
43+
/**
44+
* Settings class to configure an instance of {@link EkmServiceClient}.
45+
*
46+
* <p>The default instance has everything set to sensible defaults:
47+
*
48+
* <ul>
49+
* <li>The default service address (cloudkms.googleapis.com) and default port (443) are used.
50+
* <li>Credentials are acquired automatically through Application Default Credentials.
51+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
52+
* </ul>
53+
*
54+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
55+
* build() is called, the tree of builders is called to create the complete settings object.
56+
*
57+
* <p>For example, to set the total timeout of getEkmConnection to 30 seconds:
58+
*
59+
* <pre>{@code
60+
* EkmServiceSettings.Builder ekmServiceSettingsBuilder = EkmServiceSettings.newBuilder();
61+
* ekmServiceSettingsBuilder
62+
* .getEkmConnectionSettings()
63+
* .setRetrySettings(
64+
* ekmServiceSettingsBuilder
65+
* .getEkmConnectionSettings()
66+
* .getRetrySettings()
67+
* .toBuilder()
68+
* .setTotalTimeout(Duration.ofSeconds(30))
69+
* .build());
70+
* EkmServiceSettings ekmServiceSettings = ekmServiceSettingsBuilder.build();
71+
* }</pre>
72+
*/
73+
@Generated("by gapic-generator-java")
74+
public class EkmServiceSettings extends ClientSettings<EkmServiceSettings> {
75+
76+
/** Returns the object with the settings used for calls to listEkmConnections. */
77+
public PagedCallSettings<
78+
ListEkmConnectionsRequest, ListEkmConnectionsResponse, ListEkmConnectionsPagedResponse>
79+
listEkmConnectionsSettings() {
80+
return ((EkmServiceStubSettings) getStubSettings()).listEkmConnectionsSettings();
81+
}
82+
83+
/** Returns the object with the settings used for calls to getEkmConnection. */
84+
public UnaryCallSettings<GetEkmConnectionRequest, EkmConnection> getEkmConnectionSettings() {
85+
return ((EkmServiceStubSettings) getStubSettings()).getEkmConnectionSettings();
86+
}
87+
88+
/** Returns the object with the settings used for calls to createEkmConnection. */
89+
public UnaryCallSettings<CreateEkmConnectionRequest, EkmConnection>
90+
createEkmConnectionSettings() {
91+
return ((EkmServiceStubSettings) getStubSettings()).createEkmConnectionSettings();
92+
}
93+
94+
/** Returns the object with the settings used for calls to updateEkmConnection. */
95+
public UnaryCallSettings<UpdateEkmConnectionRequest, EkmConnection>
96+
updateEkmConnectionSettings() {
97+
return ((EkmServiceStubSettings) getStubSettings()).updateEkmConnectionSettings();
98+
}
99+
100+
/** Returns the object with the settings used for calls to setIamPolicy. */
101+
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
102+
return ((EkmServiceStubSettings) getStubSettings()).setIamPolicySettings();
103+
}
104+
105+
/** Returns the object with the settings used for calls to getIamPolicy. */
106+
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
107+
return ((EkmServiceStubSettings) getStubSettings()).getIamPolicySettings();
108+
}
109+
110+
/** Returns the object with the settings used for calls to testIamPermissions. */
111+
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
112+
testIamPermissionsSettings() {
113+
return ((EkmServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
114+
}
115+
116+
public static final EkmServiceSettings create(EkmServiceStubSettings stub) throws IOException {
117+
return new EkmServiceSettings.Builder(stub.toBuilder()).build();
118+
}
119+
120+
/** Returns a builder for the default ExecutorProvider for this service. */
121+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
122+
return EkmServiceStubSettings.defaultExecutorProviderBuilder();
123+
}
124+
125+
/** Returns the default service endpoint. */
126+
public static String getDefaultEndpoint() {
127+
return EkmServiceStubSettings.getDefaultEndpoint();
128+
}
129+
130+
/** Returns the default service scopes. */
131+
public static List<String> getDefaultServiceScopes() {
132+
return EkmServiceStubSettings.getDefaultServiceScopes();
133+
}
134+
135+
/** Returns a builder for the default credentials for this service. */
136+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
137+
return EkmServiceStubSettings.defaultCredentialsProviderBuilder();
138+
}
139+
140+
/** Returns a builder for the default ChannelProvider for this service. */
141+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
142+
return EkmServiceStubSettings.defaultGrpcTransportProviderBuilder();
143+
}
144+
145+
public static TransportChannelProvider defaultTransportChannelProvider() {
146+
return EkmServiceStubSettings.defaultTransportChannelProvider();
147+
}
148+
149+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
150+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
151+
return EkmServiceStubSettings.defaultApiClientHeaderProviderBuilder();
152+
}
153+
154+
/** Returns a new builder for this class. */
155+
public static Builder newBuilder() {
156+
return Builder.createDefault();
157+
}
158+
159+
/** Returns a new builder for this class. */
160+
public static Builder newBuilder(ClientContext clientContext) {
161+
return new Builder(clientContext);
162+
}
163+
164+
/** Returns a builder containing all the values of this settings class. */
165+
public Builder toBuilder() {
166+
return new Builder(this);
167+
}
168+
169+
protected EkmServiceSettings(Builder settingsBuilder) throws IOException {
170+
super(settingsBuilder);
171+
}
172+
173+
/** Builder for EkmServiceSettings. */
174+
public static class Builder extends ClientSettings.Builder<EkmServiceSettings, Builder> {
175+
176+
protected Builder() throws IOException {
177+
this(((ClientContext) null));
178+
}
179+
180+
protected Builder(ClientContext clientContext) {
181+
super(EkmServiceStubSettings.newBuilder(clientContext));
182+
}
183+
184+
protected Builder(EkmServiceSettings settings) {
185+
super(settings.getStubSettings().toBuilder());
186+
}
187+
188+
protected Builder(EkmServiceStubSettings.Builder stubSettings) {
189+
super(stubSettings);
190+
}
191+
192+
private static Builder createDefault() {
193+
return new Builder(EkmServiceStubSettings.newBuilder());
194+
}
195+
196+
public EkmServiceStubSettings.Builder getStubSettingsBuilder() {
197+
return ((EkmServiceStubSettings.Builder) getStubSettings());
198+
}
199+
200+
/**
201+
* Applies the given settings updater function to all of the unary API methods in this service.
202+
*
203+
* <p>Note: This method does not support applying settings to methods.
204+
*/
205+
public Builder applyToAllUnaryMethods(
206+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
207+
super.applyToAllUnaryMethods(
208+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
209+
return this;
210+
}
211+
212+
/** Returns the builder for the settings used for calls to listEkmConnections. */
213+
public PagedCallSettings.Builder<
214+
ListEkmConnectionsRequest, ListEkmConnectionsResponse, ListEkmConnectionsPagedResponse>
215+
listEkmConnectionsSettings() {
216+
return getStubSettingsBuilder().listEkmConnectionsSettings();
217+
}
218+
219+
/** Returns the builder for the settings used for calls to getEkmConnection. */
220+
public UnaryCallSettings.Builder<GetEkmConnectionRequest, EkmConnection>
221+
getEkmConnectionSettings() {
222+
return getStubSettingsBuilder().getEkmConnectionSettings();
223+
}
224+
225+
/** Returns the builder for the settings used for calls to createEkmConnection. */
226+
public UnaryCallSettings.Builder<CreateEkmConnectionRequest, EkmConnection>
227+
createEkmConnectionSettings() {
228+
return getStubSettingsBuilder().createEkmConnectionSettings();
229+
}
230+
231+
/** Returns the builder for the settings used for calls to updateEkmConnection. */
232+
public UnaryCallSettings.Builder<UpdateEkmConnectionRequest, EkmConnection>
233+
updateEkmConnectionSettings() {
234+
return getStubSettingsBuilder().updateEkmConnectionSettings();
235+
}
236+
237+
/** Returns the builder for the settings used for calls to setIamPolicy. */
238+
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
239+
return getStubSettingsBuilder().setIamPolicySettings();
240+
}
241+
242+
/** Returns the builder for the settings used for calls to getIamPolicy. */
243+
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
244+
return getStubSettingsBuilder().getIamPolicySettings();
245+
}
246+
247+
/** Returns the builder for the settings used for calls to testIamPermissions. */
248+
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
249+
testIamPermissionsSettings() {
250+
return getStubSettingsBuilder().testIamPermissionsSettings();
251+
}
252+
253+
@Override
254+
public EkmServiceSettings build() throws IOException {
255+
return new EkmServiceSettings(this);
256+
}
257+
}
258+
}
Original file line numberDiff line numberDiff line change
@@ -2946,6 +2946,8 @@ public final UnaryCallable<DecryptRequest, DecryptResponse> decryptCallable() {
29462946
* @param digest Optional. The digest of the data to sign. The digest must be produced with the
29472947
* same digest algorithm as specified by the key version's
29482948
* [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
2949+
* <p>This field may not be supplied if
2950+
* [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied.
29492951
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
29502952
*/
29512953
public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Digest digest) {
@@ -2983,6 +2985,8 @@ public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Di
29832985
* @param digest Optional. The digest of the data to sign. The digest must be produced with the
29842986
* same digest algorithm as specified by the key version's
29852987
* [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
2988+
* <p>This field may not be supplied if
2989+
* [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied.
29862990
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
29872991
*/
29882992
public final AsymmetricSignResponse asymmetricSign(String name, Digest digest) {
@@ -3515,8 +3519,8 @@ public final UnaryCallable<MacVerifyRequest, MacVerifyResponse> macVerifyCallabl
35153519
* @param lengthBytes The length in bytes of the amount of randomness to retrieve. Minimum 8
35163520
* bytes, maximum 1024 bytes.
35173521
* @param protectionLevel The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when
3518-
* generating the random data. Defaults to
3519-
* [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
3522+
* generating the random data. Currently, only [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]
3523+
* protection level is supported.
35203524
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
35213525
*/
35223526
public final GenerateRandomBytesResponse generateRandomBytes(
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,36 @@
55
"protoPackage": "google.cloud.kms.v1",
66
"libraryPackage": "com.google.cloud.kms.v1",
77
"services": {
8+
"EkmService": {
9+
"clients": {
10+
"grpc": {
11+
"libraryClient": "EkmServiceClient",
12+
"rpcs": {
13+
"CreateEkmConnection": {
14+
"methods": ["createEkmConnection", "createEkmConnection", "createEkmConnection", "createEkmConnectionCallable"]
15+
},
16+
"GetEkmConnection": {
17+
"methods": ["getEkmConnection", "getEkmConnection", "getEkmConnection", "getEkmConnectionCallable"]
18+
},
19+
"GetIamPolicy": {
20+
"methods": ["getIamPolicy", "getIamPolicyCallable"]
21+
},
22+
"ListEkmConnections": {
23+
"methods": ["listEkmConnections", "listEkmConnections", "listEkmConnections", "listEkmConnectionsPagedCallable", "listEkmConnectionsCallable"]
24+
},
25+
"SetIamPolicy": {
26+
"methods": ["setIamPolicy", "setIamPolicyCallable"]
27+
},
28+
"TestIamPermissions": {
29+
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
30+
},
31+
"UpdateEkmConnection": {
32+
"methods": ["updateEkmConnection", "updateEkmConnection", "updateEkmConnectionCallable"]
33+
}
34+
}
35+
}
36+
}
37+
},
838
"KeyManagementService": {
939
"clients": {
1040
"grpc": {
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@
1919
*
2020
* <p>The interfaces provided are listed below, along with usage samples.
2121
*
22+
* <p>======================= EkmServiceClient =======================
23+
*
24+
* <p>Service Description: Google Cloud Key Management EKM Service
25+
*
26+
* <p>Manages external cryptographic keys and operations using those keys. Implements a REST model
27+
* with the following objects:
28+
*
29+
* <ul>
30+
* <li>[EkmConnection][google.cloud.kms.v1.EkmConnection]
31+
* </ul>
32+
*
33+
* <p>Sample for EkmServiceClient:
34+
*
35+
* <pre>{@code
36+
* try (EkmServiceClient ekmServiceClient = EkmServiceClient.create()) {
37+
* EkmConnectionName name = EkmConnectionName.of("[PROJECT]", "[LOCATION]", "[EKM_CONNECTION]");
38+
* EkmConnection response = ekmServiceClient.getEkmConnection(name);
39+
* }
40+
* }</pre>
41+
*
2242
* <p>======================= KeyManagementServiceClient =======================
2343
*
2444
* <p>Service Description: Google Cloud Key Management Service

0 commit comments

Comments
 (0)