Skip to content

Commit 4ab7b4f

Browse files
feat: [aiplatform] add match service in aiplatform v1 (#9438)
* feat: add examples to ExplanationParameters in aiplatform v1 explanation.proto PiperOrigin-RevId: 532270918 Source-Link: googleapis/googleapis@d697c7f Source-Link: https://github.com/googleapis/googleapis-gen/commit/c28b8e97f980e775c1946404a81d4b7c61a588ae Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJjMjhiOGU5N2Y5ODBlNzc1YzE5NDY0MDRhODFkNGI3YzYxYTU4OGFlIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add updateSchedule method to ScheduleService PiperOrigin-RevId: 532625344 Source-Link: googleapis/googleapis@bd634c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/51f9883d651376151693de90771f2b8ae6785268 Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiI1MWY5ODgzZDY1MTM3NjE1MTY5M2RlOTA3NzFmMmI4YWU2Nzg1MjY4In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add match service in aiplatform v1 PiperOrigin-RevId: 533008702 Source-Link: googleapis/googleapis@2f00988 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3ccb5f69dee03f37c58d0f4c0f87b40936457e5c Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiIzY2NiNWY2OWRlZTAzZjM3YzU4ZDBmNGMwZjg3YjQwOTM2NDU3ZTVjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f30b899 commit 4ab7b4f

File tree

44 files changed

+18533
-148
lines changed

Some content is hidden

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

44 files changed

+18533
-148
lines changed

java-aiplatform/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.14.0</version>
23+
<version>26.15.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-aiplatform.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.17.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.18.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/MatchServiceClient.java

Lines changed: 774 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
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.aiplatform.v1;
18+
19+
import static com.google.cloud.aiplatform.v1.MatchServiceClient.ListLocationsPagedResponse;
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.aiplatform.v1.stub.MatchServiceStubSettings;
33+
import com.google.cloud.location.GetLocationRequest;
34+
import com.google.cloud.location.ListLocationsRequest;
35+
import com.google.cloud.location.ListLocationsResponse;
36+
import com.google.cloud.location.Location;
37+
import com.google.iam.v1.GetIamPolicyRequest;
38+
import com.google.iam.v1.Policy;
39+
import com.google.iam.v1.SetIamPolicyRequest;
40+
import com.google.iam.v1.TestIamPermissionsRequest;
41+
import com.google.iam.v1.TestIamPermissionsResponse;
42+
import java.io.IOException;
43+
import java.util.List;
44+
import javax.annotation.Generated;
45+
46+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
47+
/**
48+
* Settings class to configure an instance of {@link MatchServiceClient}.
49+
*
50+
* <p>The default instance has everything set to sensible defaults:
51+
*
52+
* <ul>
53+
* <li>The default service address (aiplatform.googleapis.com) and default port (443) are used.
54+
* <li>Credentials are acquired automatically through Application Default Credentials.
55+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
56+
* </ul>
57+
*
58+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
59+
* build() is called, the tree of builders is called to create the complete settings object.
60+
*
61+
* <p>For example, to set the total timeout of findNeighbors to 30 seconds:
62+
*
63+
* <pre>{@code
64+
* // This snippet has been automatically generated and should be regarded as a code template only.
65+
* // It will require modifications to work:
66+
* // - It may require correct/in-range values for request initialization.
67+
* // - It may require specifying regional endpoints when creating the service client as shown in
68+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
69+
* MatchServiceSettings.Builder matchServiceSettingsBuilder = MatchServiceSettings.newBuilder();
70+
* matchServiceSettingsBuilder
71+
* .findNeighborsSettings()
72+
* .setRetrySettings(
73+
* matchServiceSettingsBuilder
74+
* .findNeighborsSettings()
75+
* .getRetrySettings()
76+
* .toBuilder()
77+
* .setTotalTimeout(Duration.ofSeconds(30))
78+
* .build());
79+
* MatchServiceSettings matchServiceSettings = matchServiceSettingsBuilder.build();
80+
* }</pre>
81+
*/
82+
@Generated("by gapic-generator-java")
83+
public class MatchServiceSettings extends ClientSettings<MatchServiceSettings> {
84+
85+
/** Returns the object with the settings used for calls to findNeighbors. */
86+
public UnaryCallSettings<FindNeighborsRequest, FindNeighborsResponse> findNeighborsSettings() {
87+
return ((MatchServiceStubSettings) getStubSettings()).findNeighborsSettings();
88+
}
89+
90+
/** Returns the object with the settings used for calls to readIndexDatapoints. */
91+
public UnaryCallSettings<ReadIndexDatapointsRequest, ReadIndexDatapointsResponse>
92+
readIndexDatapointsSettings() {
93+
return ((MatchServiceStubSettings) getStubSettings()).readIndexDatapointsSettings();
94+
}
95+
96+
/** Returns the object with the settings used for calls to listLocations. */
97+
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
98+
listLocationsSettings() {
99+
return ((MatchServiceStubSettings) getStubSettings()).listLocationsSettings();
100+
}
101+
102+
/** Returns the object with the settings used for calls to getLocation. */
103+
public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() {
104+
return ((MatchServiceStubSettings) getStubSettings()).getLocationSettings();
105+
}
106+
107+
/** Returns the object with the settings used for calls to setIamPolicy. */
108+
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
109+
return ((MatchServiceStubSettings) getStubSettings()).setIamPolicySettings();
110+
}
111+
112+
/** Returns the object with the settings used for calls to getIamPolicy. */
113+
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
114+
return ((MatchServiceStubSettings) getStubSettings()).getIamPolicySettings();
115+
}
116+
117+
/** Returns the object with the settings used for calls to testIamPermissions. */
118+
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
119+
testIamPermissionsSettings() {
120+
return ((MatchServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
121+
}
122+
123+
public static final MatchServiceSettings create(MatchServiceStubSettings stub)
124+
throws IOException {
125+
return new MatchServiceSettings.Builder(stub.toBuilder()).build();
126+
}
127+
128+
/** Returns a builder for the default ExecutorProvider for this service. */
129+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
130+
return MatchServiceStubSettings.defaultExecutorProviderBuilder();
131+
}
132+
133+
/** Returns the default service endpoint. */
134+
public static String getDefaultEndpoint() {
135+
return MatchServiceStubSettings.getDefaultEndpoint();
136+
}
137+
138+
/** Returns the default service scopes. */
139+
public static List<String> getDefaultServiceScopes() {
140+
return MatchServiceStubSettings.getDefaultServiceScopes();
141+
}
142+
143+
/** Returns a builder for the default credentials for this service. */
144+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
145+
return MatchServiceStubSettings.defaultCredentialsProviderBuilder();
146+
}
147+
148+
/** Returns a builder for the default ChannelProvider for this service. */
149+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
150+
return MatchServiceStubSettings.defaultGrpcTransportProviderBuilder();
151+
}
152+
153+
public static TransportChannelProvider defaultTransportChannelProvider() {
154+
return MatchServiceStubSettings.defaultTransportChannelProvider();
155+
}
156+
157+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
158+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
159+
return MatchServiceStubSettings.defaultApiClientHeaderProviderBuilder();
160+
}
161+
162+
/** Returns a new builder for this class. */
163+
public static Builder newBuilder() {
164+
return Builder.createDefault();
165+
}
166+
167+
/** Returns a new builder for this class. */
168+
public static Builder newBuilder(ClientContext clientContext) {
169+
return new Builder(clientContext);
170+
}
171+
172+
/** Returns a builder containing all the values of this settings class. */
173+
public Builder toBuilder() {
174+
return new Builder(this);
175+
}
176+
177+
protected MatchServiceSettings(Builder settingsBuilder) throws IOException {
178+
super(settingsBuilder);
179+
}
180+
181+
/** Builder for MatchServiceSettings. */
182+
public static class Builder extends ClientSettings.Builder<MatchServiceSettings, Builder> {
183+
184+
protected Builder() throws IOException {
185+
this(((ClientContext) null));
186+
}
187+
188+
protected Builder(ClientContext clientContext) {
189+
super(MatchServiceStubSettings.newBuilder(clientContext));
190+
}
191+
192+
protected Builder(MatchServiceSettings settings) {
193+
super(settings.getStubSettings().toBuilder());
194+
}
195+
196+
protected Builder(MatchServiceStubSettings.Builder stubSettings) {
197+
super(stubSettings);
198+
}
199+
200+
private static Builder createDefault() {
201+
return new Builder(MatchServiceStubSettings.newBuilder());
202+
}
203+
204+
public MatchServiceStubSettings.Builder getStubSettingsBuilder() {
205+
return ((MatchServiceStubSettings.Builder) getStubSettings());
206+
}
207+
208+
/**
209+
* Applies the given settings updater function to all of the unary API methods in this service.
210+
*
211+
* <p>Note: This method does not support applying settings to streaming methods.
212+
*/
213+
public Builder applyToAllUnaryMethods(
214+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
215+
super.applyToAllUnaryMethods(
216+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
217+
return this;
218+
}
219+
220+
/** Returns the builder for the settings used for calls to findNeighbors. */
221+
public UnaryCallSettings.Builder<FindNeighborsRequest, FindNeighborsResponse>
222+
findNeighborsSettings() {
223+
return getStubSettingsBuilder().findNeighborsSettings();
224+
}
225+
226+
/** Returns the builder for the settings used for calls to readIndexDatapoints. */
227+
public UnaryCallSettings.Builder<ReadIndexDatapointsRequest, ReadIndexDatapointsResponse>
228+
readIndexDatapointsSettings() {
229+
return getStubSettingsBuilder().readIndexDatapointsSettings();
230+
}
231+
232+
/** Returns the builder for the settings used for calls to listLocations. */
233+
public PagedCallSettings.Builder<
234+
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
235+
listLocationsSettings() {
236+
return getStubSettingsBuilder().listLocationsSettings();
237+
}
238+
239+
/** Returns the builder for the settings used for calls to getLocation. */
240+
public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() {
241+
return getStubSettingsBuilder().getLocationSettings();
242+
}
243+
244+
/** Returns the builder for the settings used for calls to setIamPolicy. */
245+
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
246+
return getStubSettingsBuilder().setIamPolicySettings();
247+
}
248+
249+
/** Returns the builder for the settings used for calls to getIamPolicy. */
250+
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
251+
return getStubSettingsBuilder().getIamPolicySettings();
252+
}
253+
254+
/** Returns the builder for the settings used for calls to testIamPermissions. */
255+
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
256+
testIamPermissionsSettings() {
257+
return getStubSettingsBuilder().testIamPermissionsSettings();
258+
}
259+
260+
@Override
261+
public MatchServiceSettings build() throws IOException {
262+
return new MatchServiceSettings(this);
263+
}
264+
}
265+
}

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,36 @@
455455
}
456456
}
457457
},
458+
"MatchService": {
459+
"clients": {
460+
"grpc": {
461+
"libraryClient": "MatchServiceClient",
462+
"rpcs": {
463+
"FindNeighbors": {
464+
"methods": ["findNeighbors", "findNeighborsCallable"]
465+
},
466+
"GetIamPolicy": {
467+
"methods": ["getIamPolicy", "getIamPolicyCallable"]
468+
},
469+
"GetLocation": {
470+
"methods": ["getLocation", "getLocationCallable"]
471+
},
472+
"ListLocations": {
473+
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
474+
},
475+
"ReadIndexDatapoints": {
476+
"methods": ["readIndexDatapoints", "readIndexDatapointsCallable"]
477+
},
478+
"SetIamPolicy": {
479+
"methods": ["setIamPolicy", "setIamPolicyCallable"]
480+
},
481+
"TestIamPermissions": {
482+
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
483+
}
484+
}
485+
}
486+
}
487+
},
458488
"MetadataService": {
459489
"clients": {
460490
"grpc": {

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,32 @@
152152
* }
153153
* }</pre>
154154
*
155+
* <p>======================= MatchServiceClient =======================
156+
*
157+
* <p>Service Description: MatchService is a Google managed service for efficient vector similarity
158+
* search at scale.
159+
*
160+
* <p>Sample for MatchServiceClient:
161+
*
162+
* <pre>{@code
163+
* // This snippet has been automatically generated and should be regarded as a code template only.
164+
* // It will require modifications to work:
165+
* // - It may require correct/in-range values for request initialization.
166+
* // - It may require specifying regional endpoints when creating the service client as shown in
167+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
168+
* try (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
169+
* FindNeighborsRequest request =
170+
* FindNeighborsRequest.newBuilder()
171+
* .setIndexEndpoint(
172+
* IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
173+
* .setDeployedIndexId("deployedIndexId-1101212953")
174+
* .addAllQueries(new ArrayList<FindNeighborsRequest.Query>())
175+
* .setReturnFullDatapoint(true)
176+
* .build();
177+
* FindNeighborsResponse response = matchServiceClient.findNeighbors(request);
178+
* }
179+
* }</pre>
180+
*
155181
* <p>======================= MetadataServiceClient =======================
156182
*
157183
* <p>Service Description: Service for reading and writing metadata entries.

0 commit comments

Comments
 (0)