Skip to content

Commit 00babba

Browse files
feat: [advisorynotifications] add new RPCs GetSettings, UpdateSettings and new messages Settings, NotificationSettings, GetSettingsRequest, UpdateSettingsRequest (#9882)
* feat: add new RPCs GetSettings, UpdateSettings and new messages Settings, NotificationSettings, GetSettingsRequest, UpdateSettingsRequest PiperOrigin-RevId: 568252764 Source-Link: googleapis/googleapis@c981bf5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a37d28dacbcd18faf5297d2fdfae29fea00d96bd Copy-Tag: eyJwIjoiamF2YS1hZHZpc29yeW5vdGlmaWNhdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6ImEzN2QyOGRhY2JjZDE4ZmFmNTI5N2QyZmRmYWUyOWZlYTAwZDk2YmQifQ== * 🦉 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 7a048c0 commit 00babba

File tree

30 files changed

+5334
-38
lines changed

30 files changed

+5334
-38
lines changed

java-advisorynotifications/google-cloud-advisorynotifications/src/main/java/com/google/cloud/advisorynotifications/v1/AdvisoryNotificationsServiceClient.java

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,203 @@ public final UnaryCallable<GetNotificationRequest, Notification> getNotification
481481
return stub.getNotificationCallable();
482482
}
483483

484+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
485+
/**
486+
* Get notification settings.
487+
*
488+
* <p>Sample code:
489+
*
490+
* <pre>{@code
491+
* // This snippet has been automatically generated and should be regarded as a code template only.
492+
* // It will require modifications to work:
493+
* // - It may require correct/in-range values for request initialization.
494+
* // - It may require specifying regional endpoints when creating the service client as shown in
495+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
496+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
497+
* AdvisoryNotificationsServiceClient.create()) {
498+
* SettingsName name = SettingsName.of("[ORGANIZATION]", "[LOCATION]");
499+
* Settings response = advisoryNotificationsServiceClient.getSettings(name);
500+
* }
501+
* }</pre>
502+
*
503+
* @param name Required. The resource name of the settings to retrieve. Format:
504+
* organizations/{organization}/locations/{location}/settings.
505+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
506+
*/
507+
public final Settings getSettings(SettingsName name) {
508+
GetSettingsRequest request =
509+
GetSettingsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
510+
return getSettings(request);
511+
}
512+
513+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
514+
/**
515+
* Get notification settings.
516+
*
517+
* <p>Sample code:
518+
*
519+
* <pre>{@code
520+
* // This snippet has been automatically generated and should be regarded as a code template only.
521+
* // It will require modifications to work:
522+
* // - It may require correct/in-range values for request initialization.
523+
* // - It may require specifying regional endpoints when creating the service client as shown in
524+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
525+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
526+
* AdvisoryNotificationsServiceClient.create()) {
527+
* String name = SettingsName.of("[ORGANIZATION]", "[LOCATION]").toString();
528+
* Settings response = advisoryNotificationsServiceClient.getSettings(name);
529+
* }
530+
* }</pre>
531+
*
532+
* @param name Required. The resource name of the settings to retrieve. Format:
533+
* organizations/{organization}/locations/{location}/settings.
534+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
535+
*/
536+
public final Settings getSettings(String name) {
537+
GetSettingsRequest request = GetSettingsRequest.newBuilder().setName(name).build();
538+
return getSettings(request);
539+
}
540+
541+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
542+
/**
543+
* Get notification settings.
544+
*
545+
* <p>Sample code:
546+
*
547+
* <pre>{@code
548+
* // This snippet has been automatically generated and should be regarded as a code template only.
549+
* // It will require modifications to work:
550+
* // - It may require correct/in-range values for request initialization.
551+
* // - It may require specifying regional endpoints when creating the service client as shown in
552+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
553+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
554+
* AdvisoryNotificationsServiceClient.create()) {
555+
* GetSettingsRequest request =
556+
* GetSettingsRequest.newBuilder()
557+
* .setName(SettingsName.of("[ORGANIZATION]", "[LOCATION]").toString())
558+
* .build();
559+
* Settings response = advisoryNotificationsServiceClient.getSettings(request);
560+
* }
561+
* }</pre>
562+
*
563+
* @param request The request object containing all of the parameters for the API call.
564+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
565+
*/
566+
public final Settings getSettings(GetSettingsRequest request) {
567+
return getSettingsCallable().call(request);
568+
}
569+
570+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
571+
/**
572+
* Get notification settings.
573+
*
574+
* <p>Sample code:
575+
*
576+
* <pre>{@code
577+
* // This snippet has been automatically generated and should be regarded as a code template only.
578+
* // It will require modifications to work:
579+
* // - It may require correct/in-range values for request initialization.
580+
* // - It may require specifying regional endpoints when creating the service client as shown in
581+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
582+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
583+
* AdvisoryNotificationsServiceClient.create()) {
584+
* GetSettingsRequest request =
585+
* GetSettingsRequest.newBuilder()
586+
* .setName(SettingsName.of("[ORGANIZATION]", "[LOCATION]").toString())
587+
* .build();
588+
* ApiFuture<Settings> future =
589+
* advisoryNotificationsServiceClient.getSettingsCallable().futureCall(request);
590+
* // Do something.
591+
* Settings response = future.get();
592+
* }
593+
* }</pre>
594+
*/
595+
public final UnaryCallable<GetSettingsRequest, Settings> getSettingsCallable() {
596+
return stub.getSettingsCallable();
597+
}
598+
599+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
600+
/**
601+
* Update notification settings.
602+
*
603+
* <p>Sample code:
604+
*
605+
* <pre>{@code
606+
* // This snippet has been automatically generated and should be regarded as a code template only.
607+
* // It will require modifications to work:
608+
* // - It may require correct/in-range values for request initialization.
609+
* // - It may require specifying regional endpoints when creating the service client as shown in
610+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
611+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
612+
* AdvisoryNotificationsServiceClient.create()) {
613+
* Settings settings = Settings.newBuilder().build();
614+
* Settings response = advisoryNotificationsServiceClient.updateSettings(settings);
615+
* }
616+
* }</pre>
617+
*
618+
* @param settings Required. New settings.
619+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
620+
*/
621+
public final Settings updateSettings(Settings settings) {
622+
UpdateSettingsRequest request =
623+
UpdateSettingsRequest.newBuilder().setSettings(settings).build();
624+
return updateSettings(request);
625+
}
626+
627+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
628+
/**
629+
* Update notification settings.
630+
*
631+
* <p>Sample code:
632+
*
633+
* <pre>{@code
634+
* // This snippet has been automatically generated and should be regarded as a code template only.
635+
* // It will require modifications to work:
636+
* // - It may require correct/in-range values for request initialization.
637+
* // - It may require specifying regional endpoints when creating the service client as shown in
638+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
639+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
640+
* AdvisoryNotificationsServiceClient.create()) {
641+
* UpdateSettingsRequest request =
642+
* UpdateSettingsRequest.newBuilder().setSettings(Settings.newBuilder().build()).build();
643+
* Settings response = advisoryNotificationsServiceClient.updateSettings(request);
644+
* }
645+
* }</pre>
646+
*
647+
* @param request The request object containing all of the parameters for the API call.
648+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
649+
*/
650+
public final Settings updateSettings(UpdateSettingsRequest request) {
651+
return updateSettingsCallable().call(request);
652+
}
653+
654+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
655+
/**
656+
* Update notification settings.
657+
*
658+
* <p>Sample code:
659+
*
660+
* <pre>{@code
661+
* // This snippet has been automatically generated and should be regarded as a code template only.
662+
* // It will require modifications to work:
663+
* // - It may require correct/in-range values for request initialization.
664+
* // - It may require specifying regional endpoints when creating the service client as shown in
665+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
666+
* try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
667+
* AdvisoryNotificationsServiceClient.create()) {
668+
* UpdateSettingsRequest request =
669+
* UpdateSettingsRequest.newBuilder().setSettings(Settings.newBuilder().build()).build();
670+
* ApiFuture<Settings> future =
671+
* advisoryNotificationsServiceClient.updateSettingsCallable().futureCall(request);
672+
* // Do something.
673+
* Settings response = future.get();
674+
* }
675+
* }</pre>
676+
*/
677+
public final UnaryCallable<UpdateSettingsRequest, Settings> updateSettingsCallable() {
678+
return stub.updateSettingsCallable();
679+
}
680+
484681
@Override
485682
public final void close() {
486683
stub.close();

java-advisorynotifications/google-cloud-advisorynotifications/src/main/java/com/google/cloud/advisorynotifications/v1/AdvisoryNotificationsServiceSettings.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ public UnaryCallSettings<GetNotificationRequest, Notification> getNotificationSe
9191
return ((AdvisoryNotificationsServiceStubSettings) getStubSettings()).getNotificationSettings();
9292
}
9393

94+
/** Returns the object with the settings used for calls to getSettings. */
95+
public UnaryCallSettings<GetSettingsRequest, Settings> getSettingsSettings() {
96+
return ((AdvisoryNotificationsServiceStubSettings) getStubSettings()).getSettingsSettings();
97+
}
98+
99+
/** Returns the object with the settings used for calls to updateSettings. */
100+
public UnaryCallSettings<UpdateSettingsRequest, Settings> updateSettingsSettings() {
101+
return ((AdvisoryNotificationsServiceStubSettings) getStubSettings()).updateSettingsSettings();
102+
}
103+
94104
public static final AdvisoryNotificationsServiceSettings create(
95105
AdvisoryNotificationsServiceStubSettings stub) throws IOException {
96106
return new AdvisoryNotificationsServiceSettings.Builder(stub.toBuilder()).build();
@@ -220,6 +230,16 @@ public Builder applyToAllUnaryMethods(
220230
return getStubSettingsBuilder().getNotificationSettings();
221231
}
222232

233+
/** Returns the builder for the settings used for calls to getSettings. */
234+
public UnaryCallSettings.Builder<GetSettingsRequest, Settings> getSettingsSettings() {
235+
return getStubSettingsBuilder().getSettingsSettings();
236+
}
237+
238+
/** Returns the builder for the settings used for calls to updateSettings. */
239+
public UnaryCallSettings.Builder<UpdateSettingsRequest, Settings> updateSettingsSettings() {
240+
return getStubSettingsBuilder().updateSettingsSettings();
241+
}
242+
223243
@Override
224244
public AdvisoryNotificationsServiceSettings build() throws IOException {
225245
return new AdvisoryNotificationsServiceSettings(this);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@
1313
"GetNotification": {
1414
"methods": ["getNotification", "getNotification", "getNotification", "getNotificationCallable"]
1515
},
16+
"GetSettings": {
17+
"methods": ["getSettings", "getSettings", "getSettings", "getSettingsCallable"]
18+
},
1619
"ListNotifications": {
1720
"methods": ["listNotifications", "listNotifications", "listNotifications", "listNotificationsPagedCallable", "listNotificationsCallable"]
21+
},
22+
"UpdateSettings": {
23+
"methods": ["updateSettings", "updateSettings", "updateSettingsCallable"]
1824
}
1925
}
2026
}

java-advisorynotifications/google-cloud-advisorynotifications/src/main/java/com/google/cloud/advisorynotifications/v1/stub/AdvisoryNotificationsServiceStub.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@
2121
import com.google.api.gax.core.BackgroundResource;
2222
import com.google.api.gax.rpc.UnaryCallable;
2323
import com.google.cloud.advisorynotifications.v1.GetNotificationRequest;
24+
import com.google.cloud.advisorynotifications.v1.GetSettingsRequest;
2425
import com.google.cloud.advisorynotifications.v1.ListNotificationsRequest;
2526
import com.google.cloud.advisorynotifications.v1.ListNotificationsResponse;
2627
import com.google.cloud.advisorynotifications.v1.Notification;
28+
import com.google.cloud.advisorynotifications.v1.Settings;
29+
import com.google.cloud.advisorynotifications.v1.UpdateSettingsRequest;
2730
import javax.annotation.Generated;
2831

2932
// AUTO-GENERATED DOCUMENTATION AND CLASS.
@@ -49,6 +52,14 @@ public UnaryCallable<GetNotificationRequest, Notification> getNotificationCallab
4952
throw new UnsupportedOperationException("Not implemented: getNotificationCallable()");
5053
}
5154

55+
public UnaryCallable<GetSettingsRequest, Settings> getSettingsCallable() {
56+
throw new UnsupportedOperationException("Not implemented: getSettingsCallable()");
57+
}
58+
59+
public UnaryCallable<UpdateSettingsRequest, Settings> updateSettingsCallable() {
60+
throw new UnsupportedOperationException("Not implemented: updateSettingsCallable()");
61+
}
62+
5263
@Override
5364
public abstract void close();
5465
}

0 commit comments

Comments
 (0)