Skip to content

Commit e20803d

Browse files
feat: [aiplatform] add match service in aiplatform v1beta1 match_service.proto (#9138)
* feat: add match service in aiplatform v1beta1 match_service.proto PiperOrigin-RevId: 510525846 Source-Link: googleapis/googleapis@972667f Source-Link: https://github.com/googleapis/googleapis-gen/commit/de94b6fa4e2d2eabdba855e0f6347aae68f5cd25 Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJkZTk0YjZmYTRlMmQyZWFiZGJhODU1ZTBmNjM0N2FhZTY4ZjVjZDI1In0= * 🦉 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 222829a commit e20803d

File tree

23 files changed

+12272
-3
lines changed

23 files changed

+12272
-3
lines changed

java-aiplatform/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ If you are using Maven, add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>google-cloud-aiplatform</artifactId>
23-
<version>3.10.0</version>
23+
<version>3.12.0</version>
2424
</dependency>
2525
```
2626

2727
If you are using Gradle without BOM, add this to your dependencies:
2828

2929
```Groovy
30-
implementation 'com.google.cloud:google-cloud-aiplatform:3.10.0'
30+
implementation 'com.google.cloud:google-cloud-aiplatform:3.12.0'
3131
```
3232

3333
If you are using SBT, add this to your dependencies:
3434

3535
```Scala
36-
libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.10.0"
36+
libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.12.0"
3737
```
3838
<!--- {x-version-update-end} -->
3939

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

Lines changed: 770 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
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.v1beta1;
18+
19+
import static com.google.cloud.aiplatform.v1beta1.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.v1beta1.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+
@BetaApi
83+
@Generated("by gapic-generator-java")
84+
public class MatchServiceSettings extends ClientSettings<MatchServiceSettings> {
85+
86+
/** Returns the object with the settings used for calls to findNeighbors. */
87+
public UnaryCallSettings<FindNeighborsRequest, FindNeighborsResponse> findNeighborsSettings() {
88+
return ((MatchServiceStubSettings) getStubSettings()).findNeighborsSettings();
89+
}
90+
91+
/** Returns the object with the settings used for calls to readIndexDatapoints. */
92+
public UnaryCallSettings<ReadIndexDatapointsRequest, ReadIndexDatapointsResponse>
93+
readIndexDatapointsSettings() {
94+
return ((MatchServiceStubSettings) getStubSettings()).readIndexDatapointsSettings();
95+
}
96+
97+
/** Returns the object with the settings used for calls to listLocations. */
98+
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
99+
listLocationsSettings() {
100+
return ((MatchServiceStubSettings) getStubSettings()).listLocationsSettings();
101+
}
102+
103+
/** Returns the object with the settings used for calls to getLocation. */
104+
public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() {
105+
return ((MatchServiceStubSettings) getStubSettings()).getLocationSettings();
106+
}
107+
108+
/** Returns the object with the settings used for calls to setIamPolicy. */
109+
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
110+
return ((MatchServiceStubSettings) getStubSettings()).setIamPolicySettings();
111+
}
112+
113+
/** Returns the object with the settings used for calls to getIamPolicy. */
114+
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
115+
return ((MatchServiceStubSettings) getStubSettings()).getIamPolicySettings();
116+
}
117+
118+
/** Returns the object with the settings used for calls to testIamPermissions. */
119+
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
120+
testIamPermissionsSettings() {
121+
return ((MatchServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
122+
}
123+
124+
public static final MatchServiceSettings create(MatchServiceStubSettings stub)
125+
throws IOException {
126+
return new MatchServiceSettings.Builder(stub.toBuilder()).build();
127+
}
128+
129+
/** Returns a builder for the default ExecutorProvider for this service. */
130+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
131+
return MatchServiceStubSettings.defaultExecutorProviderBuilder();
132+
}
133+
134+
/** Returns the default service endpoint. */
135+
public static String getDefaultEndpoint() {
136+
return MatchServiceStubSettings.getDefaultEndpoint();
137+
}
138+
139+
/** Returns the default service scopes. */
140+
public static List<String> getDefaultServiceScopes() {
141+
return MatchServiceStubSettings.getDefaultServiceScopes();
142+
}
143+
144+
/** Returns a builder for the default credentials for this service. */
145+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
146+
return MatchServiceStubSettings.defaultCredentialsProviderBuilder();
147+
}
148+
149+
/** Returns a builder for the default ChannelProvider for this service. */
150+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
151+
return MatchServiceStubSettings.defaultGrpcTransportProviderBuilder();
152+
}
153+
154+
public static TransportChannelProvider defaultTransportChannelProvider() {
155+
return MatchServiceStubSettings.defaultTransportChannelProvider();
156+
}
157+
158+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
159+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
160+
return MatchServiceStubSettings.defaultApiClientHeaderProviderBuilder();
161+
}
162+
163+
/** Returns a new builder for this class. */
164+
public static Builder newBuilder() {
165+
return Builder.createDefault();
166+
}
167+
168+
/** Returns a new builder for this class. */
169+
public static Builder newBuilder(ClientContext clientContext) {
170+
return new Builder(clientContext);
171+
}
172+
173+
/** Returns a builder containing all the values of this settings class. */
174+
public Builder toBuilder() {
175+
return new Builder(this);
176+
}
177+
178+
protected MatchServiceSettings(Builder settingsBuilder) throws IOException {
179+
super(settingsBuilder);
180+
}
181+
182+
/** Builder for MatchServiceSettings. */
183+
public static class Builder extends ClientSettings.Builder<MatchServiceSettings, Builder> {
184+
185+
protected Builder() throws IOException {
186+
this(((ClientContext) null));
187+
}
188+
189+
protected Builder(ClientContext clientContext) {
190+
super(MatchServiceStubSettings.newBuilder(clientContext));
191+
}
192+
193+
protected Builder(MatchServiceSettings settings) {
194+
super(settings.getStubSettings().toBuilder());
195+
}
196+
197+
protected Builder(MatchServiceStubSettings.Builder stubSettings) {
198+
super(stubSettings);
199+
}
200+
201+
private static Builder createDefault() {
202+
return new Builder(MatchServiceStubSettings.newBuilder());
203+
}
204+
205+
public MatchServiceStubSettings.Builder getStubSettingsBuilder() {
206+
return ((MatchServiceStubSettings.Builder) getStubSettings());
207+
}
208+
209+
/**
210+
* Applies the given settings updater function to all of the unary API methods in this service.
211+
*
212+
* <p>Note: This method does not support applying settings to streaming methods.
213+
*/
214+
public Builder applyToAllUnaryMethods(
215+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
216+
super.applyToAllUnaryMethods(
217+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
218+
return this;
219+
}
220+
221+
/** Returns the builder for the settings used for calls to findNeighbors. */
222+
public UnaryCallSettings.Builder<FindNeighborsRequest, FindNeighborsResponse>
223+
findNeighborsSettings() {
224+
return getStubSettingsBuilder().findNeighborsSettings();
225+
}
226+
227+
/** Returns the builder for the settings used for calls to readIndexDatapoints. */
228+
public UnaryCallSettings.Builder<ReadIndexDatapointsRequest, ReadIndexDatapointsResponse>
229+
readIndexDatapointsSettings() {
230+
return getStubSettingsBuilder().readIndexDatapointsSettings();
231+
}
232+
233+
/** Returns the builder for the settings used for calls to listLocations. */
234+
public PagedCallSettings.Builder<
235+
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
236+
listLocationsSettings() {
237+
return getStubSettingsBuilder().listLocationsSettings();
238+
}
239+
240+
/** Returns the builder for the settings used for calls to getLocation. */
241+
public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() {
242+
return getStubSettingsBuilder().getLocationSettings();
243+
}
244+
245+
/** Returns the builder for the settings used for calls to setIamPolicy. */
246+
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
247+
return getStubSettingsBuilder().setIamPolicySettings();
248+
}
249+
250+
/** Returns the builder for the settings used for calls to getIamPolicy. */
251+
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
252+
return getStubSettingsBuilder().getIamPolicySettings();
253+
}
254+
255+
/** Returns the builder for the settings used for calls to testIamPermissions. */
256+
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
257+
testIamPermissionsSettings() {
258+
return getStubSettingsBuilder().testIamPermissionsSettings();
259+
}
260+
261+
@Override
262+
public MatchServiceSettings build() throws IOException {
263+
return new MatchServiceSettings(this);
264+
}
265+
}
266+
}

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,36 @@
491491
}
492492
}
493493
},
494+
"MatchService": {
495+
"clients": {
496+
"grpc": {
497+
"libraryClient": "MatchServiceClient",
498+
"rpcs": {
499+
"FindNeighbors": {
500+
"methods": ["findNeighbors", "findNeighborsCallable"]
501+
},
502+
"GetIamPolicy": {
503+
"methods": ["getIamPolicy", "getIamPolicyCallable"]
504+
},
505+
"GetLocation": {
506+
"methods": ["getLocation", "getLocationCallable"]
507+
},
508+
"ListLocations": {
509+
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
510+
},
511+
"ReadIndexDatapoints": {
512+
"methods": ["readIndexDatapoints", "readIndexDatapointsCallable"]
513+
},
514+
"SetIamPolicy": {
515+
"methods": ["setIamPolicy", "setIamPolicyCallable"]
516+
},
517+
"TestIamPermissions": {
518+
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
519+
}
520+
}
521+
}
522+
}
523+
},
494524
"MetadataService": {
495525
"clients": {
496526
"grpc": {

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,32 @@
172172
* }
173173
* }</pre>
174174
*
175+
* <p>======================= MatchServiceClient =======================
176+
*
177+
* <p>Service Description: MatchService is a Google managed service for efficient vector similarity
178+
* search at scale.
179+
*
180+
* <p>Sample for MatchServiceClient:
181+
*
182+
* <pre>{@code
183+
* // This snippet has been automatically generated and should be regarded as a code template only.
184+
* // It will require modifications to work:
185+
* // - It may require correct/in-range values for request initialization.
186+
* // - It may require specifying regional endpoints when creating the service client as shown in
187+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
188+
* try (MatchServiceClient matchServiceClient = MatchServiceClient.create()) {
189+
* FindNeighborsRequest request =
190+
* FindNeighborsRequest.newBuilder()
191+
* .setIndexEndpoint(
192+
* IndexEndpointName.of("[PROJECT]", "[LOCATION]", "[INDEX_ENDPOINT]").toString())
193+
* .setDeployedIndexId("deployedIndexId-1101212953")
194+
* .addAllQueries(new ArrayList<FindNeighborsRequest.Query>())
195+
* .setReturnFullDatapoint(true)
196+
* .build();
197+
* FindNeighborsResponse response = matchServiceClient.findNeighbors(request);
198+
* }
199+
* }</pre>
200+
*
175201
* <p>======================= MetadataServiceClient =======================
176202
*
177203
* <p>Service Description: Service for reading and writing metadata entries.

0 commit comments

Comments
 (0)