Skip to content

Commit b4f07c2

Browse files
feat: added Speech-to-Text V2 API proto
The next generation Speech-to-Text V2 API provides the same features clients are familiar with in the existing Speech-to-Text API, while modernizing and simplifying the API using API best practices, resourceful methods, and updated infrastructure. Although this proto is published, the service is not yet available. PiperOrigin-RevId: 474926510 Source-Link: googleapis/googleapis@bb4d7f4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9ecdb75038b10cfe4685d8a301e2abf8e4dfaa48 Copy-Tag: eyJwIjoiamF2YS1zcGVlY2gvLk93bEJvdC55YW1sIiwiaCI6IjllY2RiNzUwMzhiMTBjZmU0Njg1ZDhhMzAxZTJhYmY4ZTRkZmFhNDgifQ==
1 parent 36fb66a commit b4f07c2

File tree

556 files changed

+229251
-0
lines changed

Some content is hidden

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

556 files changed

+229251
-0
lines changed

owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java

Lines changed: 1674 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
/*
2+
* Copyright 2022 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.speech.v1;
18+
19+
import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse;
20+
import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse;
21+
22+
import com.google.api.core.ApiFunction;
23+
import com.google.api.core.BetaApi;
24+
import com.google.api.gax.core.GoogleCredentialsProvider;
25+
import com.google.api.gax.core.InstantiatingExecutorProvider;
26+
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
27+
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
28+
import com.google.api.gax.rpc.ApiClientHeaderProvider;
29+
import com.google.api.gax.rpc.ClientContext;
30+
import com.google.api.gax.rpc.ClientSettings;
31+
import com.google.api.gax.rpc.PagedCallSettings;
32+
import com.google.api.gax.rpc.StubSettings;
33+
import com.google.api.gax.rpc.TransportChannelProvider;
34+
import com.google.api.gax.rpc.UnaryCallSettings;
35+
import com.google.cloud.speech.v1.stub.AdaptationStubSettings;
36+
import com.google.protobuf.Empty;
37+
import java.io.IOException;
38+
import java.util.List;
39+
import javax.annotation.Generated;
40+
41+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
42+
/**
43+
* Settings class to configure an instance of {@link AdaptationClient}.
44+
*
45+
* <p>The default instance has everything set to sensible defaults:
46+
*
47+
* <ul>
48+
* <li>The default service address (speech.googleapis.com) and default port (443) are used.
49+
* <li>Credentials are acquired automatically through Application Default Credentials.
50+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
51+
* </ul>
52+
*
53+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
54+
* build() is called, the tree of builders is called to create the complete settings object.
55+
*
56+
* <p>For example, to set the total timeout of createPhraseSet to 30 seconds:
57+
*
58+
* <pre>{@code
59+
* // This snippet has been automatically generated and should be regarded as a code template only.
60+
* // It will require modifications to work:
61+
* // - It may require correct/in-range values for request initialization.
62+
* // - It may require specifying regional endpoints when creating the service client as shown in
63+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
64+
* AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
65+
* adaptationSettingsBuilder
66+
* .createPhraseSetSettings()
67+
* .setRetrySettings(
68+
* adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
69+
* .setTotalTimeout(Duration.ofSeconds(30))
70+
* .build());
71+
* AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
72+
* }</pre>
73+
*/
74+
@Generated("by gapic-generator-java")
75+
public class AdaptationSettings extends ClientSettings<AdaptationSettings> {
76+
77+
/** Returns the object with the settings used for calls to createPhraseSet. */
78+
public UnaryCallSettings<CreatePhraseSetRequest, PhraseSet> createPhraseSetSettings() {
79+
return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings();
80+
}
81+
82+
/** Returns the object with the settings used for calls to getPhraseSet. */
83+
public UnaryCallSettings<GetPhraseSetRequest, PhraseSet> getPhraseSetSettings() {
84+
return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings();
85+
}
86+
87+
/** Returns the object with the settings used for calls to listPhraseSet. */
88+
public PagedCallSettings<ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>
89+
listPhraseSetSettings() {
90+
return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings();
91+
}
92+
93+
/** Returns the object with the settings used for calls to updatePhraseSet. */
94+
public UnaryCallSettings<UpdatePhraseSetRequest, PhraseSet> updatePhraseSetSettings() {
95+
return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings();
96+
}
97+
98+
/** Returns the object with the settings used for calls to deletePhraseSet. */
99+
public UnaryCallSettings<DeletePhraseSetRequest, Empty> deletePhraseSetSettings() {
100+
return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings();
101+
}
102+
103+
/** Returns the object with the settings used for calls to createCustomClass. */
104+
public UnaryCallSettings<CreateCustomClassRequest, CustomClass> createCustomClassSettings() {
105+
return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings();
106+
}
107+
108+
/** Returns the object with the settings used for calls to getCustomClass. */
109+
public UnaryCallSettings<GetCustomClassRequest, CustomClass> getCustomClassSettings() {
110+
return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings();
111+
}
112+
113+
/** Returns the object with the settings used for calls to listCustomClasses. */
114+
public PagedCallSettings<
115+
ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse>
116+
listCustomClassesSettings() {
117+
return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings();
118+
}
119+
120+
/** Returns the object with the settings used for calls to updateCustomClass. */
121+
public UnaryCallSettings<UpdateCustomClassRequest, CustomClass> updateCustomClassSettings() {
122+
return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings();
123+
}
124+
125+
/** Returns the object with the settings used for calls to deleteCustomClass. */
126+
public UnaryCallSettings<DeleteCustomClassRequest, Empty> deleteCustomClassSettings() {
127+
return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings();
128+
}
129+
130+
public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException {
131+
return new AdaptationSettings.Builder(stub.toBuilder()).build();
132+
}
133+
134+
/** Returns a builder for the default ExecutorProvider for this service. */
135+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
136+
return AdaptationStubSettings.defaultExecutorProviderBuilder();
137+
}
138+
139+
/** Returns the default service endpoint. */
140+
public static String getDefaultEndpoint() {
141+
return AdaptationStubSettings.getDefaultEndpoint();
142+
}
143+
144+
/** Returns the default service scopes. */
145+
public static List<String> getDefaultServiceScopes() {
146+
return AdaptationStubSettings.getDefaultServiceScopes();
147+
}
148+
149+
/** Returns a builder for the default credentials for this service. */
150+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
151+
return AdaptationStubSettings.defaultCredentialsProviderBuilder();
152+
}
153+
154+
/** Returns a builder for the default gRPC ChannelProvider for this service. */
155+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
156+
return AdaptationStubSettings.defaultGrpcTransportProviderBuilder();
157+
}
158+
159+
/** Returns a builder for the default REST ChannelProvider for this service. */
160+
@BetaApi
161+
public static InstantiatingHttpJsonChannelProvider.Builder
162+
defaultHttpJsonTransportProviderBuilder() {
163+
return AdaptationStubSettings.defaultHttpJsonTransportProviderBuilder();
164+
}
165+
166+
public static TransportChannelProvider defaultTransportChannelProvider() {
167+
return AdaptationStubSettings.defaultTransportChannelProvider();
168+
}
169+
170+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
171+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
172+
return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder();
173+
}
174+
175+
/** Returns a new gRPC builder for this class. */
176+
public static Builder newBuilder() {
177+
return Builder.createDefault();
178+
}
179+
180+
/** Returns a new REST builder for this class. */
181+
@BetaApi
182+
public static Builder newHttpJsonBuilder() {
183+
return Builder.createHttpJsonDefault();
184+
}
185+
186+
/** Returns a new builder for this class. */
187+
public static Builder newBuilder(ClientContext clientContext) {
188+
return new Builder(clientContext);
189+
}
190+
191+
/** Returns a builder containing all the values of this settings class. */
192+
public Builder toBuilder() {
193+
return new Builder(this);
194+
}
195+
196+
protected AdaptationSettings(Builder settingsBuilder) throws IOException {
197+
super(settingsBuilder);
198+
}
199+
200+
/** Builder for AdaptationSettings. */
201+
public static class Builder extends ClientSettings.Builder<AdaptationSettings, Builder> {
202+
203+
protected Builder() throws IOException {
204+
this(((ClientContext) null));
205+
}
206+
207+
protected Builder(ClientContext clientContext) {
208+
super(AdaptationStubSettings.newBuilder(clientContext));
209+
}
210+
211+
protected Builder(AdaptationSettings settings) {
212+
super(settings.getStubSettings().toBuilder());
213+
}
214+
215+
protected Builder(AdaptationStubSettings.Builder stubSettings) {
216+
super(stubSettings);
217+
}
218+
219+
private static Builder createDefault() {
220+
return new Builder(AdaptationStubSettings.newBuilder());
221+
}
222+
223+
@BetaApi
224+
private static Builder createHttpJsonDefault() {
225+
return new Builder(AdaptationStubSettings.newHttpJsonBuilder());
226+
}
227+
228+
public AdaptationStubSettings.Builder getStubSettingsBuilder() {
229+
return ((AdaptationStubSettings.Builder) getStubSettings());
230+
}
231+
232+
/**
233+
* Applies the given settings updater function to all of the unary API methods in this service.
234+
*
235+
* <p>Note: This method does not support applying settings to streaming methods.
236+
*/
237+
public Builder applyToAllUnaryMethods(
238+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
239+
super.applyToAllUnaryMethods(
240+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
241+
return this;
242+
}
243+
244+
/** Returns the builder for the settings used for calls to createPhraseSet. */
245+
public UnaryCallSettings.Builder<CreatePhraseSetRequest, PhraseSet> createPhraseSetSettings() {
246+
return getStubSettingsBuilder().createPhraseSetSettings();
247+
}
248+
249+
/** Returns the builder for the settings used for calls to getPhraseSet. */
250+
public UnaryCallSettings.Builder<GetPhraseSetRequest, PhraseSet> getPhraseSetSettings() {
251+
return getStubSettingsBuilder().getPhraseSetSettings();
252+
}
253+
254+
/** Returns the builder for the settings used for calls to listPhraseSet. */
255+
public PagedCallSettings.Builder<
256+
ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>
257+
listPhraseSetSettings() {
258+
return getStubSettingsBuilder().listPhraseSetSettings();
259+
}
260+
261+
/** Returns the builder for the settings used for calls to updatePhraseSet. */
262+
public UnaryCallSettings.Builder<UpdatePhraseSetRequest, PhraseSet> updatePhraseSetSettings() {
263+
return getStubSettingsBuilder().updatePhraseSetSettings();
264+
}
265+
266+
/** Returns the builder for the settings used for calls to deletePhraseSet. */
267+
public UnaryCallSettings.Builder<DeletePhraseSetRequest, Empty> deletePhraseSetSettings() {
268+
return getStubSettingsBuilder().deletePhraseSetSettings();
269+
}
270+
271+
/** Returns the builder for the settings used for calls to createCustomClass. */
272+
public UnaryCallSettings.Builder<CreateCustomClassRequest, CustomClass>
273+
createCustomClassSettings() {
274+
return getStubSettingsBuilder().createCustomClassSettings();
275+
}
276+
277+
/** Returns the builder for the settings used for calls to getCustomClass. */
278+
public UnaryCallSettings.Builder<GetCustomClassRequest, CustomClass> getCustomClassSettings() {
279+
return getStubSettingsBuilder().getCustomClassSettings();
280+
}
281+
282+
/** Returns the builder for the settings used for calls to listCustomClasses. */
283+
public PagedCallSettings.Builder<
284+
ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse>
285+
listCustomClassesSettings() {
286+
return getStubSettingsBuilder().listCustomClassesSettings();
287+
}
288+
289+
/** Returns the builder for the settings used for calls to updateCustomClass. */
290+
public UnaryCallSettings.Builder<UpdateCustomClassRequest, CustomClass>
291+
updateCustomClassSettings() {
292+
return getStubSettingsBuilder().updateCustomClassSettings();
293+
}
294+
295+
/** Returns the builder for the settings used for calls to deleteCustomClass. */
296+
public UnaryCallSettings.Builder<DeleteCustomClassRequest, Empty> deleteCustomClassSettings() {
297+
return getStubSettingsBuilder().deleteCustomClassSettings();
298+
}
299+
300+
@Override
301+
public AdaptationSettings build() throws IOException {
302+
return new AdaptationSettings(this);
303+
}
304+
}
305+
}

0 commit comments

Comments
 (0)