1
1
/*
2
- * Copyright 2020 Google LLC
2
+ * Copyright 2024 Google LLC
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
6
6
* You may obtain a copy of the License at
7
7
*
8
- * https://www.apache.org/licenses/LICENSE-2.0
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
9
*
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package com .google .cloud .devtools .containeranalysis .v1beta1 ;
17
16
18
- import static com .google .cloud .devtools .containeranalysis .v1beta1 . ContainerAnalysisV1Beta1Client . ListScanConfigsPagedResponse ;
17
+ package com .google .cloud .devtools .containeranalysis .v1beta1 ;
19
18
20
19
import com .google .api .core .ApiFunction ;
21
20
import com .google .api .core .BetaApi ;
22
21
import com .google .api .gax .core .GoogleCredentialsProvider ;
23
22
import com .google .api .gax .core .InstantiatingExecutorProvider ;
24
23
import com .google .api .gax .grpc .InstantiatingGrpcChannelProvider ;
24
+ import com .google .api .gax .httpjson .InstantiatingHttpJsonChannelProvider ;
25
25
import com .google .api .gax .rpc .ApiClientHeaderProvider ;
26
26
import com .google .api .gax .rpc .ClientContext ;
27
27
import com .google .api .gax .rpc .ClientSettings ;
28
- import com .google .api .gax .rpc .PagedCallSettings ;
29
28
import com .google .api .gax .rpc .TransportChannelProvider ;
30
29
import com .google .api .gax .rpc .UnaryCallSettings ;
31
30
import com .google .cloud .devtools .containeranalysis .v1beta1 .stub .ContainerAnalysisV1Beta1StubSettings ;
32
- import com .google .containeranalysis .v1beta1 .GetScanConfigRequest ;
33
- import com .google .containeranalysis .v1beta1 .ListScanConfigsRequest ;
34
- import com .google .containeranalysis .v1beta1 .ListScanConfigsResponse ;
35
- import com .google .containeranalysis .v1beta1 .ScanConfig ;
36
- import com .google .containeranalysis .v1beta1 .UpdateScanConfigRequest ;
31
+ import com .google .containeranalysis .v1beta1 .ExportSBOMRequest ;
32
+ import com .google .containeranalysis .v1beta1 .ExportSBOMResponse ;
33
+ import com .google .containeranalysis .v1beta1 .GeneratePackagesSummaryRequest ;
34
+ import com .google .containeranalysis .v1beta1 .PackagesSummaryResponse ;
37
35
import com .google .iam .v1 .GetIamPolicyRequest ;
38
36
import com .google .iam .v1 .Policy ;
39
37
import com .google .iam .v1 .SetIamPolicyRequest ;
43
41
import java .util .List ;
44
42
import javax .annotation .Generated ;
45
43
46
- // AUTO-GENERATED DOCUMENTATION AND CLASS
44
+ // AUTO-GENERATED DOCUMENTATION AND CLASS.
47
45
/**
48
46
* Settings class to configure an instance of {@link ContainerAnalysisV1Beta1Client}.
49
47
*
61
59
*
62
60
* <p>For example, to set the total timeout of setIamPolicy to 30 seconds:
63
61
*
64
- * <pre>
65
- * <code>
62
+ * <pre>{@code
63
+ * // This snippet has been automatically generated and should be regarded as a code template only.
64
+ * // It will require modifications to work:
65
+ * // - It may require correct/in-range values for request initialization.
66
+ * // - It may require specifying regional endpoints when creating the service client as shown in
67
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
66
68
* ContainerAnalysisV1Beta1Settings.Builder containerAnalysisV1Beta1SettingsBuilder =
67
69
* ContainerAnalysisV1Beta1Settings.newBuilder();
68
70
* containerAnalysisV1Beta1SettingsBuilder
69
71
* .setIamPolicySettings()
70
72
* .setRetrySettings(
71
- * containerAnalysisV1Beta1SettingsBuilder.setIamPolicySettings().getRetrySettings().toBuilder()
73
+ * containerAnalysisV1Beta1SettingsBuilder
74
+ * .setIamPolicySettings()
75
+ * .getRetrySettings()
76
+ * .toBuilder()
72
77
* .setTotalTimeout(Duration.ofSeconds(30))
73
78
* .build());
74
- * ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings = containerAnalysisV1Beta1SettingsBuilder.build();
75
- * </code>
76
- * </pre>
79
+ * ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
80
+ * containerAnalysisV1Beta1SettingsBuilder.build();
81
+ * } </pre>
77
82
*/
78
- @ Generated ("by gapic-generator" )
79
83
@ BetaApi
84
+ @ Generated ("by gapic-generator-java" )
80
85
public class ContainerAnalysisV1Beta1Settings
81
86
extends ClientSettings <ContainerAnalysisV1Beta1Settings > {
87
+
82
88
/** Returns the object with the settings used for calls to setIamPolicy. */
83
89
public UnaryCallSettings <SetIamPolicyRequest , Policy > setIamPolicySettings () {
84
90
return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ()).setIamPolicySettings ();
@@ -95,21 +101,16 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
95
101
return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ()).testIamPermissionsSettings ();
96
102
}
97
103
98
- /** Returns the object with the settings used for calls to getScanConfig. */
99
- public UnaryCallSettings <GetScanConfigRequest , ScanConfig > getScanConfigSettings () {
100
- return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ()).getScanConfigSettings ();
104
+ /** Returns the object with the settings used for calls to generatePackagesSummary. */
105
+ public UnaryCallSettings <GeneratePackagesSummaryRequest , PackagesSummaryResponse >
106
+ generatePackagesSummarySettings () {
107
+ return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ())
108
+ .generatePackagesSummarySettings ();
101
109
}
102
110
103
- /** Returns the object with the settings used for calls to listScanConfigs. */
104
- public PagedCallSettings <
105
- ListScanConfigsRequest , ListScanConfigsResponse , ListScanConfigsPagedResponse >
106
- listScanConfigsSettings () {
107
- return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ()).listScanConfigsSettings ();
108
- }
109
-
110
- /** Returns the object with the settings used for calls to updateScanConfig. */
111
- public UnaryCallSettings <UpdateScanConfigRequest , ScanConfig > updateScanConfigSettings () {
112
- return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ()).updateScanConfigSettings ();
111
+ /** Returns the object with the settings used for calls to exportSBOM. */
112
+ public UnaryCallSettings <ExportSBOMRequest , ExportSBOMResponse > exportSBOMSettings () {
113
+ return ((ContainerAnalysisV1Beta1StubSettings ) getStubSettings ()).exportSBOMSettings ();
113
114
}
114
115
115
116
public static final ContainerAnalysisV1Beta1Settings create (
@@ -137,25 +138,36 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
137
138
return ContainerAnalysisV1Beta1StubSettings .defaultCredentialsProviderBuilder ();
138
139
}
139
140
140
- /** Returns a builder for the default ChannelProvider for this service. */
141
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
141
142
public static InstantiatingGrpcChannelProvider .Builder defaultGrpcTransportProviderBuilder () {
142
143
return ContainerAnalysisV1Beta1StubSettings .defaultGrpcTransportProviderBuilder ();
143
144
}
144
145
146
+ /** Returns a builder for the default REST ChannelProvider for this service. */
147
+ @ BetaApi
148
+ public static InstantiatingHttpJsonChannelProvider .Builder
149
+ defaultHttpJsonTransportProviderBuilder () {
150
+ return ContainerAnalysisV1Beta1StubSettings .defaultHttpJsonTransportProviderBuilder ();
151
+ }
152
+
145
153
public static TransportChannelProvider defaultTransportChannelProvider () {
146
154
return ContainerAnalysisV1Beta1StubSettings .defaultTransportChannelProvider ();
147
155
}
148
156
149
- @ BetaApi ("The surface for customizing headers is not stable yet and may change in the future." )
150
157
public static ApiClientHeaderProvider .Builder defaultApiClientHeaderProviderBuilder () {
151
158
return ContainerAnalysisV1Beta1StubSettings .defaultApiClientHeaderProviderBuilder ();
152
159
}
153
160
154
- /** Returns a new builder for this class. */
161
+ /** Returns a new gRPC builder for this class. */
155
162
public static Builder newBuilder () {
156
163
return Builder .createDefault ();
157
164
}
158
165
166
+ /** Returns a new REST builder for this class. */
167
+ public static Builder newHttpJsonBuilder () {
168
+ return Builder .createHttpJsonDefault ();
169
+ }
170
+
159
171
/** Returns a new builder for this class. */
160
172
public static Builder newBuilder (ClientContext clientContext ) {
161
173
return new Builder (clientContext );
@@ -173,18 +185,15 @@ protected ContainerAnalysisV1Beta1Settings(Builder settingsBuilder) throws IOExc
173
185
/** Builder for ContainerAnalysisV1Beta1Settings. */
174
186
public static class Builder
175
187
extends ClientSettings .Builder <ContainerAnalysisV1Beta1Settings , Builder > {
188
+
176
189
protected Builder () throws IOException {
177
- this ((ClientContext ) null );
190
+ this ((( ClientContext ) null ) );
178
191
}
179
192
180
193
protected Builder (ClientContext clientContext ) {
181
194
super (ContainerAnalysisV1Beta1StubSettings .newBuilder (clientContext ));
182
195
}
183
196
184
- private static Builder createDefault () {
185
- return new Builder (ContainerAnalysisV1Beta1StubSettings .newBuilder ());
186
- }
187
-
188
197
protected Builder (ContainerAnalysisV1Beta1Settings settings ) {
189
198
super (settings .getStubSettings ().toBuilder ());
190
199
}
@@ -193,18 +202,25 @@ protected Builder(ContainerAnalysisV1Beta1StubSettings.Builder stubSettings) {
193
202
super (stubSettings );
194
203
}
195
204
205
+ private static Builder createDefault () {
206
+ return new Builder (ContainerAnalysisV1Beta1StubSettings .newBuilder ());
207
+ }
208
+
209
+ private static Builder createHttpJsonDefault () {
210
+ return new Builder (ContainerAnalysisV1Beta1StubSettings .newHttpJsonBuilder ());
211
+ }
212
+
196
213
public ContainerAnalysisV1Beta1StubSettings .Builder getStubSettingsBuilder () {
197
214
return ((ContainerAnalysisV1Beta1StubSettings .Builder ) getStubSettings ());
198
215
}
199
216
200
- // NEXT_MAJOR_VER: remove 'throws Exception'
201
217
/**
202
218
* Applies the given settings updater function to all of the unary API methods in this service.
203
219
*
204
220
* <p>Note: This method does not support applying settings to streaming methods.
205
221
*/
206
222
public Builder applyToAllUnaryMethods (
207
- ApiFunction <UnaryCallSettings .Builder <?, ?>, Void > settingsUpdater ) throws Exception {
223
+ ApiFunction <UnaryCallSettings .Builder <?, ?>, Void > settingsUpdater ) {
208
224
super .applyToAllUnaryMethods (
209
225
getStubSettingsBuilder ().unaryMethodSettingsBuilders (), settingsUpdater );
210
226
return this ;
@@ -226,22 +242,15 @@ public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettin
226
242
return getStubSettingsBuilder ().testIamPermissionsSettings ();
227
243
}
228
244
229
- /** Returns the builder for the settings used for calls to getScanConfig. */
230
- public UnaryCallSettings .Builder <GetScanConfigRequest , ScanConfig > getScanConfigSettings () {
231
- return getStubSettingsBuilder ().getScanConfigSettings ();
232
- }
233
-
234
- /** Returns the builder for the settings used for calls to listScanConfigs. */
235
- public PagedCallSettings .Builder <
236
- ListScanConfigsRequest , ListScanConfigsResponse , ListScanConfigsPagedResponse >
237
- listScanConfigsSettings () {
238
- return getStubSettingsBuilder ().listScanConfigsSettings ();
245
+ /** Returns the builder for the settings used for calls to generatePackagesSummary. */
246
+ public UnaryCallSettings .Builder <GeneratePackagesSummaryRequest , PackagesSummaryResponse >
247
+ generatePackagesSummarySettings () {
248
+ return getStubSettingsBuilder ().generatePackagesSummarySettings ();
239
249
}
240
250
241
- /** Returns the builder for the settings used for calls to updateScanConfig. */
242
- public UnaryCallSettings .Builder <UpdateScanConfigRequest , ScanConfig >
243
- updateScanConfigSettings () {
244
- return getStubSettingsBuilder ().updateScanConfigSettings ();
251
+ /** Returns the builder for the settings used for calls to exportSBOM. */
252
+ public UnaryCallSettings .Builder <ExportSBOMRequest , ExportSBOMResponse > exportSBOMSettings () {
253
+ return getStubSettingsBuilder ().exportSBOMSettings ();
245
254
}
246
255
247
256
@ Override
0 commit comments