Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Commit e36e650

Browse files
docs: Update client libraries for v1p1beta1 api (#882)
* feat: Add adaptation proto for v1 api PiperOrigin-RevId: 447561222 Source-Link: googleapis/googleapis@ec9193e Source-Link: https://github.com/googleapis/googleapis-gen/commit/cd279b003e4455c9b805f22fc3b9976ad8639ee6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2QyNzliMDAzZTQ0NTVjOWI4MDVmMjJmYzNiOTk3NmFkODYzOWVlNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Update client libraries for v1p1beta1 api PiperOrigin-RevId: 447572837 Source-Link: googleapis/googleapis@10c88bb Source-Link: https://github.com/googleapis/googleapis-gen/commit/8a8244edb5cfc3f6253041de8fe0b1e7c9863dee Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGE4MjQ0ZWRiNWNmYzNmNjI1MzA0MWRlOGZlMGIxZTdjOTg2M2RlZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Neenu1995
1 parent 0f18fdd commit e36e650

File tree

85 files changed

+20791
-789
lines changed

Some content is hidden

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

85 files changed

+20791
-789
lines changed

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

Lines changed: 1532 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
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.rpc.ApiClientHeaderProvider;
28+
import com.google.api.gax.rpc.ClientContext;
29+
import com.google.api.gax.rpc.ClientSettings;
30+
import com.google.api.gax.rpc.PagedCallSettings;
31+
import com.google.api.gax.rpc.TransportChannelProvider;
32+
import com.google.api.gax.rpc.UnaryCallSettings;
33+
import com.google.cloud.speech.v1.stub.AdaptationStubSettings;
34+
import com.google.protobuf.Empty;
35+
import java.io.IOException;
36+
import java.util.List;
37+
import javax.annotation.Generated;
38+
39+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
40+
/**
41+
* Settings class to configure an instance of {@link AdaptationClient}.
42+
*
43+
*

The default instance has everything set to sensible defaults:

44+
*
45+
*
    46+
    *
  • The default service address (speech.googleapis.com) and default port (443) are used.
  • 47+
    *
  • Credentials are acquired automatically through Application Default Credentials.
  • 48+
    *
  • Retries are configured for idempotent methods but not for non-idempotent methods.
  • 49+
    *
    50+
    *
    51+
    *

    The builder of this class is recursive, so contained classes are themselves builders. When

    52+
    * build() is called, the tree of builders is called to create the complete settings object.
    53+
    *
    54+
    *

    For example, to set the total timeout of createPhraseSet to 30 seconds:

    55+
    *
    56+
    *
    {@code
    57+
    * // This snippet has been automatically generated for illustrative purposes only.
    58+
    * // It may require modifications to work in your environment.
    59+
    * AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
    60+
    * adaptationSettingsBuilder
    61+
    * .createPhraseSetSettings()
    62+
    * .setRetrySettings(
    63+
    * adaptationSettingsBuilder
    64+
    * .createPhraseSetSettings()
    65+
    * .getRetrySettings()
    66+
    * .toBuilder()
    67+
    * .setTotalTimeout(Duration.ofSeconds(30))
    68+
    * .build());
    69+
    * AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
    70+
    * }
    71+
    */
    72+
    @Generated("by gapic-generator-java")
    73+
    public class AdaptationSettings extends ClientSettings<AdaptationSettings> {
    74+
    75+
    /** Returns the object with the settings used for calls to createPhraseSet. */
    76+
    public UnaryCallSettings<CreatePhraseSetRequest, PhraseSet> createPhraseSetSettings() {
    77+
    return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings();
    78+
    }
    79+
    80+
    /** Returns the object with the settings used for calls to getPhraseSet. */
    81+
    public UnaryCallSettings<GetPhraseSetRequest, PhraseSet> getPhraseSetSettings() {
    82+
    return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings();
    83+
    }
    84+
    85+
    /** Returns the object with the settings used for calls to listPhraseSet. */
    86+
    public PagedCallSettings<ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>
    87+
    listPhraseSetSettings() {
    88+
    return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings();
    89+
    }
    90+
    91+
    /** Returns the object with the settings used for calls to updatePhraseSet. */
    92+
    public UnaryCallSettings<UpdatePhraseSetRequest, PhraseSet> updatePhraseSetSettings() {
    93+
    return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings();
    94+
    }
    95+
    96+
    /** Returns the object with the settings used for calls to deletePhraseSet. */
    97+
    public UnaryCallSettings<DeletePhraseSetRequest, Empty> deletePhraseSetSettings() {
    98+
    return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings();
    99+
    }
    100+
    101+
    /** Returns the object with the settings used for calls to createCustomClass. */
    102+
    public UnaryCallSettings<CreateCustomClassRequest, CustomClass> createCustomClassSettings() {
    103+
    return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings();
    104+
    }
    105+
    106+
    /** Returns the object with the settings used for calls to getCustomClass. */
    107+
    public UnaryCallSettings<GetCustomClassRequest, CustomClass> getCustomClassSettings() {
    108+
    return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings();
    109+
    }
    110+
    111+
    /** Returns the object with the settings used for calls to listCustomClasses. */
    112+
    public PagedCallSettings<
    113+
    ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse>
    114+
    listCustomClassesSettings() {
    115+
    return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings();
    116+
    }
    117+
    118+
    /** Returns the object with the settings used for calls to updateCustomClass. */
    119+
    public UnaryCallSettings<UpdateCustomClassRequest, CustomClass> updateCustomClassSettings() {
    120+
    return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings();
    121+
    }
    122+
    123+
    /** Returns the object with the settings used for calls to deleteCustomClass. */
    124+
    public UnaryCallSettings<DeleteCustomClassRequest, Empty> deleteCustomClassSettings() {
    125+
    return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings();
    126+
    }
    127+
    128+
    public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException {
    129+
    return new AdaptationSettings.Builder(stub.toBuilder()).build();
    130+
    }
    131+
    132+
    /** Returns a builder for the default ExecutorProvider for this service. */
    133+
    public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
    134+
    return AdaptationStubSettings.defaultExecutorProviderBuilder();
    135+
    }
    136+
    137+
    /** Returns the default service endpoint. */
    138+
    public static String getDefaultEndpoint() {
    139+
    return AdaptationStubSettings.getDefaultEndpoint();
    140+
    }
    141+
    142+
    /** Returns the default service scopes. */
    143+
    public static List<String> getDefaultServiceScopes() {
    144+
    return AdaptationStubSettings.getDefaultServiceScopes();
    145+
    }
    146+
    147+
    /** Returns a builder for the default credentials for this service. */
    148+
    public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
    149+
    return AdaptationStubSettings.defaultCredentialsProviderBuilder();
    150+
    }
    151+
    152+
    /** Returns a builder for the default ChannelProvider for this service. */
    153+
    public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
    154+
    return AdaptationStubSettings.defaultGrpcTransportProviderBuilder();
    155+
    }
    156+
    157+
    public static TransportChannelProvider defaultTransportChannelProvider() {
    158+
    return AdaptationStubSettings.defaultTransportChannelProvider();
    159+
    }
    160+
    161+
    @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
    162+
    public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
    163+
    return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder();
    164+
    }
    165+
    166+
    /** Returns a new builder for this class. */
    167+
    public static Builder newBuilder() {
    168+
    return Builder.createDefault();
    169+
    }
    170+
    171+
    /** Returns a new builder for this class. */
    172+
    public static Builder newBuilder(ClientContext clientContext) {
    173+
    return new Builder(clientContext);
    174+
    }
    175+
    176+
    /** Returns a builder containing all the values of this settings class. */
    177+
    public Builder toBuilder() {
    178+
    return new Builder(this);
    179+
    }
    180+
    181+
    protected AdaptationSettings(Builder settingsBuilder) throws IOException {
    182+
    super(settingsBuilder);
    183+
    }
    184+
    185+
    /** Builder for AdaptationSettings. */
    186+
    public static class Builder extends ClientSettings.Builder<AdaptationSettings, Builder> {
    187+
    188+
    protected Builder() throws IOException {
    189+
    this(((ClientContext) null));
    190+
    }
    191+
    192+
    protected Builder(ClientContext clientContext) {
    193+
    super(AdaptationStubSettings.newBuilder(clientContext));
    194+
    }
    195+
    196+
    protected Builder(AdaptationSettings settings) {
    197+
    super(settings.getStubSettings().toBuilder());
    198+
    }
    199+
    200+
    protected Builder(AdaptationStubSettings.Builder stubSettings) {
    201+
    super(stubSettings);
    202+
    }
    203+
    204+
    private static Builder createDefault() {
    205+
    return new Builder(AdaptationStubSettings.newBuilder());
    206+
    }
    207+
    208+
    public AdaptationStubSettings.Builder getStubSettingsBuilder() {
    209+
    return ((AdaptationStubSettings.Builder) getStubSettings());
    210+
    }
    211+
    212+
    /**
    213+
    * Applies the given settings updater function to all of the unary API methods in this service.
    214+
    *
    215+
    *

    Note: This method does not support applying settings to streaming methods.

    216+
    */
    217+
    public Builder applyToAllUnaryMethods(
    218+
    ApiFunction<UnaryCallSettings.Builder, Void> settingsUpdater) {
    219+
    super.applyToAllUnaryMethods(
    220+
    getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
    221+
    return this;
    222+
    }
    223+
    224+
    /** Returns the builder for the settings used for calls to createPhraseSet. */
    225+
    public UnaryCallSettings.Builder<CreatePhraseSetRequest, PhraseSet> createPhraseSetSettings() {
    226+
    return getStubSettingsBuilder().createPhraseSetSettings();
    227+
    }
    228+
    229+
    /** Returns the builder for the settings used for calls to getPhraseSet. */
    230+
    public UnaryCallSettings.Builder<GetPhraseSetRequest, PhraseSet> getPhraseSetSettings() {
    231+
    return getStubSettingsBuilder().getPhraseSetSettings();
    232+
    }
    233+
    234+
    /** Returns the builder for the settings used for calls to listPhraseSet. */
    235+
    public PagedCallSettings.Builder<
    236+
    ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>
    237+
    listPhraseSetSettings() {
    238+
    return getStubSettingsBuilder().listPhraseSetSettings();
    239+
    }
    240+
    241+
    /** Returns the builder for the settings used for calls to updatePhraseSet. */
    242+
    public UnaryCallSettings.Builder<UpdatePhraseSetRequest, PhraseSet> updatePhraseSetSettings() {
    243+
    return getStubSettingsBuilder().updatePhraseSetSettings();
    244+
    }
    245+
    246+
    /** Returns the builder for the settings used for calls to deletePhraseSet. */
    247+
    public UnaryCallSettings.Builder<DeletePhraseSetRequest, Empty> deletePhraseSetSettings() {
    248+
    return getStubSettingsBuilder().deletePhraseSetSettings();
    249+
    }
    250+
    251+
    /** Returns the builder for the settings used for calls to createCustomClass. */
    252+
    public UnaryCallSettings.Builder<CreateCustomClassRequest, CustomClass>
    253+
    createCustomClassSettings() {
    254+
    return getStubSettingsBuilder().createCustomClassSettings();
    255+
    }
    256+
    257+
    /** Returns the builder for the settings used for calls to getCustomClass. */
    258+
    public UnaryCallSettings.Builder<GetCustomClassRequest, CustomClass> getCustomClassSettings() {
    259+
    return getStubSettingsBuilder().getCustomClassSettings();
    260+
    }
    261+
    262+
    /** Returns the builder for the settings used for calls to listCustomClasses. */
    263+
    public PagedCallSettings.Builder<
    264+
    ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse>
    265+
    listCustomClassesSettings() {
    266+
    return getStubSettingsBuilder().listCustomClassesSettings();
    267+
    }
    268+
    269+
    /** Returns the builder for the settings used for calls to updateCustomClass. */
    270+
    public UnaryCallSettings.Builder<UpdateCustomClassRequest, CustomClass>
    271+
    updateCustomClassSettings() {
    272+
    return getStubSettingsBuilder().updateCustomClassSettings();
    273+
    }
    274+
    275+
    /** Returns the builder for the settings used for calls to deleteCustomClass. */
    276+
    public UnaryCallSettings.Builder<DeleteCustomClassRequest, Empty> deleteCustomClassSettings() {
    277+
    return getStubSettingsBuilder().deleteCustomClassSettings();
    278+
    }
    279+
    280+
    @Override
    281+
    public AdaptationSettings build() throws IOException {
    282+
    return new AdaptationSettings(this);
    283+
    }
    284+
    }
    285+
    }

    google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json

    Lines changed: 39 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -22,6 +22,45 @@
    2222
    }
    2323
    }
    2424
    }
    25+
    },
    26+
    "Adaptation": {
    27+
    "clients": {
    28+
    "grpc": {
    29+
    "libraryClient": "AdaptationClient",
    30+
    "rpcs": {
    31+
    "CreateCustomClass": {
    32+
    "methods": ["createCustomClass", "createCustomClass", "createCustomClass", "createCustomClassCallable"]
    33+
    },
    34+
    "CreatePhraseSet": {
    35+
    "methods": ["createPhraseSet", "createPhraseSet", "createPhraseSet", "createPhraseSetCallable"]
    36+
    },
    37+
    "DeleteCustomClass": {
    38+
    "methods": ["deleteCustomClass", "deleteCustomClass", "deleteCustomClass", "deleteCustomClassCallable"]
    39+
    },
    40+
    "DeletePhraseSet": {
    41+
    "methods": ["deletePhraseSet", "deletePhraseSet", "deletePhraseSet", "deletePhraseSetCallable"]
    42+
    },
    43+
    "GetCustomClass": {
    44+
    "methods": ["getCustomClass", "getCustomClass", "getCustomClass", "getCustomClassCallable"]
    45+
    },
    46+
    "GetPhraseSet": {
    47+
    "methods": ["getPhraseSet", "getPhraseSet", "getPhraseSet", "getPhraseSetCallable"]
    48+
    },
    49+
    "ListCustomClasses": {
    50+
    "methods": ["listCustomClasses", "listCustomClasses", "listCustomClasses", "listCustomClassesPagedCallable", "listCustomClassesCallable"]
    51+
    },
    52+
    "ListPhraseSet": {
    53+
    "methods": ["listPhraseSet", "listPhraseSet", "listPhraseSet", "listPhraseSetPagedCallable", "listPhraseSetCallable"]
    54+
    },
    55+
    "UpdateCustomClass": {
    56+
    "methods": ["updateCustomClass", "updateCustomClass", "updateCustomClassCallable"]
    57+
    },
    58+
    "UpdatePhraseSet": {
    59+
    "methods": ["updatePhraseSet", "updatePhraseSet", "updatePhraseSetCallable"]
    60+
    }
    61+
    }
    62+
    }
    63+
    }
    2564
    }
    2665
    }
    2766
    }

    google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java

    Lines changed: 17 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -34,6 +34,23 @@
    3434
    * RecognizeResponse response = speechClient.recognize(config, audio);
    3535
    * }
    3636
    * }
    37+
    *
    38+
    *

    ======================= AdaptationClient =======================

    39+
    *
    40+
    *

    Service Description: Service that implements Google Cloud Speech Adaptation API.

    41+
    *
    42+
    *

    Sample for AdaptationClient:

    43+
    *
    44+
    *
    {@code
    45+
    * // This snippet has been automatically generated for illustrative purposes only.
    46+
    * // It may require modifications to work in your environment.
    47+
    * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
    48+
    * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
    49+
    * PhraseSet phraseSet = PhraseSet.newBuilder().build();
    50+
    * String phraseSetId = "phraseSetId959902180";
    51+
    * PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
    52+
    * }
    53+
    * }
    3754
    */
    3855
    @Generated("by gapic-generator-java")
    3956
    package com.google.cloud.speech.v1;

    0 commit comments

    Comments
     (0)