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

Commit 85a1fc6

Browse files
feat: Add CCAI API
PiperOrigin-RevId: 361003369 Source-Author: Google APIs <[email protected]> Source-Date: Thu Mar 4 14:23:03 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 369e98ef9cbae3fcbd9623ba084af51e54ddec65 Source-Link: googleapis/googleapis@369e98e
1 parent de7d0f7 commit 85a1fc6

251 files changed

Lines changed: 170215 additions & 486 deletions

File tree

Some content is hidden

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

google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/AnswerRecordsClient.java

Lines changed: 553 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
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.dialogflow.v2beta1;
18+
19+
import static com.google.cloud.dialogflow.v2beta1.AnswerRecordsClient.ListAnswerRecordsPagedResponse;
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.dialogflow.v2beta1.stub.AnswerRecordsStubSettings;
33+
import java.io.IOException;
34+
import java.util.List;
35+
import javax.annotation.Generated;
36+
37+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
38+
/**
39+
* Settings class to configure an instance of {@link AnswerRecordsClient}.
40+
*
41+
* <p>The default instance has everything set to sensible defaults:
42+
*
43+
* <ul>
44+
* <li>The default service address (dialogflow.googleapis.com) and default port (443) are used.
45+
* <li>Credentials are acquired automatically through Application Default Credentials.
46+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
47+
* </ul>
48+
*
49+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
50+
* build() is called, the tree of builders is called to create the complete settings object.
51+
*
52+
* <p>For example, to set the total timeout of getAnswerRecord to 30 seconds:
53+
*
54+
* <pre>{@code
55+
* AnswerRecordsSettings.Builder answerRecordsSettingsBuilder = AnswerRecordsSettings.newBuilder();
56+
* answerRecordsSettingsBuilder
57+
* .getAnswerRecordSettings()
58+
* .setRetrySettings(
59+
* answerRecordsSettingsBuilder
60+
* .getAnswerRecordSettings()
61+
* .getRetrySettings()
62+
* .toBuilder()
63+
* .setTotalTimeout(Duration.ofSeconds(30))
64+
* .build());
65+
* AnswerRecordsSettings answerRecordsSettings = answerRecordsSettingsBuilder.build();
66+
* }</pre>
67+
*/
68+
@BetaApi
69+
@Generated("by gapic-generator-java")
70+
public class AnswerRecordsSettings extends ClientSettings<AnswerRecordsSettings> {
71+
72+
/** Returns the object with the settings used for calls to getAnswerRecord. */
73+
public UnaryCallSettings<GetAnswerRecordRequest, AnswerRecord> getAnswerRecordSettings() {
74+
return ((AnswerRecordsStubSettings) getStubSettings()).getAnswerRecordSettings();
75+
}
76+
77+
/** Returns the object with the settings used for calls to listAnswerRecords. */
78+
public PagedCallSettings<
79+
ListAnswerRecordsRequest, ListAnswerRecordsResponse, ListAnswerRecordsPagedResponse>
80+
listAnswerRecordsSettings() {
81+
return ((AnswerRecordsStubSettings) getStubSettings()).listAnswerRecordsSettings();
82+
}
83+
84+
/** Returns the object with the settings used for calls to updateAnswerRecord. */
85+
public UnaryCallSettings<UpdateAnswerRecordRequest, AnswerRecord> updateAnswerRecordSettings() {
86+
return ((AnswerRecordsStubSettings) getStubSettings()).updateAnswerRecordSettings();
87+
}
88+
89+
public static final AnswerRecordsSettings create(AnswerRecordsStubSettings stub)
90+
throws IOException {
91+
return new AnswerRecordsSettings.Builder(stub.toBuilder()).build();
92+
}
93+
94+
/** Returns a builder for the default ExecutorProvider for this service. */
95+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
96+
return AnswerRecordsStubSettings.defaultExecutorProviderBuilder();
97+
}
98+
99+
/** Returns the default service endpoint. */
100+
public static String getDefaultEndpoint() {
101+
return AnswerRecordsStubSettings.getDefaultEndpoint();
102+
}
103+
104+
/** Returns the default service scopes. */
105+
public static List<String> getDefaultServiceScopes() {
106+
return AnswerRecordsStubSettings.getDefaultServiceScopes();
107+
}
108+
109+
/** Returns a builder for the default credentials for this service. */
110+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
111+
return AnswerRecordsStubSettings.defaultCredentialsProviderBuilder();
112+
}
113+
114+
/** Returns a builder for the default ChannelProvider for this service. */
115+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
116+
return AnswerRecordsStubSettings.defaultGrpcTransportProviderBuilder();
117+
}
118+
119+
public static TransportChannelProvider defaultTransportChannelProvider() {
120+
return AnswerRecordsStubSettings.defaultTransportChannelProvider();
121+
}
122+
123+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
124+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
125+
return AnswerRecordsStubSettings.defaultApiClientHeaderProviderBuilder();
126+
}
127+
128+
/** Returns a new builder for this class. */
129+
public static Builder newBuilder() {
130+
return Builder.createDefault();
131+
}
132+
133+
/** Returns a new builder for this class. */
134+
public static Builder newBuilder(ClientContext clientContext) {
135+
return new Builder(clientContext);
136+
}
137+
138+
/** Returns a builder containing all the values of this settings class. */
139+
public Builder toBuilder() {
140+
return new Builder(this);
141+
}
142+
143+
protected AnswerRecordsSettings(Builder settingsBuilder) throws IOException {
144+
super(settingsBuilder);
145+
}
146+
147+
/** Builder for AnswerRecordsSettings. */
148+
public static class Builder extends ClientSettings.Builder<AnswerRecordsSettings, Builder> {
149+
150+
protected Builder() throws IOException {
151+
this(((ClientContext) null));
152+
}
153+
154+
protected Builder(ClientContext clientContext) {
155+
super(AnswerRecordsStubSettings.newBuilder(clientContext));
156+
}
157+
158+
protected Builder(AnswerRecordsSettings settings) {
159+
super(settings.getStubSettings().toBuilder());
160+
}
161+
162+
protected Builder(AnswerRecordsStubSettings.Builder stubSettings) {
163+
super(stubSettings);
164+
}
165+
166+
private static Builder createDefault() {
167+
return new Builder(AnswerRecordsStubSettings.newBuilder());
168+
}
169+
170+
public AnswerRecordsStubSettings.Builder getStubSettingsBuilder() {
171+
return ((AnswerRecordsStubSettings.Builder) getStubSettings());
172+
}
173+
174+
// NEXT_MAJOR_VER: remove 'throws Exception'.
175+
/**
176+
* Applies the given settings updater function to all of the unary API methods in this service.
177+
*
178+
* <p>Note: This method does not support applying settings to streaming methods.
179+
*/
180+
public Builder applyToAllUnaryMethods(
181+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
182+
super.applyToAllUnaryMethods(
183+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
184+
return this;
185+
}
186+
187+
/** Returns the builder for the settings used for calls to getAnswerRecord. */
188+
public UnaryCallSettings.Builder<GetAnswerRecordRequest, AnswerRecord>
189+
getAnswerRecordSettings() {
190+
return getStubSettingsBuilder().getAnswerRecordSettings();
191+
}
192+
193+
/** Returns the builder for the settings used for calls to listAnswerRecords. */
194+
public PagedCallSettings.Builder<
195+
ListAnswerRecordsRequest, ListAnswerRecordsResponse, ListAnswerRecordsPagedResponse>
196+
listAnswerRecordsSettings() {
197+
return getStubSettingsBuilder().listAnswerRecordsSettings();
198+
}
199+
200+
/** Returns the builder for the settings used for calls to updateAnswerRecord. */
201+
public UnaryCallSettings.Builder<UpdateAnswerRecordRequest, AnswerRecord>
202+
updateAnswerRecordSettings() {
203+
return getStubSettingsBuilder().updateAnswerRecordSettings();
204+
}
205+
206+
@Override
207+
public AnswerRecordsSettings build() throws IOException {
208+
return new AnswerRecordsSettings(this);
209+
}
210+
}
211+
}

0 commit comments

Comments
 (0)