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

Commit ca54151

Browse files
feat: add featurestore, index, metadata, monitoring, pipeline, and tensorboard services to aiplatform v1beta1 (#341)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/168473a3-780b-4b0c-8c80-4ad07da84f55/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) PiperOrigin-RevId: 371996826 Source-Link: googleapis/googleapis@8e2d88f
1 parent d1f1ae2 commit ca54151

File tree

609 files changed

+386354
-961
lines changed

Some content is hidden

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

609 files changed

+386354
-961
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,335 @@
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.aiplatform.v1beta1;
18+
19+
import com.google.api.core.BetaApi;
20+
import com.google.api.gax.core.BackgroundResource;
21+
import com.google.api.gax.rpc.ServerStreamingCallable;
22+
import com.google.api.gax.rpc.UnaryCallable;
23+
import com.google.cloud.aiplatform.v1beta1.stub.FeaturestoreOnlineServingServiceStub;
24+
import com.google.cloud.aiplatform.v1beta1.stub.FeaturestoreOnlineServingServiceStubSettings;
25+
import java.io.IOException;
26+
import java.util.concurrent.TimeUnit;
27+
import javax.annotation.Generated;
28+
29+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
30+
/**
31+
* Service Description: A service for serving online feature values.
32+
*
33+
* <p>This class provides the ability to make remote calls to the backing service through method
34+
* calls that map to API methods. Sample code to get started:
35+
*
36+
* <pre>{@code
37+
* try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
38+
* FeaturestoreOnlineServingServiceClient.create()) {
39+
* EntityTypeName entityType =
40+
* EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]");
41+
* ReadFeatureValuesResponse response =
42+
* featurestoreOnlineServingServiceClient.readFeatureValues(entityType);
43+
* }
44+
* }</pre>
45+
*
46+
* <p>Note: close() needs to be called on the FeaturestoreOnlineServingServiceClient object to clean
47+
* up resources such as threads. In the example above, try-with-resources is used, which
48+
* automatically calls close().
49+
*
50+
* <p>The surface of this class includes several types of Java methods for each of the API's
51+
* methods:
52+
*
53+
* <ol>
54+
* <li>A "flattened" method. With this type of method, the fields of the request type have been
55+
* converted into function parameters. It may be the case that not all fields are available as
56+
* parameters, and not every API method will have a flattened method entry point.
57+
* <li>A "request object" method. This type of method only takes one parameter, a request object,
58+
* which must be constructed before the call. Not every API method will have a request object
59+
* method.
60+
* <li>A "callable" method. This type of method takes no parameters and returns an immutable API
61+
* callable object, which can be used to initiate calls to the service.
62+
* </ol>
63+
*
64+
* <p>See the individual methods for example code.
65+
*
66+
* <p>Many parameters require resource names to be formatted in a particular way. To assist with
67+
* these names, this class includes a format method for each type of name, and additionally a parse
68+
* method to extract the individual identifiers contained within names that are returned.
69+
*
70+
* <p>This class can be customized by passing in a custom instance of
71+
* FeaturestoreOnlineServingServiceSettings to create(). For example:
72+
*
73+
* <p>To customize credentials:
74+
*
75+
* <pre>{@code
76+
* FeaturestoreOnlineServingServiceSettings featurestoreOnlineServingServiceSettings =
77+
* FeaturestoreOnlineServingServiceSettings.newBuilder()
78+
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
79+
* .build();
80+
* FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
81+
* FeaturestoreOnlineServingServiceClient.create(featurestoreOnlineServingServiceSettings);
82+
* }</pre>
83+
*
84+
* <p>To customize the endpoint:
85+
*
86+
* <pre>{@code
87+
* FeaturestoreOnlineServingServiceSettings featurestoreOnlineServingServiceSettings =
88+
* FeaturestoreOnlineServingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
89+
* FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
90+
* FeaturestoreOnlineServingServiceClient.create(featurestoreOnlineServingServiceSettings);
91+
* }</pre>
92+
*
93+
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
94+
*/
95+
@BetaApi
96+
@Generated("by gapic-generator-java")
97+
public class FeaturestoreOnlineServingServiceClient implements BackgroundResource {
98+
private final FeaturestoreOnlineServingServiceSettings settings;
99+
private final FeaturestoreOnlineServingServiceStub stub;
100+
101+
/** Constructs an instance of FeaturestoreOnlineServingServiceClient with default settings. */
102+
public static final FeaturestoreOnlineServingServiceClient create() throws IOException {
103+
return create(FeaturestoreOnlineServingServiceSettings.newBuilder().build());
104+
}
105+
106+
/**
107+
* Constructs an instance of FeaturestoreOnlineServingServiceClient, using the given settings. The
108+
* channels are created based on the settings passed in, or defaults for any settings that are not
109+
* set.
110+
*/
111+
public static final FeaturestoreOnlineServingServiceClient create(
112+
FeaturestoreOnlineServingServiceSettings settings) throws IOException {
113+
return new FeaturestoreOnlineServingServiceClient(settings);
114+
}
115+
116+
/**
117+
* Constructs an instance of FeaturestoreOnlineServingServiceClient, using the given stub for
118+
* making calls. This is for advanced usage - prefer using
119+
* create(FeaturestoreOnlineServingServiceSettings).
120+
*/
121+
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
122+
public static final FeaturestoreOnlineServingServiceClient create(
123+
FeaturestoreOnlineServingServiceStub stub) {
124+
return new FeaturestoreOnlineServingServiceClient(stub);
125+
}
126+
127+
/**
128+
* Constructs an instance of FeaturestoreOnlineServingServiceClient, using the given settings.
129+
* This is protected so that it is easy to make a subclass, but otherwise, the static factory
130+
* methods should be preferred.
131+
*/
132+
protected FeaturestoreOnlineServingServiceClient(
133+
FeaturestoreOnlineServingServiceSettings settings) throws IOException {
134+
this.settings = settings;
135+
this.stub =
136+
((FeaturestoreOnlineServingServiceStubSettings) settings.getStubSettings()).createStub();
137+
}
138+
139+
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
140+
protected FeaturestoreOnlineServingServiceClient(FeaturestoreOnlineServingServiceStub stub) {
141+
this.settings = null;
142+
this.stub = stub;
143+
}
144+
145+
public final FeaturestoreOnlineServingServiceSettings getSettings() {
146+
return settings;
147+
}
148+
149+
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
150+
public FeaturestoreOnlineServingServiceStub getStub() {
151+
return stub;
152+
}
153+
154+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
155+
/**
156+
* Reads Feature values of a specific entity of an EntityType. For reading feature values of
157+
* multiple entities of an EntityType, please use StreamingReadFeatureValues.
158+
*
159+
* <p>Sample code:
160+
*
161+
* <pre>{@code
162+
* try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
163+
* FeaturestoreOnlineServingServiceClient.create()) {
164+
* EntityTypeName entityType =
165+
* EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]");
166+
* ReadFeatureValuesResponse response =
167+
* featurestoreOnlineServingServiceClient.readFeatureValues(entityType);
168+
* }
169+
* }</pre>
170+
*
171+
* @param entityType Required. The resource name of the EntityType for the entity being read.
172+
* Value format: `projects/{project}/locations/{location}/featurestores/
173+
* {featurestore}/entityTypes/{entityType}`. For example, for a machine learning model
174+
* predicting user clicks on a website, an EntityType ID could be "user".
175+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
176+
*/
177+
public final ReadFeatureValuesResponse readFeatureValues(EntityTypeName entityType) {
178+
ReadFeatureValuesRequest request =
179+
ReadFeatureValuesRequest.newBuilder()
180+
.setEntityType(entityType == null ? null : entityType.toString())
181+
.build();
182+
return readFeatureValues(request);
183+
}
184+
185+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
186+
/**
187+
* Reads Feature values of a specific entity of an EntityType. For reading feature values of
188+
* multiple entities of an EntityType, please use StreamingReadFeatureValues.
189+
*
190+
* <p>Sample code:
191+
*
192+
* <pre>{@code
193+
* try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
194+
* FeaturestoreOnlineServingServiceClient.create()) {
195+
* String entityType =
196+
* EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
197+
* .toString();
198+
* ReadFeatureValuesResponse response =
199+
* featurestoreOnlineServingServiceClient.readFeatureValues(entityType);
200+
* }
201+
* }</pre>
202+
*
203+
* @param entityType Required. The resource name of the EntityType for the entity being read.
204+
* Value format: `projects/{project}/locations/{location}/featurestores/
205+
* {featurestore}/entityTypes/{entityType}`. For example, for a machine learning model
206+
* predicting user clicks on a website, an EntityType ID could be "user".
207+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
208+
*/
209+
public final ReadFeatureValuesResponse readFeatureValues(String entityType) {
210+
ReadFeatureValuesRequest request =
211+
ReadFeatureValuesRequest.newBuilder().setEntityType(entityType).build();
212+
return readFeatureValues(request);
213+
}
214+
215+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
216+
/**
217+
* Reads Feature values of a specific entity of an EntityType. For reading feature values of
218+
* multiple entities of an EntityType, please use StreamingReadFeatureValues.
219+
*
220+
* <p>Sample code:
221+
*
222+
* <pre>{@code
223+
* try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
224+
* FeaturestoreOnlineServingServiceClient.create()) {
225+
* ReadFeatureValuesRequest request =
226+
* ReadFeatureValuesRequest.newBuilder()
227+
* .setEntityType(
228+
* EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
229+
* .toString())
230+
* .setEntityId("entityId-2102099874")
231+
* .setFeatureSelector(FeatureSelector.newBuilder().build())
232+
* .build();
233+
* ReadFeatureValuesResponse response =
234+
* featurestoreOnlineServingServiceClient.readFeatureValues(request);
235+
* }
236+
* }</pre>
237+
*
238+
* @param request The request object containing all of the parameters for the API call.
239+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
240+
*/
241+
public final ReadFeatureValuesResponse readFeatureValues(ReadFeatureValuesRequest request) {
242+
return readFeatureValuesCallable().call(request);
243+
}
244+
245+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
246+
/**
247+
* Reads Feature values of a specific entity of an EntityType. For reading feature values of
248+
* multiple entities of an EntityType, please use StreamingReadFeatureValues.
249+
*
250+
* <p>Sample code:
251+
*
252+
* <pre>{@code
253+
* try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
254+
* FeaturestoreOnlineServingServiceClient.create()) {
255+
* ReadFeatureValuesRequest request =
256+
* ReadFeatureValuesRequest.newBuilder()
257+
* .setEntityType(
258+
* EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
259+
* .toString())
260+
* .setEntityId("entityId-2102099874")
261+
* .setFeatureSelector(FeatureSelector.newBuilder().build())
262+
* .build();
263+
* ApiFuture<ReadFeatureValuesResponse> future =
264+
* featurestoreOnlineServingServiceClient.readFeatureValuesCallable().futureCall(request);
265+
* // Do something.
266+
* ReadFeatureValuesResponse response = future.get();
267+
* }
268+
* }</pre>
269+
*/
270+
public final UnaryCallable<ReadFeatureValuesRequest, ReadFeatureValuesResponse>
271+
readFeatureValuesCallable() {
272+
return stub.readFeatureValuesCallable();
273+
}
274+
275+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
276+
/**
277+
* Reads Feature values for multiple entities. Depending on their size, data for different
278+
* entities may be broken up across multiple responses.
279+
*
280+
* <p>Sample code:
281+
*
282+
* <pre>{@code
283+
* try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
284+
* FeaturestoreOnlineServingServiceClient.create()) {
285+
* StreamingReadFeatureValuesRequest request =
286+
* StreamingReadFeatureValuesRequest.newBuilder()
287+
* .setEntityType(
288+
* EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
289+
* .toString())
290+
* .addAllEntityIds(new ArrayList<String>())
291+
* .setFeatureSelector(FeatureSelector.newBuilder().build())
292+
* .build();
293+
* ServerStream<ReadFeatureValuesResponse> stream =
294+
* featurestoreOnlineServingServiceClient.streamingReadFeatureValuesCallable().call(request);
295+
* for (ReadFeatureValuesResponse response : stream) {
296+
* // Do something when a response is received.
297+
* }
298+
* }
299+
* }</pre>
300+
*/
301+
public final ServerStreamingCallable<StreamingReadFeatureValuesRequest, ReadFeatureValuesResponse>
302+
streamingReadFeatureValuesCallable() {
303+
return stub.streamingReadFeatureValuesCallable();
304+
}
305+
306+
@Override
307+
public final void close() {
308+
stub.close();
309+
}
310+
311+
@Override
312+
public void shutdown() {
313+
stub.shutdown();
314+
}
315+
316+
@Override
317+
public boolean isShutdown() {
318+
return stub.isShutdown();
319+
}
320+
321+
@Override
322+
public boolean isTerminated() {
323+
return stub.isTerminated();
324+
}
325+
326+
@Override
327+
public void shutdownNow() {
328+
stub.shutdownNow();
329+
}
330+
331+
@Override
332+
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
333+
return stub.awaitTermination(duration, unit);
334+
}
335+
}

0 commit comments

Comments
 (0)