Skip to content

Commit 378391e

Browse files
feat: [servicedirectory] added network and uid fields in Endpoint message (#9666)
* feat: added network and uid fields in Endpoint message feat: added uid field to Namespace message feat: added uid field to Service message feat: enable Location methods docs: updated docs for ResolveServiceRequest message docs: updated docs for ListServicesRequest and ListEndpointsRequest message PiperOrigin-RevId: 549683092 Source-Link: googleapis/googleapis@c661ee0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e3c7b0298a532a7101d2ae8ec1dc0a0e2cfbb2c5 Copy-Tag: eyJwIjoiamF2YS1zZXJ2aWNlZGlyZWN0b3J5Ly5Pd2xCb3QueWFtbCIsImgiOiJlM2M3YjAyOThhNTMyYTcxMDFkMmFlOGVjMWRjMGEwZTJjZmJiMmM1In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Add misisng dependency --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Lawrence Qiu <[email protected]>
1 parent a60caeb commit 378391e

File tree

127 files changed

+13009
-2253
lines changed

Some content is hidden

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

127 files changed

+13009
-2253
lines changed

java-servicedirectory/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.16.0</version>
23+
<version>26.19.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-servicedirectory.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-servicedirectory/2.20.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-servicedirectory/2.22.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-servicedirectory/google-cloud-servicedirectory/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,10 @@
110110
<classifier>testlib</classifier>
111111
<scope>test</scope>
112112
</dependency>
113+
<dependency>
114+
<groupId>com.google.api.grpc</groupId>
115+
<artifactId>grpc-google-common-protos</artifactId>
116+
<scope>test</scope>
117+
</dependency>
113118
</dependencies>
114119
</project>

java-servicedirectory/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceClient.java

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@
1616

1717
package com.google.cloud.servicedirectory.v1;
1818

19+
import com.google.api.core.ApiFuture;
20+
import com.google.api.core.ApiFutures;
1921
import com.google.api.gax.core.BackgroundResource;
22+
import com.google.api.gax.paging.AbstractFixedSizeCollection;
23+
import com.google.api.gax.paging.AbstractPage;
24+
import com.google.api.gax.paging.AbstractPagedListResponse;
25+
import com.google.api.gax.rpc.PageContext;
2026
import com.google.api.gax.rpc.UnaryCallable;
27+
import com.google.cloud.location.GetLocationRequest;
28+
import com.google.cloud.location.ListLocationsRequest;
29+
import com.google.cloud.location.ListLocationsResponse;
30+
import com.google.cloud.location.Location;
2131
import com.google.cloud.servicedirectory.v1.stub.LookupServiceStub;
2232
import com.google.cloud.servicedirectory.v1.stub.LookupServiceStubSettings;
33+
import com.google.common.util.concurrent.MoreExecutors;
2334
import java.io.IOException;
35+
import java.util.List;
2436
import java.util.concurrent.TimeUnit;
2537
import javax.annotation.Generated;
2638

@@ -234,6 +246,161 @@ public final ResolveServiceResponse resolveService(ResolveServiceRequest request
234246
return stub.resolveServiceCallable();
235247
}
236248

249+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
250+
/**
251+
* Lists information about the supported locations for this service.
252+
*
253+
* <p>Sample code:
254+
*
255+
* <pre>{@code
256+
* // This snippet has been automatically generated and should be regarded as a code template only.
257+
* // It will require modifications to work:
258+
* // - It may require correct/in-range values for request initialization.
259+
* // - It may require specifying regional endpoints when creating the service client as shown in
260+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
261+
* try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
262+
* ListLocationsRequest request =
263+
* ListLocationsRequest.newBuilder()
264+
* .setName("name3373707")
265+
* .setFilter("filter-1274492040")
266+
* .setPageSize(883849137)
267+
* .setPageToken("pageToken873572522")
268+
* .build();
269+
* for (Location element : lookupServiceClient.listLocations(request).iterateAll()) {
270+
* // doThingsWith(element);
271+
* }
272+
* }
273+
* }</pre>
274+
*
275+
* @param request The request object containing all of the parameters for the API call.
276+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
277+
*/
278+
public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
279+
return listLocationsPagedCallable().call(request);
280+
}
281+
282+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
283+
/**
284+
* Lists information about the supported locations for this service.
285+
*
286+
* <p>Sample code:
287+
*
288+
* <pre>{@code
289+
* // This snippet has been automatically generated and should be regarded as a code template only.
290+
* // It will require modifications to work:
291+
* // - It may require correct/in-range values for request initialization.
292+
* // - It may require specifying regional endpoints when creating the service client as shown in
293+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
294+
* try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
295+
* ListLocationsRequest request =
296+
* ListLocationsRequest.newBuilder()
297+
* .setName("name3373707")
298+
* .setFilter("filter-1274492040")
299+
* .setPageSize(883849137)
300+
* .setPageToken("pageToken873572522")
301+
* .build();
302+
* ApiFuture<Location> future =
303+
* lookupServiceClient.listLocationsPagedCallable().futureCall(request);
304+
* // Do something.
305+
* for (Location element : future.get().iterateAll()) {
306+
* // doThingsWith(element);
307+
* }
308+
* }
309+
* }</pre>
310+
*/
311+
public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
312+
listLocationsPagedCallable() {
313+
return stub.listLocationsPagedCallable();
314+
}
315+
316+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
317+
/**
318+
* Lists information about the supported locations for this service.
319+
*
320+
* <p>Sample code:
321+
*
322+
* <pre>{@code
323+
* // This snippet has been automatically generated and should be regarded as a code template only.
324+
* // It will require modifications to work:
325+
* // - It may require correct/in-range values for request initialization.
326+
* // - It may require specifying regional endpoints when creating the service client as shown in
327+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
328+
* try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
329+
* ListLocationsRequest request =
330+
* ListLocationsRequest.newBuilder()
331+
* .setName("name3373707")
332+
* .setFilter("filter-1274492040")
333+
* .setPageSize(883849137)
334+
* .setPageToken("pageToken873572522")
335+
* .build();
336+
* while (true) {
337+
* ListLocationsResponse response = lookupServiceClient.listLocationsCallable().call(request);
338+
* for (Location element : response.getLocationsList()) {
339+
* // doThingsWith(element);
340+
* }
341+
* String nextPageToken = response.getNextPageToken();
342+
* if (!Strings.isNullOrEmpty(nextPageToken)) {
343+
* request = request.toBuilder().setPageToken(nextPageToken).build();
344+
* } else {
345+
* break;
346+
* }
347+
* }
348+
* }
349+
* }</pre>
350+
*/
351+
public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
352+
return stub.listLocationsCallable();
353+
}
354+
355+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
356+
/**
357+
* Gets information about a location.
358+
*
359+
* <p>Sample code:
360+
*
361+
* <pre>{@code
362+
* // This snippet has been automatically generated and should be regarded as a code template only.
363+
* // It will require modifications to work:
364+
* // - It may require correct/in-range values for request initialization.
365+
* // - It may require specifying regional endpoints when creating the service client as shown in
366+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
367+
* try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
368+
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
369+
* Location response = lookupServiceClient.getLocation(request);
370+
* }
371+
* }</pre>
372+
*
373+
* @param request The request object containing all of the parameters for the API call.
374+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
375+
*/
376+
public final Location getLocation(GetLocationRequest request) {
377+
return getLocationCallable().call(request);
378+
}
379+
380+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
381+
/**
382+
* Gets information about a location.
383+
*
384+
* <p>Sample code:
385+
*
386+
* <pre>{@code
387+
* // This snippet has been automatically generated and should be regarded as a code template only.
388+
* // It will require modifications to work:
389+
* // - It may require correct/in-range values for request initialization.
390+
* // - It may require specifying regional endpoints when creating the service client as shown in
391+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
392+
* try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
393+
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
394+
* ApiFuture<Location> future = lookupServiceClient.getLocationCallable().futureCall(request);
395+
* // Do something.
396+
* Location response = future.get();
397+
* }
398+
* }</pre>
399+
*/
400+
public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
401+
return stub.getLocationCallable();
402+
}
403+
237404
@Override
238405
public final void close() {
239406
stub.close();
@@ -263,4 +430,80 @@ public void shutdownNow() {
263430
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
264431
return stub.awaitTermination(duration, unit);
265432
}
433+
434+
public static class ListLocationsPagedResponse
435+
extends AbstractPagedListResponse<
436+
ListLocationsRequest,
437+
ListLocationsResponse,
438+
Location,
439+
ListLocationsPage,
440+
ListLocationsFixedSizeCollection> {
441+
442+
public static ApiFuture<ListLocationsPagedResponse> createAsync(
443+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
444+
ApiFuture<ListLocationsResponse> futureResponse) {
445+
ApiFuture<ListLocationsPage> futurePage =
446+
ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
447+
return ApiFutures.transform(
448+
futurePage,
449+
input -> new ListLocationsPagedResponse(input),
450+
MoreExecutors.directExecutor());
451+
}
452+
453+
private ListLocationsPagedResponse(ListLocationsPage page) {
454+
super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
455+
}
456+
}
457+
458+
public static class ListLocationsPage
459+
extends AbstractPage<
460+
ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
461+
462+
private ListLocationsPage(
463+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
464+
ListLocationsResponse response) {
465+
super(context, response);
466+
}
467+
468+
private static ListLocationsPage createEmptyPage() {
469+
return new ListLocationsPage(null, null);
470+
}
471+
472+
@Override
473+
protected ListLocationsPage createPage(
474+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
475+
ListLocationsResponse response) {
476+
return new ListLocationsPage(context, response);
477+
}
478+
479+
@Override
480+
public ApiFuture<ListLocationsPage> createPageAsync(
481+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
482+
ApiFuture<ListLocationsResponse> futureResponse) {
483+
return super.createPageAsync(context, futureResponse);
484+
}
485+
}
486+
487+
public static class ListLocationsFixedSizeCollection
488+
extends AbstractFixedSizeCollection<
489+
ListLocationsRequest,
490+
ListLocationsResponse,
491+
Location,
492+
ListLocationsPage,
493+
ListLocationsFixedSizeCollection> {
494+
495+
private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) {
496+
super(pages, collectionSize);
497+
}
498+
499+
private static ListLocationsFixedSizeCollection createEmptyCollection() {
500+
return new ListLocationsFixedSizeCollection(null, 0);
501+
}
502+
503+
@Override
504+
protected ListLocationsFixedSizeCollection createCollection(
505+
List<ListLocationsPage> pages, int collectionSize) {
506+
return new ListLocationsFixedSizeCollection(pages, collectionSize);
507+
}
508+
}
266509
}

java-servicedirectory/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceSettings.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.google.cloud.servicedirectory.v1;
1818

19+
import static com.google.cloud.servicedirectory.v1.LookupServiceClient.ListLocationsPagedResponse;
20+
1921
import com.google.api.core.ApiFunction;
2022
import com.google.api.core.BetaApi;
2123
import com.google.api.gax.core.GoogleCredentialsProvider;
@@ -25,8 +27,13 @@
2527
import com.google.api.gax.rpc.ApiClientHeaderProvider;
2628
import com.google.api.gax.rpc.ClientContext;
2729
import com.google.api.gax.rpc.ClientSettings;
30+
import com.google.api.gax.rpc.PagedCallSettings;
2831
import com.google.api.gax.rpc.TransportChannelProvider;
2932
import com.google.api.gax.rpc.UnaryCallSettings;
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;
3037
import com.google.cloud.servicedirectory.v1.stub.LookupServiceStubSettings;
3138
import java.io.IOException;
3239
import java.util.List;
@@ -77,6 +84,17 @@ public UnaryCallSettings<ResolveServiceRequest, ResolveServiceResponse> resolveS
7784
return ((LookupServiceStubSettings) getStubSettings()).resolveServiceSettings();
7885
}
7986

87+
/** Returns the object with the settings used for calls to listLocations. */
88+
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
89+
listLocationsSettings() {
90+
return ((LookupServiceStubSettings) getStubSettings()).listLocationsSettings();
91+
}
92+
93+
/** Returns the object with the settings used for calls to getLocation. */
94+
public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() {
95+
return ((LookupServiceStubSettings) getStubSettings()).getLocationSettings();
96+
}
97+
8098
public static final LookupServiceSettings create(LookupServiceStubSettings stub)
8199
throws IOException {
82100
return new LookupServiceSettings.Builder(stub.toBuilder()).build();
@@ -198,6 +216,18 @@ public Builder applyToAllUnaryMethods(
198216
return getStubSettingsBuilder().resolveServiceSettings();
199217
}
200218

219+
/** Returns the builder for the settings used for calls to listLocations. */
220+
public PagedCallSettings.Builder<
221+
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
222+
listLocationsSettings() {
223+
return getStubSettingsBuilder().listLocationsSettings();
224+
}
225+
226+
/** Returns the builder for the settings used for calls to getLocation. */
227+
public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() {
228+
return getStubSettingsBuilder().getLocationSettings();
229+
}
230+
201231
@Override
202232
public LookupServiceSettings build() throws IOException {
203233
return new LookupServiceSettings(this);

0 commit comments

Comments
 (0)