* Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. ** *
@@ -100,7 +101,8 @@ public java.lang.String getName() {
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
@@ -475,7 +477,8 @@ public Builder mergeFrom(
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
@@ -501,7 +504,8 @@ public java.lang.String getName() {
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
@@ -527,7 +531,8 @@ public com.google.protobuf.ByteString getNameBytes() {
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
@@ -552,7 +557,8 @@ public Builder setName(java.lang.String value) {
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
@@ -573,7 +579,8 @@ public Builder clearName() {
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/GetSettingsRequestOrBuilder.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/GetSettingsRequestOrBuilder.java
index 7172be58d9e8..065466680e26 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/GetSettingsRequestOrBuilder.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/GetSettingsRequestOrBuilder.java
@@ -30,7 +30,8 @@ public interface GetSettingsRequestOrBuilder
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
@@ -46,7 +47,8 @@ public interface GetSettingsRequestOrBuilder
*
* Required. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
*
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequest.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequest.java
index 98033c294aed..d5d986fa7185 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequest.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequest.java
@@ -76,7 +76,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -103,7 +103,7 @@ public java.lang.String getParent() {
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -753,7 +753,7 @@ public Builder mergeFrom(
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -779,7 +779,7 @@ public java.lang.String getParent() {
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -805,7 +805,7 @@ public com.google.protobuf.ByteString getParentBytes() {
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -830,7 +830,7 @@ public Builder setParent(java.lang.String value) {
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -851,7 +851,7 @@ public Builder clearParent() {
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequestOrBuilder.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequestOrBuilder.java
index 14674ddf6786..0466c0afafa6 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequestOrBuilder.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ListNotificationsRequestOrBuilder.java
@@ -30,7 +30,7 @@ public interface ListNotificationsRequestOrBuilder
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
@@ -46,7 +46,7 @@ public interface ListNotificationsRequestOrBuilder
*
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}"
- * or "projects/{project}/locations/{location}"
+ * or "projects/{project}/locations/{location}".
*
*
*
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ServiceProto.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ServiceProto.java
index 74252e6e1ddc..dac1ed6e7b1d 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ServiceProto.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/ServiceProto.java
@@ -152,71 +152,76 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "\026GetNotificationRequest\022G\n\004name\030\001 \001(\tB9\340"
+ "A\002\372A3\n1advisorynotifications.googleapis."
+ "com/Notification\022\025\n\rlanguage_code\030\005 \001(\t\""
- + "\211\003\n\010Settings\022\021\n\004name\030\001 \001(\tB\003\340A\003\022m\n\025notif"
+ + "\321\003\n\010Settings\022\021\n\004name\030\001 \001(\tB\003\340A\010\022m\n\025notif"
+ "ication_settings\030\002 \003(\0132I.google.cloud.ad"
+ "visorynotifications.v1.Settings.Notifica"
+ "tionSettingsEntryB\003\340A\002\022\021\n\004etag\030\003 \001(\tB\003\340A"
+ "\002\032x\n\031NotificationSettingsEntry\022\013\n\003key\030\001 "
+ "\001(\t\022J\n\005value\030\002 \001(\0132;.google.cloud.adviso"
+ "rynotifications.v1.NotificationSettings:"
- + "\0028\001:n\352Ak\n-advisorynotifications.googleap"
- + "is.com/Settings\022:organizations/{organiza"
- + "tion}/locations/{location}/settings\"\'\n\024N"
- + "otificationSettings\022\017\n\007enabled\030\001 \001(\010\"Y\n\022"
- + "GetSettingsRequest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/"
- + "\n-advisorynotifications.googleapis.com/S"
- + "ettings\"_\n\025UpdateSettingsRequest\022F\n\010sett"
- + "ings\030\001 \001(\0132/.google.cloud.advisorynotifi"
- + "cations.v1.SettingsB\003\340A\002*J\n\020Notification"
- + "View\022!\n\035NOTIFICATION_VIEW_UNSPECIFIED\020\000\022"
- + "\t\n\005BASIC\020\001\022\010\n\004FULL\020\002*\240\001\n\021LocalizationSta"
- + "te\022\"\n\036LOCALIZATION_STATE_UNSPECIFIED\020\000\022%"
- + "\n!LOCALIZATION_STATE_NOT_APPLICABLE\020\001\022\036\n"
- + "\032LOCALIZATION_STATE_PENDING\020\002\022 \n\034LOCALIZ"
- + "ATION_STATE_COMPLETED\020\003*\332\001\n\020Notification"
- + "Type\022!\n\035NOTIFICATION_TYPE_UNSPECIFIED\020\000\022"
- + "/\n+NOTIFICATION_TYPE_SECURITY_PRIVACY_AD"
- + "VISORY\020\001\022\'\n#NOTIFICATION_TYPE_SENSITIVE_"
- + "ACTIONS\020\002\022\"\n\036NOTIFICATION_TYPE_SECURITY_"
- + "MSA\020\003\022%\n!NOTIFICATION_TYPE_THREAT_HORIZO"
- + "NS\020\0042\250\010\n\034AdvisoryNotificationsService\022\224\002"
- + "\n\021ListNotifications\022?.google.cloud.advis"
- + "orynotifications.v1.ListNotificationsReq"
- + "uest\032@.google.cloud.advisorynotification"
- + "s.v1.ListNotificationsResponse\"|\332A\006paren"
- + "t\202\323\344\223\002m\0226/v1/{parent=organizations/*/loc"
- + "ations/*}/notificationsZ3\0221/v1/{parent=p"
- + "rojects/*/locations/*}/notifications\022\201\002\n"
- + "\017GetNotification\022=.google.cloud.advisory"
- + "notifications.v1.GetNotificationRequest\032"
- + "3.google.cloud.advisorynotifications.v1."
- + "Notification\"z\332A\004name\202\323\344\223\002m\0226/v1/{name=o"
- + "rganizations/*/locations/*/notifications"
- + "/*}Z3\0221/v1/{name=projects/*/locations/*/"
- + "notifications/*}\022\271\001\n\013GetSettings\0229.googl"
- + "e.cloud.advisorynotifications.v1.GetSett"
- + "ingsRequest\032/.google.cloud.advisorynotif"
- + "ications.v1.Settings\">\332A\004name\202\323\344\223\0021\022//v1"
- + "/{name=organizations/*/locations/*/setti"
- + "ngs}\022\326\001\n\016UpdateSettings\022<.google.cloud.a"
- + "dvisorynotifications.v1.UpdateSettingsRe"
- + "quest\032/.google.cloud.advisorynotificatio"
- + "ns.v1.Settings\"U\332A\010settings\202\323\344\223\002D28/v1/{"
+ + "\0028\001:\265\001\352A\261\001\n-advisorynotifications.google"
+ + "apis.com/Settings\022:organizations/{organi"
+ + "zation}/locations/{location}/settings\0220p"
+ + "rojects/{project}/locations/{location}/s"
+ + "ettings*\010settings2\010settings\"\'\n\024Notificat"
+ + "ionSettings\022\017\n\007enabled\030\001 \001(\010\"Y\n\022GetSetti"
+ + "ngsRequest\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-adviso"
+ + "rynotifications.googleapis.com/Settings\""
+ + "_\n\025UpdateSettingsRequest\022F\n\010settings\030\001 \001"
+ + "(\0132/.google.cloud.advisorynotifications."
+ + "v1.SettingsB\003\340A\002*J\n\020NotificationView\022!\n\035"
+ + "NOTIFICATION_VIEW_UNSPECIFIED\020\000\022\t\n\005BASIC"
+ + "\020\001\022\010\n\004FULL\020\002*\240\001\n\021LocalizationState\022\"\n\036LO"
+ + "CALIZATION_STATE_UNSPECIFIED\020\000\022%\n!LOCALI"
+ + "ZATION_STATE_NOT_APPLICABLE\020\001\022\036\n\032LOCALIZ"
+ + "ATION_STATE_PENDING\020\002\022 \n\034LOCALIZATION_ST"
+ + "ATE_COMPLETED\020\003*\332\001\n\020NotificationType\022!\n\035"
+ + "NOTIFICATION_TYPE_UNSPECIFIED\020\000\022/\n+NOTIF"
+ + "ICATION_TYPE_SECURITY_PRIVACY_ADVISORY\020\001"
+ + "\022\'\n#NOTIFICATION_TYPE_SENSITIVE_ACTIONS\020"
+ + "\002\022\"\n\036NOTIFICATION_TYPE_SECURITY_MSA\020\003\022%\n"
+ + "!NOTIFICATION_TYPE_THREAT_HORIZONS\020\0042\231\t\n"
+ + "\034AdvisoryNotificationsService\022\224\002\n\021ListNo"
+ + "tifications\022?.google.cloud.advisorynotif"
+ + "ications.v1.ListNotificationsRequest\032@.g"
+ + "oogle.cloud.advisorynotifications.v1.Lis"
+ + "tNotificationsResponse\"|\332A\006parent\202\323\344\223\002m\022"
+ + "6/v1/{parent=organizations/*/locations/*"
+ + "}/notificationsZ3\0221/v1/{parent=projects/"
+ + "*/locations/*}/notifications\022\201\002\n\017GetNoti"
+ + "fication\022=.google.cloud.advisorynotifica"
+ + "tions.v1.GetNotificationRequest\0323.google"
+ + ".cloud.advisorynotifications.v1.Notifica"
+ + "tion\"z\332A\004name\202\323\344\223\002m\0226/v1/{name=organizat"
+ + "ions/*/locations/*/notifications/*}Z3\0221/"
+ + "v1/{name=projects/*/locations/*/notifica"
+ + "tions/*}\022\347\001\n\013GetSettings\0229.google.cloud."
+ + "advisorynotifications.v1.GetSettingsRequ"
+ + "est\032/.google.cloud.advisorynotifications"
+ + ".v1.Settings\"l\332A\004name\202\323\344\223\002_\022//v1/{name=o"
+ + "rganizations/*/locations/*/settings}Z,\022*"
+ + "/v1/{name=projects/*/locations/*/setting"
+ + "s}\022\231\002\n\016UpdateSettings\022<.google.cloud.adv"
+ + "isorynotifications.v1.UpdateSettingsRequ"
+ + "est\032/.google.cloud.advisorynotifications"
+ + ".v1.Settings\"\227\001\332A\010settings\202\323\344\223\002\205\00128/v1/{"
+ "settings.name=organizations/*/locations/"
- + "*/settings}:\010settings\032X\312A$advisorynotifi"
- + "cations.googleapis.com\322A.https://www.goo"
- + "gleapis.com/auth/cloud-platformB\246\003\n)com."
- + "google.cloud.advisorynotifications.v1B\014S"
- + "erviceProtoP\001Z_cloud.google.com/go/advis"
- + "orynotifications/apiv1/advisorynotificat"
- + "ionspb;advisorynotificationspb\252\002%Google."
- + "Cloud.AdvisoryNotifications.V1\312\002%Google\\"
- + "Cloud\\AdvisoryNotifications\\V1\352\002(Google:"
- + ":Cloud::AdvisoryNotifications::V1\352A\213\001\n-a"
- + "dvisorynotifications.googleapis.com/Loca"
- + "tion\0221organizations/{organization}/locat"
- + "ions/{location}\022\'projects/{project}/loca"
- + "tions/{location}b\006proto3"
+ + "*/settings}:\010settingsZ?23/v1/{settings.n"
+ + "ame=projects/*/locations/*/settings}:\010se"
+ + "ttings\032X\312A$advisorynotifications.googlea"
+ + "pis.com\322A.https://www.googleapis.com/aut"
+ + "h/cloud-platformB\246\003\n)com.google.cloud.ad"
+ + "visorynotifications.v1B\014ServiceProtoP\001Z_"
+ + "cloud.google.com/go/advisorynotification"
+ + "s/apiv1/advisorynotificationspb;advisory"
+ + "notificationspb\252\002%Google.Cloud.AdvisoryN"
+ + "otifications.V1\312\002%Google\\Cloud\\AdvisoryN"
+ + "otifications\\V1\352\002(Google::Cloud::Advisor"
+ + "yNotifications::V1\352A\213\001\n-advisorynotifica"
+ + "tions.googleapis.com/Location\0221organizat"
+ + "ions/{organization}/locations/{location}"
+ + "\022\'projects/{project}/locations/{location"
+ + "}b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/Settings.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/Settings.java
index a7550db643fc..d28eb581298d 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/Settings.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/Settings.java
@@ -84,12 +84,13 @@ protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldRefl
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The name.
*/
@@ -109,12 +110,13 @@ public java.lang.String getName() {
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The bytes for name.
*/
@@ -764,12 +766,13 @@ public Builder mergeFrom(
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The name.
*/
@@ -788,12 +791,13 @@ public java.lang.String getName() {
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The bytes for name.
*/
@@ -812,12 +816,13 @@ public com.google.protobuf.ByteString getNameBytes() {
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @param value The name to set.
* @return This builder for chaining.
@@ -835,12 +840,13 @@ public Builder setName(java.lang.String value) {
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return This builder for chaining.
*/
@@ -854,12 +860,13 @@ public Builder clearName() {
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @param value The bytes for name to set.
* @return This builder for chaining.
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsName.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsName.java
index 5dca8c57431f..5b6f16f0c8af 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsName.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsName.java
@@ -17,6 +17,7 @@
package com.google.cloud.advisorynotifications.v1;
import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.pathtemplate.ValidationException;
import com.google.api.resourcenames.ResourceName;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
@@ -32,19 +33,34 @@ public class SettingsName implements ResourceName {
private static final PathTemplate ORGANIZATION_LOCATION =
PathTemplate.createWithoutUrlEncoding(
"organizations/{organization}/locations/{location}/settings");
+ private static final PathTemplate PROJECT_LOCATION =
+ PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/settings");
private volatile Map fieldValuesMap;
+ private PathTemplate pathTemplate;
+ private String fixedValue;
private final String organization;
private final String location;
+ private final String project;
@Deprecated
protected SettingsName() {
organization = null;
location = null;
+ project = null;
}
private SettingsName(Builder builder) {
organization = Preconditions.checkNotNull(builder.getOrganization());
location = Preconditions.checkNotNull(builder.getLocation());
+ project = null;
+ pathTemplate = ORGANIZATION_LOCATION;
+ }
+
+ private SettingsName(ProjectLocationBuilder builder) {
+ project = Preconditions.checkNotNull(builder.getProject());
+ location = Preconditions.checkNotNull(builder.getLocation());
+ organization = null;
+ pathTemplate = PROJECT_LOCATION;
}
public String getOrganization() {
@@ -55,10 +71,22 @@ public String getLocation() {
return location;
}
+ public String getProject() {
+ return project;
+ }
+
public static Builder newBuilder() {
return new Builder();
}
+ public static Builder newOrganizationLocationBuilder() {
+ return new Builder();
+ }
+
+ public static ProjectLocationBuilder newProjectLocationBuilder() {
+ return new ProjectLocationBuilder();
+ }
+
public Builder toBuilder() {
return new Builder(this);
}
@@ -67,18 +95,38 @@ public static SettingsName of(String organization, String location) {
return newBuilder().setOrganization(organization).setLocation(location).build();
}
+ public static SettingsName ofOrganizationLocationName(String organization, String location) {
+ return newBuilder().setOrganization(organization).setLocation(location).build();
+ }
+
+ public static SettingsName ofProjectLocationName(String project, String location) {
+ return newProjectLocationBuilder().setProject(project).setLocation(location).build();
+ }
+
public static String format(String organization, String location) {
return newBuilder().setOrganization(organization).setLocation(location).build().toString();
}
+ public static String formatOrganizationLocationName(String organization, String location) {
+ return newBuilder().setOrganization(organization).setLocation(location).build().toString();
+ }
+
+ public static String formatProjectLocationName(String project, String location) {
+ return newProjectLocationBuilder().setProject(project).setLocation(location).build().toString();
+ }
+
public static SettingsName parse(String formattedString) {
if (formattedString.isEmpty()) {
return null;
}
- Map matchMap =
- ORGANIZATION_LOCATION.validatedMatch(
- formattedString, "SettingsName.parse: formattedString not in valid format");
- return of(matchMap.get("organization"), matchMap.get("location"));
+ if (ORGANIZATION_LOCATION.matches(formattedString)) {
+ Map matchMap = ORGANIZATION_LOCATION.match(formattedString);
+ return ofOrganizationLocationName(matchMap.get("organization"), matchMap.get("location"));
+ } else if (PROJECT_LOCATION.matches(formattedString)) {
+ Map matchMap = PROJECT_LOCATION.match(formattedString);
+ return ofProjectLocationName(matchMap.get("project"), matchMap.get("location"));
+ }
+ throw new ValidationException("SettingsName.parse: formattedString not in valid format");
}
public static List parseList(List formattedStrings) {
@@ -102,7 +150,8 @@ public static List toStringList(List values) {
}
public static boolean isParsableFrom(String formattedString) {
- return ORGANIZATION_LOCATION.matches(formattedString);
+ return ORGANIZATION_LOCATION.matches(formattedString)
+ || PROJECT_LOCATION.matches(formattedString);
}
@Override
@@ -117,6 +166,9 @@ public Map getFieldValuesMap() {
if (location != null) {
fieldMapBuilder.put("location", location);
}
+ if (project != null) {
+ fieldMapBuilder.put("project", project);
+ }
fieldValuesMap = fieldMapBuilder.build();
}
}
@@ -130,7 +182,7 @@ public String getFieldValue(String fieldName) {
@Override
public String toString() {
- return ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location);
+ return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap());
}
@Override
@@ -141,7 +193,8 @@ public boolean equals(Object o) {
if (o != null && getClass() == o.getClass()) {
SettingsName that = ((SettingsName) o);
return Objects.equals(this.organization, that.organization)
- && Objects.equals(this.location, that.location);
+ && Objects.equals(this.location, that.location)
+ && Objects.equals(this.project, that.project);
}
return false;
}
@@ -150,9 +203,13 @@ public boolean equals(Object o) {
public int hashCode() {
int h = 1;
h *= 1000003;
+ h ^= Objects.hashCode(fixedValue);
+ h *= 1000003;
h ^= Objects.hashCode(organization);
h *= 1000003;
h ^= Objects.hashCode(location);
+ h *= 1000003;
+ h ^= Objects.hashCode(project);
return h;
}
@@ -182,6 +239,9 @@ public Builder setLocation(String location) {
}
private Builder(SettingsName settingsName) {
+ Preconditions.checkArgument(
+ Objects.equals(settingsName.pathTemplate, ORGANIZATION_LOCATION),
+ "toBuilder is only supported when SettingsName has the pattern of organizations/{organization}/locations/{location}/settings");
this.organization = settingsName.organization;
this.location = settingsName.location;
}
@@ -190,4 +250,34 @@ public SettingsName build() {
return new SettingsName(this);
}
}
+
+ /** Builder for projects/{project}/locations/{location}/settings. */
+ public static class ProjectLocationBuilder {
+ private String project;
+ private String location;
+
+ protected ProjectLocationBuilder() {}
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public ProjectLocationBuilder setProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+ public ProjectLocationBuilder setLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ public SettingsName build() {
+ return new SettingsName(this);
+ }
+ }
}
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsOrBuilder.java b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsOrBuilder.java
index c5cf26da6b3f..51346ba2eb8e 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsOrBuilder.java
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/SettingsOrBuilder.java
@@ -28,12 +28,13 @@ public interface SettingsOrBuilder
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The name.
*/
@@ -42,12 +43,13 @@ public interface SettingsOrBuilder
*
*
*
- * Output only. The resource name of the settings to retrieve.
+ * Identifier. The resource name of the settings to retrieve.
* Format:
- * organizations/{organization}/locations/{location}/settings.
+ * organizations/{organization}/locations/{location}/settings or
+ * projects/{projects}/locations/{location}/settings.
*
*
- * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
*
* @return The bytes for name.
*/
diff --git a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/proto/google/cloud/advisorynotifications/v1/service.proto b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/proto/google/cloud/advisorynotifications/v1/service.proto
index 87947ba2158a..2d76524eebfc 100644
--- a/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/proto/google/cloud/advisorynotifications/v1/service.proto
+++ b/java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/proto/google/cloud/advisorynotifications/v1/service.proto
@@ -68,6 +68,7 @@ service AdvisoryNotificationsService {
rpc GetSettings(GetSettingsRequest) returns (Settings) {
option (google.api.http) = {
get: "/v1/{name=organizations/*/locations/*/settings}"
+ additional_bindings { get: "/v1/{name=projects/*/locations/*/settings}" }
};
option (google.api.method_signature) = "name";
}
@@ -77,6 +78,10 @@ service AdvisoryNotificationsService {
option (google.api.http) = {
patch: "/v1/{settings.name=organizations/*/locations/*/settings}"
body: "settings"
+ additional_bindings {
+ patch: "/v1/{settings.name=projects/*/locations/*/settings}"
+ body: "settings"
+ }
};
option (google.api.method_signature) = "settings";
}
@@ -238,7 +243,7 @@ message Csv {
message ListNotificationsRequest {
// Required. The parent, which owns this collection of notifications.
// Must be of the form "organizations/{organization}/locations/{location}"
- // or "projects/{project}/locations/{location}"
+ // or "projects/{project}/locations/{location}".
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
@@ -308,12 +313,16 @@ message Settings {
option (google.api.resource) = {
type: "advisorynotifications.googleapis.com/Settings"
pattern: "organizations/{organization}/locations/{location}/settings"
+ pattern: "projects/{project}/locations/{location}/settings"
+ plural: "settings"
+ singular: "settings"
};
- // Output only. The resource name of the settings to retrieve.
+ // Identifier. The resource name of the settings to retrieve.
// Format:
- // organizations/{organization}/locations/{location}/settings.
- string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // organizations/{organization}/locations/{location}/settings or
+ // projects/{projects}/locations/{location}/settings.
+ string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// Required. Map of each notification type and its settings to get/set all
// settings at once. The server will validate the value for each notification
@@ -338,7 +347,8 @@ message NotificationSettings {
message GetSettingsRequest {
// Required. The resource name of the settings to retrieve.
// Format:
- // organizations/{organization}/locations/{location}/settings.
+ // organizations/{organization}/locations/{location}/settings or
+ // projects/{projects}/locations/{location}/settings.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
diff --git a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/AsyncGetSettings.java b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/AsyncGetSettings.java
index fe38d5780a69..cb1884e05e8e 100644
--- a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/AsyncGetSettings.java
+++ b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/AsyncGetSettings.java
@@ -39,7 +39,9 @@ public static void asyncGetSettings() throws Exception {
AdvisoryNotificationsServiceClient.create()) {
GetSettingsRequest request =
GetSettingsRequest.newBuilder()
- .setName(SettingsName.of("[ORGANIZATION]", "[LOCATION]").toString())
+ .setName(
+ SettingsName.ofOrganizationLocationName("[ORGANIZATION]", "[LOCATION]")
+ .toString())
.build();
ApiFuture future =
advisoryNotificationsServiceClient.getSettingsCallable().futureCall(request);
diff --git a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettings.java b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettings.java
index a0e991267a09..c2e8444171ef 100644
--- a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettings.java
+++ b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettings.java
@@ -38,7 +38,9 @@ public static void syncGetSettings() throws Exception {
AdvisoryNotificationsServiceClient.create()) {
GetSettingsRequest request =
GetSettingsRequest.newBuilder()
- .setName(SettingsName.of("[ORGANIZATION]", "[LOCATION]").toString())
+ .setName(
+ SettingsName.ofOrganizationLocationName("[ORGANIZATION]", "[LOCATION]")
+ .toString())
.build();
Settings response = advisoryNotificationsServiceClient.getSettings(request);
}
diff --git a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsSettingsname.java b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsSettingsname.java
index 00fc3e3bb46b..8c95c4339c38 100644
--- a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsSettingsname.java
+++ b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsSettingsname.java
@@ -35,7 +35,7 @@ public static void syncGetSettingsSettingsname() throws Exception {
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
AdvisoryNotificationsServiceClient.create()) {
- SettingsName name = SettingsName.of("[ORGANIZATION]", "[LOCATION]");
+ SettingsName name = SettingsName.ofOrganizationLocationName("[ORGANIZATION]", "[LOCATION]");
Settings response = advisoryNotificationsServiceClient.getSettings(name);
}
}
diff --git a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsString.java b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsString.java
index 695337e5627c..92f4c0011fbf 100644
--- a/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsString.java
+++ b/java-advisorynotifications/samples/snippets/generated/com/google/cloud/advisorynotifications/v1/advisorynotificationsservice/getsettings/SyncGetSettingsString.java
@@ -35,7 +35,8 @@ public static void syncGetSettingsString() throws Exception {
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient =
AdvisoryNotificationsServiceClient.create()) {
- String name = SettingsName.of("[ORGANIZATION]", "[LOCATION]").toString();
+ String name =
+ SettingsName.ofOrganizationLocationName("[ORGANIZATION]", "[LOCATION]").toString();
Settings response = advisoryNotificationsServiceClient.getSettings(name);
}
}
diff --git a/java-aiplatform/README.md b/java-aiplatform/README.md
index 9525400261b5..9b5f741a1fee 100644
--- a/java-aiplatform/README.md
+++ b/java-aiplatform/README.md
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
com.google.cloud
libraries-bom
- 26.34.0
+ 26.37.0
pom
import
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-aiplatform.svg
-[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.39.0
+[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.42.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceClient.java
new file mode 100644
index 000000000000..1b6a16f6103b
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceClient.java
@@ -0,0 +1,1408 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1;
+
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.aiplatform.v1.stub.GenAiTuningServiceStub;
+import com.google.cloud.aiplatform.v1.stub.GenAiTuningServiceStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: A service for creating and managing GenAI Tuning Jobs.
+ *
+ * This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * TuningJob tuningJob = TuningJob.newBuilder().build();
+ * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the GenAiTuningServiceClient object to clean up resources
+ * such as threads. In the example above, try-with-resources is used, which automatically calls
+ * close().
+ *
+ *
+ * Methods
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ * CreateTuningJob
+ * Creates a TuningJob. A created TuningJob right away will be attempted to be run.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * createTuningJob(CreateTuningJobRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * createTuningJob(LocationName parent, TuningJob tuningJob)
+ *
createTuningJob(String parent, TuningJob tuningJob)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * createTuningJobCallable()
+ *
+ *
+ *
+ *
+ * GetTuningJob
+ * Gets a TuningJob.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getTuningJob(GetTuningJobRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * getTuningJob(TuningJobName name)
+ *
getTuningJob(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getTuningJobCallable()
+ *
+ *
+ *
+ *
+ * ListTuningJobs
+ * Lists TuningJobs in a Location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listTuningJobs(ListTuningJobsRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * listTuningJobs(LocationName parent)
+ *
listTuningJobs(String parent)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listTuningJobsPagedCallable()
+ *
listTuningJobsCallable()
+ *
+ *
+ *
+ *
+ * CancelTuningJob
+ * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to `CANCELLED`.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * cancelTuningJob(CancelTuningJobRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * cancelTuningJob(TuningJobName name)
+ *
cancelTuningJob(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * cancelTuningJobCallable()
+ *
+ *
+ *
+ *
+ * ListLocations
+ * Lists information about the supported locations for this service.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listLocations(ListLocationsRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listLocationsPagedCallable()
+ *
listLocationsCallable()
+ *
+ *
+ *
+ *
+ * GetLocation
+ * Gets information about a location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getLocation(GetLocationRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getLocationCallable()
+ *
+ *
+ *
+ *
+ * SetIamPolicy
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * setIamPolicy(SetIamPolicyRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * setIamPolicyCallable()
+ *
+ *
+ *
+ *
+ * GetIamPolicy
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getIamPolicy(GetIamPolicyRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getIamPolicyCallable()
+ *
+ *
+ *
+ *
+ * TestIamPermissions
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * testIamPermissions(TestIamPermissionsRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * testIamPermissionsCallable()
+ *
+ *
+ *
+ *
+ *
+ * See the individual methods for example code.
+ *
+ *
Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ *
This class can be customized by passing in a custom instance of GenAiTuningServiceSettings to
+ * create(). For example:
+ *
+ *
To customize credentials:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * GenAiTuningServiceSettings genAiTuningServiceSettings =
+ * GenAiTuningServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * GenAiTuningServiceClient genAiTuningServiceClient =
+ * GenAiTuningServiceClient.create(genAiTuningServiceSettings);
+ * }
+ *
+ * To customize the endpoint:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * GenAiTuningServiceSettings genAiTuningServiceSettings =
+ * GenAiTuningServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * GenAiTuningServiceClient genAiTuningServiceClient =
+ * GenAiTuningServiceClient.create(genAiTuningServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class GenAiTuningServiceClient implements BackgroundResource {
+ private final GenAiTuningServiceSettings settings;
+ private final GenAiTuningServiceStub stub;
+
+ /** Constructs an instance of GenAiTuningServiceClient with default settings. */
+ public static final GenAiTuningServiceClient create() throws IOException {
+ return create(GenAiTuningServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of GenAiTuningServiceClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final GenAiTuningServiceClient create(GenAiTuningServiceSettings settings)
+ throws IOException {
+ return new GenAiTuningServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of GenAiTuningServiceClient, using the given stub for making calls. This
+ * is for advanced usage - prefer using create(GenAiTuningServiceSettings).
+ */
+ public static final GenAiTuningServiceClient create(GenAiTuningServiceStub stub) {
+ return new GenAiTuningServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of GenAiTuningServiceClient, using the given settings. This is protected
+ * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected GenAiTuningServiceClient(GenAiTuningServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((GenAiTuningServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected GenAiTuningServiceClient(GenAiTuningServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final GenAiTuningServiceSettings getSettings() {
+ return settings;
+ }
+
+ public GenAiTuningServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a TuningJob. A created TuningJob right away will be attempted to be run.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * TuningJob tuningJob = TuningJob.newBuilder().build();
+ * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob);
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the TuningJob in. Format:
+ * `projects/{project}/locations/{location}`
+ * @param tuningJob Required. The TuningJob to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TuningJob createTuningJob(LocationName parent, TuningJob tuningJob) {
+ CreateTuningJobRequest request =
+ CreateTuningJobRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTuningJob(tuningJob)
+ .build();
+ return createTuningJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a TuningJob. A created TuningJob right away will be attempted to be run.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * TuningJob tuningJob = TuningJob.newBuilder().build();
+ * TuningJob response = genAiTuningServiceClient.createTuningJob(parent, tuningJob);
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the TuningJob in. Format:
+ * `projects/{project}/locations/{location}`
+ * @param tuningJob Required. The TuningJob to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TuningJob createTuningJob(String parent, TuningJob tuningJob) {
+ CreateTuningJobRequest request =
+ CreateTuningJobRequest.newBuilder().setParent(parent).setTuningJob(tuningJob).build();
+ return createTuningJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a TuningJob. A created TuningJob right away will be attempted to be run.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * CreateTuningJobRequest request =
+ * CreateTuningJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setTuningJob(TuningJob.newBuilder().build())
+ * .build();
+ * TuningJob response = genAiTuningServiceClient.createTuningJob(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TuningJob createTuningJob(CreateTuningJobRequest request) {
+ return createTuningJobCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a TuningJob. A created TuningJob right away will be attempted to be run.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * CreateTuningJobRequest request =
+ * CreateTuningJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setTuningJob(TuningJob.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.createTuningJobCallable().futureCall(request);
+ * // Do something.
+ * TuningJob response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable createTuningJobCallable() {
+ return stub.createTuningJobCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a TuningJob.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * TuningJobName name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]");
+ * TuningJob response = genAiTuningServiceClient.getTuningJob(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the TuningJob resource. Format:
+ * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TuningJob getTuningJob(TuningJobName name) {
+ GetTuningJobRequest request =
+ GetTuningJobRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getTuningJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a TuningJob.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * String name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString();
+ * TuningJob response = genAiTuningServiceClient.getTuningJob(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the TuningJob resource. Format:
+ * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TuningJob getTuningJob(String name) {
+ GetTuningJobRequest request = GetTuningJobRequest.newBuilder().setName(name).build();
+ return getTuningJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a TuningJob.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * GetTuningJobRequest request =
+ * GetTuningJobRequest.newBuilder()
+ * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString())
+ * .build();
+ * TuningJob response = genAiTuningServiceClient.getTuningJob(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TuningJob getTuningJob(GetTuningJobRequest request) {
+ return getTuningJobCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a TuningJob.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * GetTuningJobRequest request =
+ * GetTuningJobRequest.newBuilder()
+ * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString())
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.getTuningJobCallable().futureCall(request);
+ * // Do something.
+ * TuningJob response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getTuningJobCallable() {
+ return stub.getTuningJobCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists TuningJobs in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (TuningJob element : genAiTuningServiceClient.listTuningJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to list the TuningJobs from. Format:
+ * `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTuningJobsPagedResponse listTuningJobs(LocationName parent) {
+ ListTuningJobsRequest request =
+ ListTuningJobsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listTuningJobs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists TuningJobs in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (TuningJob element : genAiTuningServiceClient.listTuningJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to list the TuningJobs from. Format:
+ * `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTuningJobsPagedResponse listTuningJobs(String parent) {
+ ListTuningJobsRequest request = ListTuningJobsRequest.newBuilder().setParent(parent).build();
+ return listTuningJobs(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists TuningJobs in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * ListTuningJobsRequest request =
+ * ListTuningJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (TuningJob element : genAiTuningServiceClient.listTuningJobs(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTuningJobsPagedResponse listTuningJobs(ListTuningJobsRequest request) {
+ return listTuningJobsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists TuningJobs in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * ListTuningJobsRequest request =
+ * ListTuningJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.listTuningJobsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (TuningJob element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listTuningJobsPagedCallable() {
+ return stub.listTuningJobsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists TuningJobs in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * ListTuningJobsRequest request =
+ * ListTuningJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListTuningJobsResponse response =
+ * genAiTuningServiceClient.listTuningJobsCallable().call(request);
+ * for (TuningJob element : response.getTuningJobsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listTuningJobsCallable() {
+ return stub.listTuningJobsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best
+ * effort to cancel the job, but success is not guaranteed. Clients can use
+ * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
+ * or other methods to check whether the cancellation succeeded or whether the job completed
+ * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it
+ * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
+ * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
+ * [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to `CANCELLED`.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * TuningJobName name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]");
+ * genAiTuningServiceClient.cancelTuningJob(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the TuningJob to cancel. Format:
+ * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void cancelTuningJob(TuningJobName name) {
+ CancelTuningJobRequest request =
+ CancelTuningJobRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ cancelTuningJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best
+ * effort to cancel the job, but success is not guaranteed. Clients can use
+ * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
+ * or other methods to check whether the cancellation succeeded or whether the job completed
+ * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it
+ * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
+ * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
+ * [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to `CANCELLED`.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * String name = TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString();
+ * genAiTuningServiceClient.cancelTuningJob(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the TuningJob to cancel. Format:
+ * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void cancelTuningJob(String name) {
+ CancelTuningJobRequest request = CancelTuningJobRequest.newBuilder().setName(name).build();
+ cancelTuningJob(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best
+ * effort to cancel the job, but success is not guaranteed. Clients can use
+ * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
+ * or other methods to check whether the cancellation succeeded or whether the job completed
+ * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it
+ * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
+ * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
+ * [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to `CANCELLED`.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * CancelTuningJobRequest request =
+ * CancelTuningJobRequest.newBuilder()
+ * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString())
+ * .build();
+ * genAiTuningServiceClient.cancelTuningJob(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void cancelTuningJob(CancelTuningJobRequest request) {
+ cancelTuningJobCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best
+ * effort to cancel the job, but success is not guaranteed. Clients can use
+ * [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
+ * or other methods to check whether the cancellation succeeded or whether the job completed
+ * despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it
+ * becomes a job with a [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
+ * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
+ * [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to `CANCELLED`.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * CancelTuningJobRequest request =
+ * CancelTuningJobRequest.newBuilder()
+ * .setName(TuningJobName.of("[PROJECT]", "[LOCATION]", "[TUNING_JOB]").toString())
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.cancelTuningJobCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable cancelTuningJobCallable() {
+ return stub.cancelTuningJobCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : genAiTuningServiceClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listLocationsPagedCallable() {
+ return stub.listLocationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * genAiTuningServiceClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listLocationsCallable() {
+ return stub.listLocationsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = genAiTuningServiceClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getLocationCallable() {
+ return stub.getLocationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = genAiTuningServiceClient.setIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.setIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable setIamPolicyCallable() {
+ return stub.setIamPolicyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = genAiTuningServiceClient.getIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.getIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getIamPolicyCallable() {
+ return stub.getIamPolicyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * TestIamPermissionsResponse response = genAiTuningServiceClient.testIamPermissions(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (GenAiTuningServiceClient genAiTuningServiceClient = GenAiTuningServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * genAiTuningServiceClient.testIamPermissionsCallable().futureCall(request);
+ * // Do something.
+ * TestIamPermissionsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ testIamPermissionsCallable() {
+ return stub.testIamPermissionsCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListTuningJobsPagedResponse
+ extends AbstractPagedListResponse<
+ ListTuningJobsRequest,
+ ListTuningJobsResponse,
+ TuningJob,
+ ListTuningJobsPage,
+ ListTuningJobsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListTuningJobsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListTuningJobsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListTuningJobsPagedResponse(ListTuningJobsPage page) {
+ super(page, ListTuningJobsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListTuningJobsPage
+ extends AbstractPage<
+ ListTuningJobsRequest, ListTuningJobsResponse, TuningJob, ListTuningJobsPage> {
+
+ private ListTuningJobsPage(
+ PageContext context,
+ ListTuningJobsResponse response) {
+ super(context, response);
+ }
+
+ private static ListTuningJobsPage createEmptyPage() {
+ return new ListTuningJobsPage(null, null);
+ }
+
+ @Override
+ protected ListTuningJobsPage createPage(
+ PageContext context,
+ ListTuningJobsResponse response) {
+ return new ListTuningJobsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListTuningJobsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListTuningJobsRequest,
+ ListTuningJobsResponse,
+ TuningJob,
+ ListTuningJobsPage,
+ ListTuningJobsFixedSizeCollection> {
+
+ private ListTuningJobsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListTuningJobsFixedSizeCollection createEmptyCollection() {
+ return new ListTuningJobsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListTuningJobsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListTuningJobsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListLocationsPagedResponse
+ extends AbstractPagedListResponse<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListLocationsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListLocationsPagedResponse(ListLocationsPage page) {
+ super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListLocationsPage
+ extends AbstractPage<
+ ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
+
+ private ListLocationsPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ super(context, response);
+ }
+
+ private static ListLocationsPage createEmptyPage() {
+ return new ListLocationsPage(null, null);
+ }
+
+ @Override
+ protected ListLocationsPage createPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ return new ListLocationsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListLocationsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListLocationsFixedSizeCollection createEmptyCollection() {
+ return new ListLocationsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListLocationsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListLocationsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceSettings.java
new file mode 100644
index 000000000000..c28ed084f3bd
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/GenAiTuningServiceSettings.java
@@ -0,0 +1,288 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1;
+
+import static com.google.cloud.aiplatform.v1.GenAiTuningServiceClient.ListLocationsPagedResponse;
+import static com.google.cloud.aiplatform.v1.GenAiTuningServiceClient.ListTuningJobsPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.aiplatform.v1.stub.GenAiTuningServiceStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link GenAiTuningServiceClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (aiplatform.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of createTuningJob to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * GenAiTuningServiceSettings.Builder genAiTuningServiceSettingsBuilder =
+ * GenAiTuningServiceSettings.newBuilder();
+ * genAiTuningServiceSettingsBuilder
+ * .createTuningJobSettings()
+ * .setRetrySettings(
+ * genAiTuningServiceSettingsBuilder
+ * .createTuningJobSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * GenAiTuningServiceSettings genAiTuningServiceSettings =
+ * genAiTuningServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class GenAiTuningServiceSettings extends ClientSettings {
+
+ /** Returns the object with the settings used for calls to createTuningJob. */
+ public UnaryCallSettings createTuningJobSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).createTuningJobSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getTuningJob. */
+ public UnaryCallSettings getTuningJobSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).getTuningJobSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listTuningJobs. */
+ public PagedCallSettings<
+ ListTuningJobsRequest, ListTuningJobsResponse, ListTuningJobsPagedResponse>
+ listTuningJobsSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).listTuningJobsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to cancelTuningJob. */
+ public UnaryCallSettings cancelTuningJobSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).cancelTuningJobSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).listLocationsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).getLocationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to setIamPolicy. */
+ public UnaryCallSettings setIamPolicySettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).setIamPolicySettings();
+ }
+
+ /** Returns the object with the settings used for calls to getIamPolicy. */
+ public UnaryCallSettings getIamPolicySettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).getIamPolicySettings();
+ }
+
+ /** Returns the object with the settings used for calls to testIamPermissions. */
+ public UnaryCallSettings
+ testIamPermissionsSettings() {
+ return ((GenAiTuningServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
+ }
+
+ public static final GenAiTuningServiceSettings create(GenAiTuningServiceStubSettings stub)
+ throws IOException {
+ return new GenAiTuningServiceSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return GenAiTuningServiceStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return GenAiTuningServiceStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return GenAiTuningServiceStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return GenAiTuningServiceStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return GenAiTuningServiceStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return GenAiTuningServiceStubSettings.defaultTransportChannelProvider();
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return GenAiTuningServiceStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected GenAiTuningServiceSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for GenAiTuningServiceSettings. */
+ public static class Builder extends ClientSettings.Builder {
+
+ protected Builder() throws IOException {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(GenAiTuningServiceStubSettings.newBuilder(clientContext));
+ }
+
+ protected Builder(GenAiTuningServiceSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(GenAiTuningServiceStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ private static Builder createDefault() {
+ return new Builder(GenAiTuningServiceStubSettings.newBuilder());
+ }
+
+ public GenAiTuningServiceStubSettings.Builder getStubSettingsBuilder() {
+ return ((GenAiTuningServiceStubSettings.Builder) getStubSettings());
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createTuningJob. */
+ public UnaryCallSettings.Builder createTuningJobSettings() {
+ return getStubSettingsBuilder().createTuningJobSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getTuningJob. */
+ public UnaryCallSettings.Builder getTuningJobSettings() {
+ return getStubSettingsBuilder().getTuningJobSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listTuningJobs. */
+ public PagedCallSettings.Builder<
+ ListTuningJobsRequest, ListTuningJobsResponse, ListTuningJobsPagedResponse>
+ listTuningJobsSettings() {
+ return getStubSettingsBuilder().listTuningJobsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to cancelTuningJob. */
+ public UnaryCallSettings.Builder cancelTuningJobSettings() {
+ return getStubSettingsBuilder().cancelTuningJobSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return getStubSettingsBuilder().listLocationsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getStubSettingsBuilder().getLocationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to setIamPolicy. */
+ public UnaryCallSettings.Builder setIamPolicySettings() {
+ return getStubSettingsBuilder().setIamPolicySettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getIamPolicy. */
+ public UnaryCallSettings.Builder getIamPolicySettings() {
+ return getStubSettingsBuilder().getIamPolicySettings();
+ }
+
+ /** Returns the builder for the settings used for calls to testIamPermissions. */
+ public UnaryCallSettings.Builder
+ testIamPermissionsSettings() {
+ return getStubSettingsBuilder().testIamPermissionsSettings();
+ }
+
+ @Override
+ public GenAiTuningServiceSettings build() throws IOException {
+ return new GenAiTuningServiceSettings(this);
+ }
+ }
+}
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/NotebookServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/NotebookServiceClient.java
new file mode 100644
index 000000000000..eca18ef93b60
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/NotebookServiceClient.java
@@ -0,0 +1,2884 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1;
+
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.aiplatform.v1.stub.NotebookServiceStub;
+import com.google.cloud.aiplatform.v1.stub.NotebookServiceStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.longrunning.OperationsClient;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: The interface for Vertex Notebook service (a.k.a. Colab on Workbench).
+ *
+ * This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeTemplateName name =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
+ * NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the NotebookServiceClient object to clean up resources
+ * such as threads. In the example above, try-with-resources is used, which automatically calls
+ * close().
+ *
+ *
+ * Methods
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ * CreateNotebookRuntimeTemplate
+ * Creates a NotebookRuntimeTemplate.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * createNotebookRuntimeTemplateAsync(CreateNotebookRuntimeTemplateRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * createNotebookRuntimeTemplateAsync(LocationName parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)
+ *
createNotebookRuntimeTemplateAsync(String parent, NotebookRuntimeTemplate notebookRuntimeTemplate, String notebookRuntimeTemplateId)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * createNotebookRuntimeTemplateOperationCallable()
+ *
createNotebookRuntimeTemplateCallable()
+ *
+ *
+ *
+ *
+ * GetNotebookRuntimeTemplate
+ * Gets a NotebookRuntimeTemplate.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getNotebookRuntimeTemplate(GetNotebookRuntimeTemplateRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * getNotebookRuntimeTemplate(NotebookRuntimeTemplateName name)
+ *
getNotebookRuntimeTemplate(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getNotebookRuntimeTemplateCallable()
+ *
+ *
+ *
+ *
+ * ListNotebookRuntimeTemplates
+ * Lists NotebookRuntimeTemplates in a Location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listNotebookRuntimeTemplates(ListNotebookRuntimeTemplatesRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * listNotebookRuntimeTemplates(LocationName parent)
+ *
listNotebookRuntimeTemplates(String parent)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listNotebookRuntimeTemplatesPagedCallable()
+ *
listNotebookRuntimeTemplatesCallable()
+ *
+ *
+ *
+ *
+ * DeleteNotebookRuntimeTemplate
+ * Deletes a NotebookRuntimeTemplate.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * deleteNotebookRuntimeTemplateAsync(DeleteNotebookRuntimeTemplateRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * deleteNotebookRuntimeTemplateAsync(NotebookRuntimeTemplateName name)
+ *
deleteNotebookRuntimeTemplateAsync(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * deleteNotebookRuntimeTemplateOperationCallable()
+ *
deleteNotebookRuntimeTemplateCallable()
+ *
+ *
+ *
+ *
+ * AssignNotebookRuntime
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either returns an existing assignment or generates a new one.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * assignNotebookRuntimeAsync(AssignNotebookRuntimeRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * assignNotebookRuntimeAsync(LocationName parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
+ *
assignNotebookRuntimeAsync(LocationName parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
+ *
assignNotebookRuntimeAsync(String parent, NotebookRuntimeTemplateName notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
+ *
assignNotebookRuntimeAsync(String parent, String notebookRuntimeTemplate, NotebookRuntime notebookRuntime, String notebookRuntimeId)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * assignNotebookRuntimeOperationCallable()
+ *
assignNotebookRuntimeCallable()
+ *
+ *
+ *
+ *
+ * GetNotebookRuntime
+ * Gets a NotebookRuntime.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getNotebookRuntime(GetNotebookRuntimeRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * getNotebookRuntime(NotebookRuntimeName name)
+ *
getNotebookRuntime(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getNotebookRuntimeCallable()
+ *
+ *
+ *
+ *
+ * ListNotebookRuntimes
+ * Lists NotebookRuntimes in a Location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listNotebookRuntimes(ListNotebookRuntimesRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * listNotebookRuntimes(LocationName parent)
+ *
listNotebookRuntimes(String parent)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listNotebookRuntimesPagedCallable()
+ *
listNotebookRuntimesCallable()
+ *
+ *
+ *
+ *
+ * DeleteNotebookRuntime
+ * Deletes a NotebookRuntime.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * deleteNotebookRuntimeAsync(DeleteNotebookRuntimeRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * deleteNotebookRuntimeAsync(NotebookRuntimeName name)
+ *
deleteNotebookRuntimeAsync(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * deleteNotebookRuntimeOperationCallable()
+ *
deleteNotebookRuntimeCallable()
+ *
+ *
+ *
+ *
+ * UpgradeNotebookRuntime
+ * Upgrades a NotebookRuntime.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * upgradeNotebookRuntimeAsync(NotebookRuntimeName name)
+ *
upgradeNotebookRuntimeAsync(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * upgradeNotebookRuntimeOperationCallable()
+ *
upgradeNotebookRuntimeCallable()
+ *
+ *
+ *
+ *
+ * StartNotebookRuntime
+ * Starts a NotebookRuntime.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * startNotebookRuntimeAsync(StartNotebookRuntimeRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * startNotebookRuntimeAsync(NotebookRuntimeName name)
+ *
startNotebookRuntimeAsync(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * startNotebookRuntimeOperationCallable()
+ *
startNotebookRuntimeCallable()
+ *
+ *
+ *
+ *
+ * ListLocations
+ * Lists information about the supported locations for this service.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listLocations(ListLocationsRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listLocationsPagedCallable()
+ *
listLocationsCallable()
+ *
+ *
+ *
+ *
+ * GetLocation
+ * Gets information about a location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getLocation(GetLocationRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getLocationCallable()
+ *
+ *
+ *
+ *
+ * SetIamPolicy
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * setIamPolicy(SetIamPolicyRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * setIamPolicyCallable()
+ *
+ *
+ *
+ *
+ * GetIamPolicy
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getIamPolicy(GetIamPolicyRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getIamPolicyCallable()
+ *
+ *
+ *
+ *
+ * TestIamPermissions
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * testIamPermissions(TestIamPermissionsRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * testIamPermissionsCallable()
+ *
+ *
+ *
+ *
+ *
+ * See the individual methods for example code.
+ *
+ *
Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ *
This class can be customized by passing in a custom instance of NotebookServiceSettings to
+ * create(). For example:
+ *
+ *
To customize credentials:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * NotebookServiceSettings notebookServiceSettings =
+ * NotebookServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * NotebookServiceClient notebookServiceClient =
+ * NotebookServiceClient.create(notebookServiceSettings);
+ * }
+ *
+ * To customize the endpoint:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * NotebookServiceSettings notebookServiceSettings =
+ * NotebookServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * NotebookServiceClient notebookServiceClient =
+ * NotebookServiceClient.create(notebookServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class NotebookServiceClient implements BackgroundResource {
+ private final NotebookServiceSettings settings;
+ private final NotebookServiceStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of NotebookServiceClient with default settings. */
+ public static final NotebookServiceClient create() throws IOException {
+ return create(NotebookServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of NotebookServiceClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final NotebookServiceClient create(NotebookServiceSettings settings)
+ throws IOException {
+ return new NotebookServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of NotebookServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(NotebookServiceSettings).
+ */
+ public static final NotebookServiceClient create(NotebookServiceStub stub) {
+ return new NotebookServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of NotebookServiceClient, using the given settings. This is protected so
+ * that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected NotebookServiceClient(NotebookServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((NotebookServiceStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ protected NotebookServiceClient(NotebookServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final NotebookServiceSettings getSettings() {
+ return settings;
+ }
+
+ public NotebookServiceStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a NotebookRuntimeTemplate.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * NotebookRuntimeTemplate notebookRuntimeTemplate =
+ * NotebookRuntimeTemplate.newBuilder().build();
+ * String notebookRuntimeTemplateId = "notebookRuntimeTemplateId-633369454";
+ * NotebookRuntimeTemplate response =
+ * notebookServiceClient
+ * .createNotebookRuntimeTemplateAsync(
+ * parent, notebookRuntimeTemplate, notebookRuntimeTemplateId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the
+ * NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`
+ * @param notebookRuntimeTemplate Required. The NotebookRuntimeTemplate to create.
+ * @param notebookRuntimeTemplateId Optional. User specified ID for the notebook runtime template.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ NotebookRuntimeTemplate, CreateNotebookRuntimeTemplateOperationMetadata>
+ createNotebookRuntimeTemplateAsync(
+ LocationName parent,
+ NotebookRuntimeTemplate notebookRuntimeTemplate,
+ String notebookRuntimeTemplateId) {
+ CreateNotebookRuntimeTemplateRequest request =
+ CreateNotebookRuntimeTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setNotebookRuntimeTemplate(notebookRuntimeTemplate)
+ .setNotebookRuntimeTemplateId(notebookRuntimeTemplateId)
+ .build();
+ return createNotebookRuntimeTemplateAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * NotebookRuntimeTemplate notebookRuntimeTemplate =
+ * NotebookRuntimeTemplate.newBuilder().build();
+ * String notebookRuntimeTemplateId = "notebookRuntimeTemplateId-633369454";
+ * NotebookRuntimeTemplate response =
+ * notebookServiceClient
+ * .createNotebookRuntimeTemplateAsync(
+ * parent, notebookRuntimeTemplate, notebookRuntimeTemplateId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the
+ * NotebookRuntimeTemplate. Format: `projects/{project}/locations/{location}`
+ * @param notebookRuntimeTemplate Required. The NotebookRuntimeTemplate to create.
+ * @param notebookRuntimeTemplateId Optional. User specified ID for the notebook runtime template.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ NotebookRuntimeTemplate, CreateNotebookRuntimeTemplateOperationMetadata>
+ createNotebookRuntimeTemplateAsync(
+ String parent,
+ NotebookRuntimeTemplate notebookRuntimeTemplate,
+ String notebookRuntimeTemplateId) {
+ CreateNotebookRuntimeTemplateRequest request =
+ CreateNotebookRuntimeTemplateRequest.newBuilder()
+ .setParent(parent)
+ .setNotebookRuntimeTemplate(notebookRuntimeTemplate)
+ .setNotebookRuntimeTemplateId(notebookRuntimeTemplateId)
+ .build();
+ return createNotebookRuntimeTemplateAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * CreateNotebookRuntimeTemplateRequest request =
+ * CreateNotebookRuntimeTemplateRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
+ * .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
+ * .build();
+ * NotebookRuntimeTemplate response =
+ * notebookServiceClient.createNotebookRuntimeTemplateAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ NotebookRuntimeTemplate, CreateNotebookRuntimeTemplateOperationMetadata>
+ createNotebookRuntimeTemplateAsync(CreateNotebookRuntimeTemplateRequest request) {
+ return createNotebookRuntimeTemplateOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * CreateNotebookRuntimeTemplateRequest request =
+ * CreateNotebookRuntimeTemplateRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
+ * .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
+ * .build();
+ * OperationFuture
+ * future =
+ * notebookServiceClient
+ * .createNotebookRuntimeTemplateOperationCallable()
+ * .futureCall(request);
+ * // Do something.
+ * NotebookRuntimeTemplate response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ CreateNotebookRuntimeTemplateRequest,
+ NotebookRuntimeTemplate,
+ CreateNotebookRuntimeTemplateOperationMetadata>
+ createNotebookRuntimeTemplateOperationCallable() {
+ return stub.createNotebookRuntimeTemplateOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * CreateNotebookRuntimeTemplateRequest request =
+ * CreateNotebookRuntimeTemplateRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setNotebookRuntimeTemplate(NotebookRuntimeTemplate.newBuilder().build())
+ * .setNotebookRuntimeTemplateId("notebookRuntimeTemplateId-633369454")
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.createNotebookRuntimeTemplateCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ createNotebookRuntimeTemplateCallable() {
+ return stub.createNotebookRuntimeTemplateCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeTemplateName name =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
+ * NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntimeTemplate resource. Format:
+ * `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(
+ NotebookRuntimeTemplateName name) {
+ GetNotebookRuntimeTemplateRequest request =
+ GetNotebookRuntimeTemplateRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getNotebookRuntimeTemplate(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String name =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString();
+ * NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntimeTemplate resource. Format:
+ * `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(String name) {
+ GetNotebookRuntimeTemplateRequest request =
+ GetNotebookRuntimeTemplateRequest.newBuilder().setName(name).build();
+ return getNotebookRuntimeTemplate(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetNotebookRuntimeTemplateRequest request =
+ * GetNotebookRuntimeTemplateRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .build();
+ * NotebookRuntimeTemplate response = notebookServiceClient.getNotebookRuntimeTemplate(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotebookRuntimeTemplate getNotebookRuntimeTemplate(
+ GetNotebookRuntimeTemplateRequest request) {
+ return getNotebookRuntimeTemplateCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetNotebookRuntimeTemplateRequest request =
+ * GetNotebookRuntimeTemplateRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.getNotebookRuntimeTemplateCallable().futureCall(request);
+ * // Do something.
+ * NotebookRuntimeTemplate response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ getNotebookRuntimeTemplateCallable() {
+ return stub.getNotebookRuntimeTemplateCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimeTemplates in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (NotebookRuntimeTemplate element :
+ * notebookServiceClient.listNotebookRuntimeTemplates(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location from which to list the
+ * NotebookRuntimeTemplates. Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(
+ LocationName parent) {
+ ListNotebookRuntimeTemplatesRequest request =
+ ListNotebookRuntimeTemplatesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listNotebookRuntimeTemplates(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimeTemplates in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (NotebookRuntimeTemplate element :
+ * notebookServiceClient.listNotebookRuntimeTemplates(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location from which to list the
+ * NotebookRuntimeTemplates. Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(
+ String parent) {
+ ListNotebookRuntimeTemplatesRequest request =
+ ListNotebookRuntimeTemplatesRequest.newBuilder().setParent(parent).build();
+ return listNotebookRuntimeTemplates(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimeTemplates in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListNotebookRuntimeTemplatesRequest request =
+ * ListNotebookRuntimeTemplatesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (NotebookRuntimeTemplate element :
+ * notebookServiceClient.listNotebookRuntimeTemplates(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotebookRuntimeTemplatesPagedResponse listNotebookRuntimeTemplates(
+ ListNotebookRuntimeTemplatesRequest request) {
+ return listNotebookRuntimeTemplatesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimeTemplates in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListNotebookRuntimeTemplatesRequest request =
+ * ListNotebookRuntimeTemplatesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.listNotebookRuntimeTemplatesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (NotebookRuntimeTemplate element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListNotebookRuntimeTemplatesRequest, ListNotebookRuntimeTemplatesPagedResponse>
+ listNotebookRuntimeTemplatesPagedCallable() {
+ return stub.listNotebookRuntimeTemplatesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimeTemplates in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListNotebookRuntimeTemplatesRequest request =
+ * ListNotebookRuntimeTemplatesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListNotebookRuntimeTemplatesResponse response =
+ * notebookServiceClient.listNotebookRuntimeTemplatesCallable().call(request);
+ * for (NotebookRuntimeTemplate element : response.getNotebookRuntimeTemplatesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListNotebookRuntimeTemplatesRequest, ListNotebookRuntimeTemplatesResponse>
+ listNotebookRuntimeTemplatesCallable() {
+ return stub.listNotebookRuntimeTemplatesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeTemplateName name =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
+ * notebookServiceClient.deleteNotebookRuntimeTemplateAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format:
+ * `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteNotebookRuntimeTemplateAsync(
+ NotebookRuntimeTemplateName name) {
+ DeleteNotebookRuntimeTemplateRequest request =
+ DeleteNotebookRuntimeTemplateRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return deleteNotebookRuntimeTemplateAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String name =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString();
+ * notebookServiceClient.deleteNotebookRuntimeTemplateAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntimeTemplate resource to be deleted. Format:
+ * `projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteNotebookRuntimeTemplateAsync(
+ String name) {
+ DeleteNotebookRuntimeTemplateRequest request =
+ DeleteNotebookRuntimeTemplateRequest.newBuilder().setName(name).build();
+ return deleteNotebookRuntimeTemplateAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * DeleteNotebookRuntimeTemplateRequest request =
+ * DeleteNotebookRuntimeTemplateRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .build();
+ * notebookServiceClient.deleteNotebookRuntimeTemplateAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteNotebookRuntimeTemplateAsync(
+ DeleteNotebookRuntimeTemplateRequest request) {
+ return deleteNotebookRuntimeTemplateOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * DeleteNotebookRuntimeTemplateRequest request =
+ * DeleteNotebookRuntimeTemplateRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .build();
+ * OperationFuture future =
+ * notebookServiceClient
+ * .deleteNotebookRuntimeTemplateOperationCallable()
+ * .futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ DeleteNotebookRuntimeTemplateRequest, Empty, DeleteOperationMetadata>
+ deleteNotebookRuntimeTemplateOperationCallable() {
+ return stub.deleteNotebookRuntimeTemplateOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntimeTemplate.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * DeleteNotebookRuntimeTemplateRequest request =
+ * DeleteNotebookRuntimeTemplateRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.deleteNotebookRuntimeTemplateCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ deleteNotebookRuntimeTemplateCallable() {
+ return stub.deleteNotebookRuntimeTemplateCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * NotebookRuntimeTemplateName notebookRuntimeTemplate =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
+ * NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
+ * String notebookRuntimeId = "notebookRuntimeId400795512";
+ * NotebookRuntime response =
+ * notebookServiceClient
+ * .assignNotebookRuntimeAsync(
+ * parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to get the NotebookRuntime
+ * assignment. Format: `projects/{project}/locations/{location}`
+ * @param notebookRuntimeTemplate Required. The resource name of the NotebookRuntimeTemplate based
+ * on which a NotebookRuntime will be assigned (reuse or create a new one).
+ * @param notebookRuntime Required. Provide runtime specific information (e.g. runtime owner,
+ * notebook id) used for NotebookRuntime assignment.
+ * @param notebookRuntimeId Optional. User specified ID for the notebook runtime.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ assignNotebookRuntimeAsync(
+ LocationName parent,
+ NotebookRuntimeTemplateName notebookRuntimeTemplate,
+ NotebookRuntime notebookRuntime,
+ String notebookRuntimeId) {
+ AssignNotebookRuntimeRequest request =
+ AssignNotebookRuntimeRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setNotebookRuntimeTemplate(
+ notebookRuntimeTemplate == null ? null : notebookRuntimeTemplate.toString())
+ .setNotebookRuntime(notebookRuntime)
+ .setNotebookRuntimeId(notebookRuntimeId)
+ .build();
+ return assignNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String notebookRuntimeTemplate =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString();
+ * NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
+ * String notebookRuntimeId = "notebookRuntimeId400795512";
+ * NotebookRuntime response =
+ * notebookServiceClient
+ * .assignNotebookRuntimeAsync(
+ * parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to get the NotebookRuntime
+ * assignment. Format: `projects/{project}/locations/{location}`
+ * @param notebookRuntimeTemplate Required. The resource name of the NotebookRuntimeTemplate based
+ * on which a NotebookRuntime will be assigned (reuse or create a new one).
+ * @param notebookRuntime Required. Provide runtime specific information (e.g. runtime owner,
+ * notebook id) used for NotebookRuntime assignment.
+ * @param notebookRuntimeId Optional. User specified ID for the notebook runtime.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ assignNotebookRuntimeAsync(
+ LocationName parent,
+ String notebookRuntimeTemplate,
+ NotebookRuntime notebookRuntime,
+ String notebookRuntimeId) {
+ AssignNotebookRuntimeRequest request =
+ AssignNotebookRuntimeRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setNotebookRuntimeTemplate(notebookRuntimeTemplate)
+ .setNotebookRuntime(notebookRuntime)
+ .setNotebookRuntimeId(notebookRuntimeId)
+ .build();
+ return assignNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * NotebookRuntimeTemplateName notebookRuntimeTemplate =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]");
+ * NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
+ * String notebookRuntimeId = "notebookRuntimeId400795512";
+ * NotebookRuntime response =
+ * notebookServiceClient
+ * .assignNotebookRuntimeAsync(
+ * parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to get the NotebookRuntime
+ * assignment. Format: `projects/{project}/locations/{location}`
+ * @param notebookRuntimeTemplate Required. The resource name of the NotebookRuntimeTemplate based
+ * on which a NotebookRuntime will be assigned (reuse or create a new one).
+ * @param notebookRuntime Required. Provide runtime specific information (e.g. runtime owner,
+ * notebook id) used for NotebookRuntime assignment.
+ * @param notebookRuntimeId Optional. User specified ID for the notebook runtime.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ assignNotebookRuntimeAsync(
+ String parent,
+ NotebookRuntimeTemplateName notebookRuntimeTemplate,
+ NotebookRuntime notebookRuntime,
+ String notebookRuntimeId) {
+ AssignNotebookRuntimeRequest request =
+ AssignNotebookRuntimeRequest.newBuilder()
+ .setParent(parent)
+ .setNotebookRuntimeTemplate(
+ notebookRuntimeTemplate == null ? null : notebookRuntimeTemplate.toString())
+ .setNotebookRuntime(notebookRuntime)
+ .setNotebookRuntimeId(notebookRuntimeId)
+ .build();
+ return assignNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * String notebookRuntimeTemplate =
+ * NotebookRuntimeTemplateName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString();
+ * NotebookRuntime notebookRuntime = NotebookRuntime.newBuilder().build();
+ * String notebookRuntimeId = "notebookRuntimeId400795512";
+ * NotebookRuntime response =
+ * notebookServiceClient
+ * .assignNotebookRuntimeAsync(
+ * parent, notebookRuntimeTemplate, notebookRuntime, notebookRuntimeId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to get the NotebookRuntime
+ * assignment. Format: `projects/{project}/locations/{location}`
+ * @param notebookRuntimeTemplate Required. The resource name of the NotebookRuntimeTemplate based
+ * on which a NotebookRuntime will be assigned (reuse or create a new one).
+ * @param notebookRuntime Required. Provide runtime specific information (e.g. runtime owner,
+ * notebook id) used for NotebookRuntime assignment.
+ * @param notebookRuntimeId Optional. User specified ID for the notebook runtime.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ assignNotebookRuntimeAsync(
+ String parent,
+ String notebookRuntimeTemplate,
+ NotebookRuntime notebookRuntime,
+ String notebookRuntimeId) {
+ AssignNotebookRuntimeRequest request =
+ AssignNotebookRuntimeRequest.newBuilder()
+ .setParent(parent)
+ .setNotebookRuntimeTemplate(notebookRuntimeTemplate)
+ .setNotebookRuntime(notebookRuntime)
+ .setNotebookRuntimeId(notebookRuntimeId)
+ .build();
+ return assignNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * AssignNotebookRuntimeRequest request =
+ * AssignNotebookRuntimeRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setNotebookRuntimeTemplate(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .setNotebookRuntime(NotebookRuntime.newBuilder().build())
+ * .setNotebookRuntimeId("notebookRuntimeId400795512")
+ * .build();
+ * NotebookRuntime response = notebookServiceClient.assignNotebookRuntimeAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ assignNotebookRuntimeAsync(AssignNotebookRuntimeRequest request) {
+ return assignNotebookRuntimeOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * AssignNotebookRuntimeRequest request =
+ * AssignNotebookRuntimeRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setNotebookRuntimeTemplate(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .setNotebookRuntime(NotebookRuntime.newBuilder().build())
+ * .setNotebookRuntimeId("notebookRuntimeId400795512")
+ * .build();
+ * OperationFuture future =
+ * notebookServiceClient.assignNotebookRuntimeOperationCallable().futureCall(request);
+ * // Do something.
+ * NotebookRuntime response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ AssignNotebookRuntimeRequest, NotebookRuntime, AssignNotebookRuntimeOperationMetadata>
+ assignNotebookRuntimeOperationCallable() {
+ return stub.assignNotebookRuntimeOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Assigns a NotebookRuntime to a user for a particular Notebook file. This method will either
+ * returns an existing assignment or generates a new one.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * AssignNotebookRuntimeRequest request =
+ * AssignNotebookRuntimeRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setNotebookRuntimeTemplate(
+ * NotebookRuntimeTemplateName.of(
+ * "[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME_TEMPLATE]")
+ * .toString())
+ * .setNotebookRuntime(NotebookRuntime.newBuilder().build())
+ * .setNotebookRuntimeId("notebookRuntimeId400795512")
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.assignNotebookRuntimeCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ assignNotebookRuntimeCallable() {
+ return stub.assignNotebookRuntimeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeName name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
+ * NotebookRuntime response = notebookServiceClient.getNotebookRuntime(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource. Instead of checking whether the
+ * name is in valid NotebookRuntime resource name format, directly throw NotFound exception if
+ * there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotebookRuntime getNotebookRuntime(NotebookRuntimeName name) {
+ GetNotebookRuntimeRequest request =
+ GetNotebookRuntimeRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getNotebookRuntime(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
+ * NotebookRuntime response = notebookServiceClient.getNotebookRuntime(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource. Instead of checking whether the
+ * name is in valid NotebookRuntime resource name format, directly throw NotFound exception if
+ * there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotebookRuntime getNotebookRuntime(String name) {
+ GetNotebookRuntimeRequest request =
+ GetNotebookRuntimeRequest.newBuilder().setName(name).build();
+ return getNotebookRuntime(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetNotebookRuntimeRequest request =
+ * GetNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * NotebookRuntime response = notebookServiceClient.getNotebookRuntime(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final NotebookRuntime getNotebookRuntime(GetNotebookRuntimeRequest request) {
+ return getNotebookRuntimeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetNotebookRuntimeRequest request =
+ * GetNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.getNotebookRuntimeCallable().futureCall(request);
+ * // Do something.
+ * NotebookRuntime response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ getNotebookRuntimeCallable() {
+ return stub.getNotebookRuntimeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimes in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (NotebookRuntime element :
+ * notebookServiceClient.listNotebookRuntimes(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location from which to list the
+ * NotebookRuntimes. Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotebookRuntimesPagedResponse listNotebookRuntimes(LocationName parent) {
+ ListNotebookRuntimesRequest request =
+ ListNotebookRuntimesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listNotebookRuntimes(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimes in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (NotebookRuntime element :
+ * notebookServiceClient.listNotebookRuntimes(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location from which to list the
+ * NotebookRuntimes. Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotebookRuntimesPagedResponse listNotebookRuntimes(String parent) {
+ ListNotebookRuntimesRequest request =
+ ListNotebookRuntimesRequest.newBuilder().setParent(parent).build();
+ return listNotebookRuntimes(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimes in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListNotebookRuntimesRequest request =
+ * ListNotebookRuntimesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (NotebookRuntime element :
+ * notebookServiceClient.listNotebookRuntimes(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListNotebookRuntimesPagedResponse listNotebookRuntimes(
+ ListNotebookRuntimesRequest request) {
+ return listNotebookRuntimesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimes in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListNotebookRuntimesRequest request =
+ * ListNotebookRuntimesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.listNotebookRuntimesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (NotebookRuntime element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listNotebookRuntimesPagedCallable() {
+ return stub.listNotebookRuntimesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists NotebookRuntimes in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListNotebookRuntimesRequest request =
+ * ListNotebookRuntimesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListNotebookRuntimesResponse response =
+ * notebookServiceClient.listNotebookRuntimesCallable().call(request);
+ * for (NotebookRuntime element : response.getNotebookRuntimesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listNotebookRuntimesCallable() {
+ return stub.listNotebookRuntimesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeName name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
+ * notebookServiceClient.deleteNotebookRuntimeAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource to be deleted. Instead of
+ * checking whether the name is in valid NotebookRuntime resource name format, directly throw
+ * NotFound exception if there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteNotebookRuntimeAsync(
+ NotebookRuntimeName name) {
+ DeleteNotebookRuntimeRequest request =
+ DeleteNotebookRuntimeRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return deleteNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
+ * notebookServiceClient.deleteNotebookRuntimeAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource to be deleted. Instead of
+ * checking whether the name is in valid NotebookRuntime resource name format, directly throw
+ * NotFound exception if there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteNotebookRuntimeAsync(
+ String name) {
+ DeleteNotebookRuntimeRequest request =
+ DeleteNotebookRuntimeRequest.newBuilder().setName(name).build();
+ return deleteNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * DeleteNotebookRuntimeRequest request =
+ * DeleteNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * notebookServiceClient.deleteNotebookRuntimeAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteNotebookRuntimeAsync(
+ DeleteNotebookRuntimeRequest request) {
+ return deleteNotebookRuntimeOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * DeleteNotebookRuntimeRequest request =
+ * DeleteNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * OperationFuture future =
+ * notebookServiceClient.deleteNotebookRuntimeOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ deleteNotebookRuntimeOperationCallable() {
+ return stub.deleteNotebookRuntimeOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * DeleteNotebookRuntimeRequest request =
+ * DeleteNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.deleteNotebookRuntimeCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ deleteNotebookRuntimeCallable() {
+ return stub.deleteNotebookRuntimeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Upgrades a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeName name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
+ * UpgradeNotebookRuntimeResponse response =
+ * notebookServiceClient.upgradeNotebookRuntimeAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource to be upgrade. Instead of
+ * checking whether the name is in valid NotebookRuntime resource name format, directly throw
+ * NotFound exception if there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ UpgradeNotebookRuntimeResponse, UpgradeNotebookRuntimeOperationMetadata>
+ upgradeNotebookRuntimeAsync(NotebookRuntimeName name) {
+ UpgradeNotebookRuntimeRequest request =
+ UpgradeNotebookRuntimeRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return upgradeNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Upgrades a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
+ * UpgradeNotebookRuntimeResponse response =
+ * notebookServiceClient.upgradeNotebookRuntimeAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource to be upgrade. Instead of
+ * checking whether the name is in valid NotebookRuntime resource name format, directly throw
+ * NotFound exception if there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ UpgradeNotebookRuntimeResponse, UpgradeNotebookRuntimeOperationMetadata>
+ upgradeNotebookRuntimeAsync(String name) {
+ UpgradeNotebookRuntimeRequest request =
+ UpgradeNotebookRuntimeRequest.newBuilder().setName(name).build();
+ return upgradeNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Upgrades a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * UpgradeNotebookRuntimeRequest request =
+ * UpgradeNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * UpgradeNotebookRuntimeResponse response =
+ * notebookServiceClient.upgradeNotebookRuntimeAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture<
+ UpgradeNotebookRuntimeResponse, UpgradeNotebookRuntimeOperationMetadata>
+ upgradeNotebookRuntimeAsync(UpgradeNotebookRuntimeRequest request) {
+ return upgradeNotebookRuntimeOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Upgrades a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * UpgradeNotebookRuntimeRequest request =
+ * UpgradeNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * OperationFuture
+ * future =
+ * notebookServiceClient.upgradeNotebookRuntimeOperationCallable().futureCall(request);
+ * // Do something.
+ * UpgradeNotebookRuntimeResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ UpgradeNotebookRuntimeRequest,
+ UpgradeNotebookRuntimeResponse,
+ UpgradeNotebookRuntimeOperationMetadata>
+ upgradeNotebookRuntimeOperationCallable() {
+ return stub.upgradeNotebookRuntimeOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Upgrades a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * UpgradeNotebookRuntimeRequest request =
+ * UpgradeNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.upgradeNotebookRuntimeCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ upgradeNotebookRuntimeCallable() {
+ return stub.upgradeNotebookRuntimeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Starts a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * NotebookRuntimeName name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]");
+ * StartNotebookRuntimeResponse response =
+ * notebookServiceClient.startNotebookRuntimeAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource to be started. Instead of
+ * checking whether the name is in valid NotebookRuntime resource name format, directly throw
+ * NotFound exception if there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ startNotebookRuntimeAsync(NotebookRuntimeName name) {
+ StartNotebookRuntimeRequest request =
+ StartNotebookRuntimeRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return startNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Starts a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * String name =
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]").toString();
+ * StartNotebookRuntimeResponse response =
+ * notebookServiceClient.startNotebookRuntimeAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the NotebookRuntime resource to be started. Instead of
+ * checking whether the name is in valid NotebookRuntime resource name format, directly throw
+ * NotFound exception if there is no such NotebookRuntime in spanner.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ startNotebookRuntimeAsync(String name) {
+ StartNotebookRuntimeRequest request =
+ StartNotebookRuntimeRequest.newBuilder().setName(name).build();
+ return startNotebookRuntimeAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Starts a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * StartNotebookRuntimeRequest request =
+ * StartNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * StartNotebookRuntimeResponse response =
+ * notebookServiceClient.startNotebookRuntimeAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ startNotebookRuntimeAsync(StartNotebookRuntimeRequest request) {
+ return startNotebookRuntimeOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Starts a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * StartNotebookRuntimeRequest request =
+ * StartNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * OperationFuture future =
+ * notebookServiceClient.startNotebookRuntimeOperationCallable().futureCall(request);
+ * // Do something.
+ * StartNotebookRuntimeResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ StartNotebookRuntimeRequest,
+ StartNotebookRuntimeResponse,
+ StartNotebookRuntimeOperationMetadata>
+ startNotebookRuntimeOperationCallable() {
+ return stub.startNotebookRuntimeOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Starts a NotebookRuntime.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * StartNotebookRuntimeRequest request =
+ * StartNotebookRuntimeRequest.newBuilder()
+ * .setName(
+ * NotebookRuntimeName.of("[PROJECT]", "[LOCATION]", "[NOTEBOOK_RUNTIME]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.startNotebookRuntimeCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ startNotebookRuntimeCallable() {
+ return stub.startNotebookRuntimeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : notebookServiceClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listLocationsPagedCallable() {
+ return stub.listLocationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * notebookServiceClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listLocationsCallable() {
+ return stub.listLocationsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = notebookServiceClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = notebookServiceClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getLocationCallable() {
+ return stub.getLocationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = notebookServiceClient.setIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future = notebookServiceClient.setIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable setIamPolicyCallable() {
+ return stub.setIamPolicyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = notebookServiceClient.getIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture future = notebookServiceClient.getIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getIamPolicyCallable() {
+ return stub.getIamPolicyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * TestIamPermissionsResponse response = notebookServiceClient.testIamPermissions(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * notebookServiceClient.testIamPermissionsCallable().futureCall(request);
+ * // Do something.
+ * TestIamPermissionsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ testIamPermissionsCallable() {
+ return stub.testIamPermissionsCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListNotebookRuntimeTemplatesPagedResponse
+ extends AbstractPagedListResponse<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate,
+ ListNotebookRuntimeTemplatesPage,
+ ListNotebookRuntimeTemplatesFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate>
+ context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListNotebookRuntimeTemplatesPage.createEmptyPage()
+ .createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListNotebookRuntimeTemplatesPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListNotebookRuntimeTemplatesPagedResponse(ListNotebookRuntimeTemplatesPage page) {
+ super(page, ListNotebookRuntimeTemplatesFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListNotebookRuntimeTemplatesPage
+ extends AbstractPage<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate,
+ ListNotebookRuntimeTemplatesPage> {
+
+ private ListNotebookRuntimeTemplatesPage(
+ PageContext<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate>
+ context,
+ ListNotebookRuntimeTemplatesResponse response) {
+ super(context, response);
+ }
+
+ private static ListNotebookRuntimeTemplatesPage createEmptyPage() {
+ return new ListNotebookRuntimeTemplatesPage(null, null);
+ }
+
+ @Override
+ protected ListNotebookRuntimeTemplatesPage createPage(
+ PageContext<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate>
+ context,
+ ListNotebookRuntimeTemplatesResponse response) {
+ return new ListNotebookRuntimeTemplatesPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate>
+ context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListNotebookRuntimeTemplatesFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ NotebookRuntimeTemplate,
+ ListNotebookRuntimeTemplatesPage,
+ ListNotebookRuntimeTemplatesFixedSizeCollection> {
+
+ private ListNotebookRuntimeTemplatesFixedSizeCollection(
+ List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListNotebookRuntimeTemplatesFixedSizeCollection createEmptyCollection() {
+ return new ListNotebookRuntimeTemplatesFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListNotebookRuntimeTemplatesFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListNotebookRuntimeTemplatesFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListNotebookRuntimesPagedResponse
+ extends AbstractPagedListResponse<
+ ListNotebookRuntimesRequest,
+ ListNotebookRuntimesResponse,
+ NotebookRuntime,
+ ListNotebookRuntimesPage,
+ ListNotebookRuntimesFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext
+ context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListNotebookRuntimesPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListNotebookRuntimesPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListNotebookRuntimesPagedResponse(ListNotebookRuntimesPage page) {
+ super(page, ListNotebookRuntimesFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListNotebookRuntimesPage
+ extends AbstractPage<
+ ListNotebookRuntimesRequest,
+ ListNotebookRuntimesResponse,
+ NotebookRuntime,
+ ListNotebookRuntimesPage> {
+
+ private ListNotebookRuntimesPage(
+ PageContext
+ context,
+ ListNotebookRuntimesResponse response) {
+ super(context, response);
+ }
+
+ private static ListNotebookRuntimesPage createEmptyPage() {
+ return new ListNotebookRuntimesPage(null, null);
+ }
+
+ @Override
+ protected ListNotebookRuntimesPage createPage(
+ PageContext
+ context,
+ ListNotebookRuntimesResponse response) {
+ return new ListNotebookRuntimesPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext
+ context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListNotebookRuntimesFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListNotebookRuntimesRequest,
+ ListNotebookRuntimesResponse,
+ NotebookRuntime,
+ ListNotebookRuntimesPage,
+ ListNotebookRuntimesFixedSizeCollection> {
+
+ private ListNotebookRuntimesFixedSizeCollection(
+ List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListNotebookRuntimesFixedSizeCollection createEmptyCollection() {
+ return new ListNotebookRuntimesFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListNotebookRuntimesFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListNotebookRuntimesFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListLocationsPagedResponse
+ extends AbstractPagedListResponse<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListLocationsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListLocationsPagedResponse(ListLocationsPage page) {
+ super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListLocationsPage
+ extends AbstractPage<
+ ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
+
+ private ListLocationsPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ super(context, response);
+ }
+
+ private static ListLocationsPage createEmptyPage() {
+ return new ListLocationsPage(null, null);
+ }
+
+ @Override
+ protected ListLocationsPage createPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ return new ListLocationsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListLocationsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListLocationsFixedSizeCollection createEmptyCollection() {
+ return new ListLocationsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListLocationsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListLocationsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/NotebookServiceSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/NotebookServiceSettings.java
new file mode 100644
index 000000000000..41da68aa4379
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/NotebookServiceSettings.java
@@ -0,0 +1,479 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1;
+
+import static com.google.cloud.aiplatform.v1.NotebookServiceClient.ListLocationsPagedResponse;
+import static com.google.cloud.aiplatform.v1.NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse;
+import static com.google.cloud.aiplatform.v1.NotebookServiceClient.ListNotebookRuntimesPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.aiplatform.v1.stub.NotebookServiceStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link NotebookServiceClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (aiplatform.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of getNotebookRuntimeTemplate to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * NotebookServiceSettings.Builder notebookServiceSettingsBuilder =
+ * NotebookServiceSettings.newBuilder();
+ * notebookServiceSettingsBuilder
+ * .getNotebookRuntimeTemplateSettings()
+ * .setRetrySettings(
+ * notebookServiceSettingsBuilder
+ * .getNotebookRuntimeTemplateSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * NotebookServiceSettings notebookServiceSettings = notebookServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class NotebookServiceSettings extends ClientSettings {
+
+ /** Returns the object with the settings used for calls to createNotebookRuntimeTemplate. */
+ public UnaryCallSettings
+ createNotebookRuntimeTemplateSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .createNotebookRuntimeTemplateSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createNotebookRuntimeTemplate. */
+ public OperationCallSettings<
+ CreateNotebookRuntimeTemplateRequest,
+ NotebookRuntimeTemplate,
+ CreateNotebookRuntimeTemplateOperationMetadata>
+ createNotebookRuntimeTemplateOperationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .createNotebookRuntimeTemplateOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getNotebookRuntimeTemplate. */
+ public UnaryCallSettings
+ getNotebookRuntimeTemplateSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).getNotebookRuntimeTemplateSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listNotebookRuntimeTemplates. */
+ public PagedCallSettings<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ ListNotebookRuntimeTemplatesPagedResponse>
+ listNotebookRuntimeTemplatesSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).listNotebookRuntimeTemplatesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteNotebookRuntimeTemplate. */
+ public UnaryCallSettings
+ deleteNotebookRuntimeTemplateSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .deleteNotebookRuntimeTemplateSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteNotebookRuntimeTemplate. */
+ public OperationCallSettings
+ deleteNotebookRuntimeTemplateOperationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .deleteNotebookRuntimeTemplateOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to assignNotebookRuntime. */
+ public UnaryCallSettings
+ assignNotebookRuntimeSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).assignNotebookRuntimeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to assignNotebookRuntime. */
+ public OperationCallSettings<
+ AssignNotebookRuntimeRequest, NotebookRuntime, AssignNotebookRuntimeOperationMetadata>
+ assignNotebookRuntimeOperationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .assignNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getNotebookRuntime. */
+ public UnaryCallSettings
+ getNotebookRuntimeSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).getNotebookRuntimeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listNotebookRuntimes. */
+ public PagedCallSettings<
+ ListNotebookRuntimesRequest,
+ ListNotebookRuntimesResponse,
+ ListNotebookRuntimesPagedResponse>
+ listNotebookRuntimesSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).listNotebookRuntimesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteNotebookRuntime. */
+ public UnaryCallSettings
+ deleteNotebookRuntimeSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).deleteNotebookRuntimeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteNotebookRuntime. */
+ public OperationCallSettings
+ deleteNotebookRuntimeOperationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .deleteNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to upgradeNotebookRuntime. */
+ public UnaryCallSettings
+ upgradeNotebookRuntimeSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).upgradeNotebookRuntimeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to upgradeNotebookRuntime. */
+ public OperationCallSettings<
+ UpgradeNotebookRuntimeRequest,
+ UpgradeNotebookRuntimeResponse,
+ UpgradeNotebookRuntimeOperationMetadata>
+ upgradeNotebookRuntimeOperationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .upgradeNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to startNotebookRuntime. */
+ public UnaryCallSettings startNotebookRuntimeSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).startNotebookRuntimeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to startNotebookRuntime. */
+ public OperationCallSettings<
+ StartNotebookRuntimeRequest,
+ StartNotebookRuntimeResponse,
+ StartNotebookRuntimeOperationMetadata>
+ startNotebookRuntimeOperationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings())
+ .startNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).listLocationsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).getLocationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to setIamPolicy. */
+ public UnaryCallSettings setIamPolicySettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).setIamPolicySettings();
+ }
+
+ /** Returns the object with the settings used for calls to getIamPolicy. */
+ public UnaryCallSettings getIamPolicySettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).getIamPolicySettings();
+ }
+
+ /** Returns the object with the settings used for calls to testIamPermissions. */
+ public UnaryCallSettings
+ testIamPermissionsSettings() {
+ return ((NotebookServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
+ }
+
+ public static final NotebookServiceSettings create(NotebookServiceStubSettings stub)
+ throws IOException {
+ return new NotebookServiceSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return NotebookServiceStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return NotebookServiceStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return NotebookServiceStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return NotebookServiceStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return NotebookServiceStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return NotebookServiceStubSettings.defaultTransportChannelProvider();
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return NotebookServiceStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected NotebookServiceSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for NotebookServiceSettings. */
+ public static class Builder extends ClientSettings.Builder {
+
+ protected Builder() throws IOException {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(NotebookServiceStubSettings.newBuilder(clientContext));
+ }
+
+ protected Builder(NotebookServiceSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(NotebookServiceStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ private static Builder createDefault() {
+ return new Builder(NotebookServiceStubSettings.newBuilder());
+ }
+
+ public NotebookServiceStubSettings.Builder getStubSettingsBuilder() {
+ return ((NotebookServiceStubSettings.Builder) getStubSettings());
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createNotebookRuntimeTemplate. */
+ public UnaryCallSettings.Builder
+ createNotebookRuntimeTemplateSettings() {
+ return getStubSettingsBuilder().createNotebookRuntimeTemplateSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createNotebookRuntimeTemplate. */
+ public OperationCallSettings.Builder<
+ CreateNotebookRuntimeTemplateRequest,
+ NotebookRuntimeTemplate,
+ CreateNotebookRuntimeTemplateOperationMetadata>
+ createNotebookRuntimeTemplateOperationSettings() {
+ return getStubSettingsBuilder().createNotebookRuntimeTemplateOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getNotebookRuntimeTemplate. */
+ public UnaryCallSettings.Builder
+ getNotebookRuntimeTemplateSettings() {
+ return getStubSettingsBuilder().getNotebookRuntimeTemplateSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listNotebookRuntimeTemplates. */
+ public PagedCallSettings.Builder<
+ ListNotebookRuntimeTemplatesRequest,
+ ListNotebookRuntimeTemplatesResponse,
+ ListNotebookRuntimeTemplatesPagedResponse>
+ listNotebookRuntimeTemplatesSettings() {
+ return getStubSettingsBuilder().listNotebookRuntimeTemplatesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteNotebookRuntimeTemplate. */
+ public UnaryCallSettings.Builder
+ deleteNotebookRuntimeTemplateSettings() {
+ return getStubSettingsBuilder().deleteNotebookRuntimeTemplateSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteNotebookRuntimeTemplate. */
+ public OperationCallSettings.Builder<
+ DeleteNotebookRuntimeTemplateRequest, Empty, DeleteOperationMetadata>
+ deleteNotebookRuntimeTemplateOperationSettings() {
+ return getStubSettingsBuilder().deleteNotebookRuntimeTemplateOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to assignNotebookRuntime. */
+ public UnaryCallSettings.Builder
+ assignNotebookRuntimeSettings() {
+ return getStubSettingsBuilder().assignNotebookRuntimeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to assignNotebookRuntime. */
+ public OperationCallSettings.Builder<
+ AssignNotebookRuntimeRequest, NotebookRuntime, AssignNotebookRuntimeOperationMetadata>
+ assignNotebookRuntimeOperationSettings() {
+ return getStubSettingsBuilder().assignNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getNotebookRuntime. */
+ public UnaryCallSettings.Builder
+ getNotebookRuntimeSettings() {
+ return getStubSettingsBuilder().getNotebookRuntimeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listNotebookRuntimes. */
+ public PagedCallSettings.Builder<
+ ListNotebookRuntimesRequest,
+ ListNotebookRuntimesResponse,
+ ListNotebookRuntimesPagedResponse>
+ listNotebookRuntimesSettings() {
+ return getStubSettingsBuilder().listNotebookRuntimesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteNotebookRuntime. */
+ public UnaryCallSettings.Builder
+ deleteNotebookRuntimeSettings() {
+ return getStubSettingsBuilder().deleteNotebookRuntimeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteNotebookRuntime. */
+ public OperationCallSettings.Builder<
+ DeleteNotebookRuntimeRequest, Empty, DeleteOperationMetadata>
+ deleteNotebookRuntimeOperationSettings() {
+ return getStubSettingsBuilder().deleteNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to upgradeNotebookRuntime. */
+ public UnaryCallSettings.Builder
+ upgradeNotebookRuntimeSettings() {
+ return getStubSettingsBuilder().upgradeNotebookRuntimeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to upgradeNotebookRuntime. */
+ public OperationCallSettings.Builder<
+ UpgradeNotebookRuntimeRequest,
+ UpgradeNotebookRuntimeResponse,
+ UpgradeNotebookRuntimeOperationMetadata>
+ upgradeNotebookRuntimeOperationSettings() {
+ return getStubSettingsBuilder().upgradeNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to startNotebookRuntime. */
+ public UnaryCallSettings.Builder
+ startNotebookRuntimeSettings() {
+ return getStubSettingsBuilder().startNotebookRuntimeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to startNotebookRuntime. */
+ public OperationCallSettings.Builder<
+ StartNotebookRuntimeRequest,
+ StartNotebookRuntimeResponse,
+ StartNotebookRuntimeOperationMetadata>
+ startNotebookRuntimeOperationSettings() {
+ return getStubSettingsBuilder().startNotebookRuntimeOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return getStubSettingsBuilder().listLocationsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getStubSettingsBuilder().getLocationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to setIamPolicy. */
+ public UnaryCallSettings.Builder setIamPolicySettings() {
+ return getStubSettingsBuilder().setIamPolicySettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getIamPolicy. */
+ public UnaryCallSettings.Builder getIamPolicySettings() {
+ return getStubSettingsBuilder().getIamPolicySettings();
+ }
+
+ /** Returns the builder for the settings used for calls to testIamPermissions. */
+ public UnaryCallSettings.Builder
+ testIamPermissionsSettings() {
+ return getStubSettingsBuilder().testIamPermissionsSettings();
+ }
+
+ @Override
+ public NotebookServiceSettings build() throws IOException {
+ return new NotebookServiceSettings(this);
+ }
+ }
+}
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/PersistentResourceServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/PersistentResourceServiceClient.java
new file mode 100644
index 000000000000..5969ec329d7d
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/PersistentResourceServiceClient.java
@@ -0,0 +1,1917 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1;
+
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.aiplatform.v1.stub.PersistentResourceServiceStub;
+import com.google.cloud.aiplatform.v1.stub.PersistentResourceServiceStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.longrunning.OperationsClient;
+import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: A service for managing Vertex AI's machine learning PersistentResource.
+ *
+ * This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * PersistentResourceName name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]");
+ * PersistentResource response = persistentResourceServiceClient.getPersistentResource(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the PersistentResourceServiceClient object to clean up
+ * resources such as threads. In the example above, try-with-resources is used, which automatically
+ * calls close().
+ *
+ *
+ * Methods
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ * CreatePersistentResource
+ * Creates a PersistentResource.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * createPersistentResourceAsync(CreatePersistentResourceRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * createPersistentResourceAsync(LocationName parent, PersistentResource persistentResource, String persistentResourceId)
+ *
createPersistentResourceAsync(String parent, PersistentResource persistentResource, String persistentResourceId)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * createPersistentResourceOperationCallable()
+ *
createPersistentResourceCallable()
+ *
+ *
+ *
+ *
+ * GetPersistentResource
+ * Gets a PersistentResource.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getPersistentResource(GetPersistentResourceRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * getPersistentResource(PersistentResourceName name)
+ *
getPersistentResource(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getPersistentResourceCallable()
+ *
+ *
+ *
+ *
+ * ListPersistentResources
+ * Lists PersistentResources in a Location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listPersistentResources(ListPersistentResourcesRequest request)
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * listPersistentResources(LocationName parent)
+ *
listPersistentResources(String parent)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listPersistentResourcesPagedCallable()
+ *
listPersistentResourcesCallable()
+ *
+ *
+ *
+ *
+ * DeletePersistentResource
+ * Deletes a PersistentResource.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * deletePersistentResourceAsync(DeletePersistentResourceRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * deletePersistentResourceAsync(PersistentResourceName name)
+ *
deletePersistentResourceAsync(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * deletePersistentResourceOperationCallable()
+ *
deletePersistentResourceCallable()
+ *
+ *
+ *
+ *
+ * UpdatePersistentResource
+ * Updates a PersistentResource.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * updatePersistentResourceAsync(UpdatePersistentResourceRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * updatePersistentResourceAsync(PersistentResource persistentResource, FieldMask updateMask)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * updatePersistentResourceOperationCallable()
+ *
updatePersistentResourceCallable()
+ *
+ *
+ *
+ *
+ * RebootPersistentResource
+ * Reboots a PersistentResource.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * rebootPersistentResourceAsync(RebootPersistentResourceRequest request)
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * rebootPersistentResourceAsync(PersistentResourceName name)
+ *
rebootPersistentResourceAsync(String name)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * rebootPersistentResourceOperationCallable()
+ *
rebootPersistentResourceCallable()
+ *
+ *
+ *
+ *
+ * ListLocations
+ * Lists information about the supported locations for this service.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * listLocations(ListLocationsRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * listLocationsPagedCallable()
+ *
listLocationsCallable()
+ *
+ *
+ *
+ *
+ * GetLocation
+ * Gets information about a location.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getLocation(GetLocationRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getLocationCallable()
+ *
+ *
+ *
+ *
+ * SetIamPolicy
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * setIamPolicy(SetIamPolicyRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * setIamPolicyCallable()
+ *
+ *
+ *
+ *
+ * GetIamPolicy
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * getIamPolicy(GetIamPolicyRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getIamPolicyCallable()
+ *
+ *
+ *
+ *
+ * TestIamPermissions
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * testIamPermissions(TestIamPermissionsRequest request)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * testIamPermissionsCallable()
+ *
+ *
+ *
+ *
+ *
+ * See the individual methods for example code.
+ *
+ *
Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ *
This class can be customized by passing in a custom instance of
+ * PersistentResourceServiceSettings to create(). For example:
+ *
+ *
To customize credentials:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PersistentResourceServiceSettings persistentResourceServiceSettings =
+ * PersistentResourceServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create(persistentResourceServiceSettings);
+ * }
+ *
+ * To customize the endpoint:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PersistentResourceServiceSettings persistentResourceServiceSettings =
+ * PersistentResourceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create(persistentResourceServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class PersistentResourceServiceClient implements BackgroundResource {
+ private final PersistentResourceServiceSettings settings;
+ private final PersistentResourceServiceStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of PersistentResourceServiceClient with default settings. */
+ public static final PersistentResourceServiceClient create() throws IOException {
+ return create(PersistentResourceServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of PersistentResourceServiceClient, using the given settings. The
+ * channels are created based on the settings passed in, or defaults for any settings that are not
+ * set.
+ */
+ public static final PersistentResourceServiceClient create(
+ PersistentResourceServiceSettings settings) throws IOException {
+ return new PersistentResourceServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of PersistentResourceServiceClient, using the given stub for making
+ * calls. This is for advanced usage - prefer using create(PersistentResourceServiceSettings).
+ */
+ public static final PersistentResourceServiceClient create(PersistentResourceServiceStub stub) {
+ return new PersistentResourceServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of PersistentResourceServiceClient, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected PersistentResourceServiceClient(PersistentResourceServiceSettings settings)
+ throws IOException {
+ this.settings = settings;
+ this.stub = ((PersistentResourceServiceStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ protected PersistentResourceServiceClient(PersistentResourceServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final PersistentResourceServiceSettings getSettings() {
+ return settings;
+ }
+
+ public PersistentResourceServiceStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a PersistentResource.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * PersistentResource persistentResource = PersistentResource.newBuilder().build();
+ * String persistentResourceId = "persistentResourceId-2123080768";
+ * PersistentResource response =
+ * persistentResourceServiceClient
+ * .createPersistentResourceAsync(parent, persistentResource, persistentResourceId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the PersistentResource in.
+ * Format: `projects/{project}/locations/{location}`
+ * @param persistentResource Required. The PersistentResource to create.
+ * @param persistentResourceId Required. The ID to use for the PersistentResource, which become
+ * the final component of the PersistentResource's resource name.
+ * The maximum length is 63 characters, and valid characters are
+ * `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ createPersistentResourceAsync(
+ LocationName parent, PersistentResource persistentResource, String persistentResourceId) {
+ CreatePersistentResourceRequest request =
+ CreatePersistentResourceRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setPersistentResource(persistentResource)
+ .setPersistentResourceId(persistentResourceId)
+ .build();
+ return createPersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * PersistentResource persistentResource = PersistentResource.newBuilder().build();
+ * String persistentResourceId = "persistentResourceId-2123080768";
+ * PersistentResource response =
+ * persistentResourceServiceClient
+ * .createPersistentResourceAsync(parent, persistentResource, persistentResourceId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to create the PersistentResource in.
+ * Format: `projects/{project}/locations/{location}`
+ * @param persistentResource Required. The PersistentResource to create.
+ * @param persistentResourceId Required. The ID to use for the PersistentResource, which become
+ * the final component of the PersistentResource's resource name.
+ * The maximum length is 63 characters, and valid characters are
+ * `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ createPersistentResourceAsync(
+ String parent, PersistentResource persistentResource, String persistentResourceId) {
+ CreatePersistentResourceRequest request =
+ CreatePersistentResourceRequest.newBuilder()
+ .setParent(parent)
+ .setPersistentResource(persistentResource)
+ .setPersistentResourceId(persistentResourceId)
+ .build();
+ return createPersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * CreatePersistentResourceRequest request =
+ * CreatePersistentResourceRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPersistentResource(PersistentResource.newBuilder().build())
+ * .setPersistentResourceId("persistentResourceId-2123080768")
+ * .build();
+ * PersistentResource response =
+ * persistentResourceServiceClient.createPersistentResourceAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ createPersistentResourceAsync(CreatePersistentResourceRequest request) {
+ return createPersistentResourceOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * CreatePersistentResourceRequest request =
+ * CreatePersistentResourceRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPersistentResource(PersistentResource.newBuilder().build())
+ * .setPersistentResourceId("persistentResourceId-2123080768")
+ * .build();
+ * OperationFuture future =
+ * persistentResourceServiceClient
+ * .createPersistentResourceOperationCallable()
+ * .futureCall(request);
+ * // Do something.
+ * PersistentResource response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ CreatePersistentResourceRequest,
+ PersistentResource,
+ CreatePersistentResourceOperationMetadata>
+ createPersistentResourceOperationCallable() {
+ return stub.createPersistentResourceOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * CreatePersistentResourceRequest request =
+ * CreatePersistentResourceRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPersistentResource(PersistentResource.newBuilder().build())
+ * .setPersistentResourceId("persistentResourceId-2123080768")
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.createPersistentResourceCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ createPersistentResourceCallable() {
+ return stub.createPersistentResourceCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * PersistentResourceName name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]");
+ * PersistentResource response = persistentResourceServiceClient.getPersistentResource(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the PersistentResource resource. Format:
+ * `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PersistentResource getPersistentResource(PersistentResourceName name) {
+ GetPersistentResourceRequest request =
+ GetPersistentResourceRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getPersistentResource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * String name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]").toString();
+ * PersistentResource response = persistentResourceServiceClient.getPersistentResource(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the PersistentResource resource. Format:
+ * `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PersistentResource getPersistentResource(String name) {
+ GetPersistentResourceRequest request =
+ GetPersistentResourceRequest.newBuilder().setName(name).build();
+ return getPersistentResource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * GetPersistentResourceRequest request =
+ * GetPersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * PersistentResource response = persistentResourceServiceClient.getPersistentResource(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PersistentResource getPersistentResource(GetPersistentResourceRequest request) {
+ return getPersistentResourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * GetPersistentResourceRequest request =
+ * GetPersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.getPersistentResourceCallable().futureCall(request);
+ * // Do something.
+ * PersistentResource response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ getPersistentResourceCallable() {
+ return stub.getPersistentResourceCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PersistentResources in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (PersistentResource element :
+ * persistentResourceServiceClient.listPersistentResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to list the PersistentResources from.
+ * Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPersistentResourcesPagedResponse listPersistentResources(LocationName parent) {
+ ListPersistentResourcesRequest request =
+ ListPersistentResourcesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listPersistentResources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PersistentResources in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (PersistentResource element :
+ * persistentResourceServiceClient.listPersistentResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the Location to list the PersistentResources from.
+ * Format: `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPersistentResourcesPagedResponse listPersistentResources(String parent) {
+ ListPersistentResourcesRequest request =
+ ListPersistentResourcesRequest.newBuilder().setParent(parent).build();
+ return listPersistentResources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PersistentResources in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * ListPersistentResourcesRequest request =
+ * ListPersistentResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (PersistentResource element :
+ * persistentResourceServiceClient.listPersistentResources(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPersistentResourcesPagedResponse listPersistentResources(
+ ListPersistentResourcesRequest request) {
+ return listPersistentResourcesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PersistentResources in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * ListPersistentResourcesRequest request =
+ * ListPersistentResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient
+ * .listPersistentResourcesPagedCallable()
+ * .futureCall(request);
+ * // Do something.
+ * for (PersistentResource element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listPersistentResourcesPagedCallable() {
+ return stub.listPersistentResourcesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PersistentResources in a Location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * ListPersistentResourcesRequest request =
+ * ListPersistentResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListPersistentResourcesResponse response =
+ * persistentResourceServiceClient.listPersistentResourcesCallable().call(request);
+ * for (PersistentResource element : response.getPersistentResourcesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listPersistentResourcesCallable() {
+ return stub.listPersistentResourcesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * PersistentResourceName name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]");
+ * persistentResourceServiceClient.deletePersistentResourceAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PersistentResource to be deleted. Format:
+ * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deletePersistentResourceAsync(
+ PersistentResourceName name) {
+ DeletePersistentResourceRequest request =
+ DeletePersistentResourceRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return deletePersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * String name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]").toString();
+ * persistentResourceServiceClient.deletePersistentResourceAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PersistentResource to be deleted. Format:
+ * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deletePersistentResourceAsync(
+ String name) {
+ DeletePersistentResourceRequest request =
+ DeletePersistentResourceRequest.newBuilder().setName(name).build();
+ return deletePersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * DeletePersistentResourceRequest request =
+ * DeletePersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * persistentResourceServiceClient.deletePersistentResourceAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deletePersistentResourceAsync(
+ DeletePersistentResourceRequest request) {
+ return deletePersistentResourceOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * DeletePersistentResourceRequest request =
+ * DeletePersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * OperationFuture future =
+ * persistentResourceServiceClient
+ * .deletePersistentResourceOperationCallable()
+ * .futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ deletePersistentResourceOperationCallable() {
+ return stub.deletePersistentResourceOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * DeletePersistentResourceRequest request =
+ * DeletePersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.deletePersistentResourceCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ deletePersistentResourceCallable() {
+ return stub.deletePersistentResourceCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * PersistentResource persistentResource = PersistentResource.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * PersistentResource response =
+ * persistentResourceServiceClient
+ * .updatePersistentResourceAsync(persistentResource, updateMask)
+ * .get();
+ * }
+ * }
+ *
+ * @param persistentResource Required. The PersistentResource to update.
+ * The PersistentResource's `name` field is used to identify the PersistentResource to
+ * update. Format:
+ * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}`
+ * @param updateMask Required. Specify the fields to be overwritten in the PersistentResource by
+ * the update method.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ updatePersistentResourceAsync(PersistentResource persistentResource, FieldMask updateMask) {
+ UpdatePersistentResourceRequest request =
+ UpdatePersistentResourceRequest.newBuilder()
+ .setPersistentResource(persistentResource)
+ .setUpdateMask(updateMask)
+ .build();
+ return updatePersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * UpdatePersistentResourceRequest request =
+ * UpdatePersistentResourceRequest.newBuilder()
+ * .setPersistentResource(PersistentResource.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * PersistentResource response =
+ * persistentResourceServiceClient.updatePersistentResourceAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ updatePersistentResourceAsync(UpdatePersistentResourceRequest request) {
+ return updatePersistentResourceOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * UpdatePersistentResourceRequest request =
+ * UpdatePersistentResourceRequest.newBuilder()
+ * .setPersistentResource(PersistentResource.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * persistentResourceServiceClient
+ * .updatePersistentResourceOperationCallable()
+ * .futureCall(request);
+ * // Do something.
+ * PersistentResource response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ UpdatePersistentResourceRequest,
+ PersistentResource,
+ UpdatePersistentResourceOperationMetadata>
+ updatePersistentResourceOperationCallable() {
+ return stub.updatePersistentResourceOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * UpdatePersistentResourceRequest request =
+ * UpdatePersistentResourceRequest.newBuilder()
+ * .setPersistentResource(PersistentResource.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.updatePersistentResourceCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ updatePersistentResourceCallable() {
+ return stub.updatePersistentResourceCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reboots a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * PersistentResourceName name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]");
+ * PersistentResource response =
+ * persistentResourceServiceClient.rebootPersistentResourceAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PersistentResource resource. Format:
+ * `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ rebootPersistentResourceAsync(PersistentResourceName name) {
+ RebootPersistentResourceRequest request =
+ RebootPersistentResourceRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return rebootPersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reboots a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * String name =
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]").toString();
+ * PersistentResource response =
+ * persistentResourceServiceClient.rebootPersistentResourceAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PersistentResource resource. Format:
+ * `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ rebootPersistentResourceAsync(String name) {
+ RebootPersistentResourceRequest request =
+ RebootPersistentResourceRequest.newBuilder().setName(name).build();
+ return rebootPersistentResourceAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reboots a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * RebootPersistentResourceRequest request =
+ * RebootPersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * PersistentResource response =
+ * persistentResourceServiceClient.rebootPersistentResourceAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture
+ rebootPersistentResourceAsync(RebootPersistentResourceRequest request) {
+ return rebootPersistentResourceOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reboots a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * RebootPersistentResourceRequest request =
+ * RebootPersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * OperationFuture future =
+ * persistentResourceServiceClient
+ * .rebootPersistentResourceOperationCallable()
+ * .futureCall(request);
+ * // Do something.
+ * PersistentResource response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable<
+ RebootPersistentResourceRequest,
+ PersistentResource,
+ RebootPersistentResourceOperationMetadata>
+ rebootPersistentResourceOperationCallable() {
+ return stub.rebootPersistentResourceOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reboots a PersistentResource.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * RebootPersistentResourceRequest request =
+ * RebootPersistentResourceRequest.newBuilder()
+ * .setName(
+ * PersistentResourceName.of("[PROJECT]", "[LOCATION]", "[PERSISTENT_RESOURCE]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.rebootPersistentResourceCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ rebootPersistentResourceCallable() {
+ return stub.rebootPersistentResourceCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : persistentResourceServiceClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listLocationsPagedCallable() {
+ return stub.listLocationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * persistentResourceServiceClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listLocationsCallable() {
+ return stub.listLocationsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = persistentResourceServiceClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getLocationCallable() {
+ return stub.getLocationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = persistentResourceServiceClient.setIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.setIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable setIamPolicyCallable() {
+ return stub.setIamPolicyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = persistentResourceServiceClient.getIamPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.getIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getIamPolicyCallable() {
+ return stub.getIamPolicyCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * TestIamPermissionsResponse response =
+ * persistentResourceServiceClient.testIamPermissions(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns permissions that a caller has on the specified resource. If theresource does not exist,
+ * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
+ *
+ * Note: This operation is designed to be used for buildingpermission-aware UIs and
+ * command-line tools, not for authorizationchecking. This operation may "fail open" without
+ * warning.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PersistentResourceServiceClient persistentResourceServiceClient =
+ * PersistentResourceServiceClient.create()) {
+ * TestIamPermissionsRequest request =
+ * TestIamPermissionsRequest.newBuilder()
+ * .setResource(
+ * EndpointName.ofProjectLocationEndpointName(
+ * "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+ * .toString())
+ * .addAllPermissions(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * persistentResourceServiceClient.testIamPermissionsCallable().futureCall(request);
+ * // Do something.
+ * TestIamPermissionsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable
+ testIamPermissionsCallable() {
+ return stub.testIamPermissionsCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListPersistentResourcesPagedResponse
+ extends AbstractPagedListResponse<
+ ListPersistentResourcesRequest,
+ ListPersistentResourcesResponse,
+ PersistentResource,
+ ListPersistentResourcesPage,
+ ListPersistentResourcesFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext<
+ ListPersistentResourcesRequest, ListPersistentResourcesResponse, PersistentResource>
+ context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListPersistentResourcesPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListPersistentResourcesPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListPersistentResourcesPagedResponse(ListPersistentResourcesPage page) {
+ super(page, ListPersistentResourcesFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListPersistentResourcesPage
+ extends AbstractPage<
+ ListPersistentResourcesRequest,
+ ListPersistentResourcesResponse,
+ PersistentResource,
+ ListPersistentResourcesPage> {
+
+ private ListPersistentResourcesPage(
+ PageContext<
+ ListPersistentResourcesRequest, ListPersistentResourcesResponse, PersistentResource>
+ context,
+ ListPersistentResourcesResponse response) {
+ super(context, response);
+ }
+
+ private static ListPersistentResourcesPage createEmptyPage() {
+ return new ListPersistentResourcesPage(null, null);
+ }
+
+ @Override
+ protected ListPersistentResourcesPage createPage(
+ PageContext<
+ ListPersistentResourcesRequest, ListPersistentResourcesResponse, PersistentResource>
+ context,
+ ListPersistentResourcesResponse response) {
+ return new ListPersistentResourcesPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext<
+ ListPersistentResourcesRequest, ListPersistentResourcesResponse, PersistentResource>
+ context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListPersistentResourcesFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListPersistentResourcesRequest,
+ ListPersistentResourcesResponse,
+ PersistentResource,
+ ListPersistentResourcesPage,
+ ListPersistentResourcesFixedSizeCollection> {
+
+ private ListPersistentResourcesFixedSizeCollection(
+ List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListPersistentResourcesFixedSizeCollection createEmptyCollection() {
+ return new ListPersistentResourcesFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListPersistentResourcesFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListPersistentResourcesFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListLocationsPagedResponse
+ extends AbstractPagedListResponse<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListLocationsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListLocationsPagedResponse(ListLocationsPage page) {
+ super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListLocationsPage
+ extends AbstractPage<
+ ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
+
+ private ListLocationsPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ super(context, response);
+ }
+
+ private static ListLocationsPage createEmptyPage() {
+ return new ListLocationsPage(null, null);
+ }
+
+ @Override
+ protected ListLocationsPage createPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ return new ListLocationsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListLocationsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListLocationsFixedSizeCollection createEmptyCollection() {
+ return new ListLocationsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListLocationsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListLocationsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/PersistentResourceServiceSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/PersistentResourceServiceSettings.java
new file mode 100644
index 000000000000..3508cbb1bdf6
--- /dev/null
+++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/PersistentResourceServiceSettings.java
@@ -0,0 +1,403 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.aiplatform.v1;
+
+import static com.google.cloud.aiplatform.v1.PersistentResourceServiceClient.ListLocationsPagedResponse;
+import static com.google.cloud.aiplatform.v1.PersistentResourceServiceClient.ListPersistentResourcesPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.aiplatform.v1.stub.PersistentResourceServiceStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link PersistentResourceServiceClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (aiplatform.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of getPersistentResource to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * PersistentResourceServiceSettings.Builder persistentResourceServiceSettingsBuilder =
+ * PersistentResourceServiceSettings.newBuilder();
+ * persistentResourceServiceSettingsBuilder
+ * .getPersistentResourceSettings()
+ * .setRetrySettings(
+ * persistentResourceServiceSettingsBuilder
+ * .getPersistentResourceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * PersistentResourceServiceSettings persistentResourceServiceSettings =
+ * persistentResourceServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class PersistentResourceServiceSettings
+ extends ClientSettings {
+
+ /** Returns the object with the settings used for calls to createPersistentResource. */
+ public UnaryCallSettings
+ createPersistentResourceSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .createPersistentResourceSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createPersistentResource. */
+ public OperationCallSettings<
+ CreatePersistentResourceRequest,
+ PersistentResource,
+ CreatePersistentResourceOperationMetadata>
+ createPersistentResourceOperationSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .createPersistentResourceOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getPersistentResource. */
+ public UnaryCallSettings
+ getPersistentResourceSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .getPersistentResourceSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listPersistentResources. */
+ public PagedCallSettings<
+ ListPersistentResourcesRequest,
+ ListPersistentResourcesResponse,
+ ListPersistentResourcesPagedResponse>
+ listPersistentResourcesSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .listPersistentResourcesSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deletePersistentResource. */
+ public UnaryCallSettings
+ deletePersistentResourceSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .deletePersistentResourceSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deletePersistentResource. */
+ public OperationCallSettings
+ deletePersistentResourceOperationSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .deletePersistentResourceOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updatePersistentResource. */
+ public UnaryCallSettings
+ updatePersistentResourceSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .updatePersistentResourceSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updatePersistentResource. */
+ public OperationCallSettings<
+ UpdatePersistentResourceRequest,
+ PersistentResource,
+ UpdatePersistentResourceOperationMetadata>
+ updatePersistentResourceOperationSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .updatePersistentResourceOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to rebootPersistentResource. */
+ public UnaryCallSettings
+ rebootPersistentResourceSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .rebootPersistentResourceSettings();
+ }
+
+ /** Returns the object with the settings used for calls to rebootPersistentResource. */
+ public OperationCallSettings<
+ RebootPersistentResourceRequest,
+ PersistentResource,
+ RebootPersistentResourceOperationMetadata>
+ rebootPersistentResourceOperationSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings())
+ .rebootPersistentResourceOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings()).listLocationsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings()).getLocationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to setIamPolicy. */
+ public UnaryCallSettings setIamPolicySettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings()).setIamPolicySettings();
+ }
+
+ /** Returns the object with the settings used for calls to getIamPolicy. */
+ public UnaryCallSettings getIamPolicySettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings()).getIamPolicySettings();
+ }
+
+ /** Returns the object with the settings used for calls to testIamPermissions. */
+ public UnaryCallSettings
+ testIamPermissionsSettings() {
+ return ((PersistentResourceServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
+ }
+
+ public static final PersistentResourceServiceSettings create(
+ PersistentResourceServiceStubSettings stub) throws IOException {
+ return new PersistentResourceServiceSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return PersistentResourceServiceStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return PersistentResourceServiceStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return PersistentResourceServiceStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return PersistentResourceServiceStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return PersistentResourceServiceStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return PersistentResourceServiceStubSettings.defaultTransportChannelProvider();
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return PersistentResourceServiceStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected PersistentResourceServiceSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for PersistentResourceServiceSettings. */
+ public static class Builder
+ extends ClientSettings.Builder {
+
+ protected Builder() throws IOException {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(PersistentResourceServiceStubSettings.newBuilder(clientContext));
+ }
+
+ protected Builder(PersistentResourceServiceSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(PersistentResourceServiceStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ private static Builder createDefault() {
+ return new Builder(PersistentResourceServiceStubSettings.newBuilder());
+ }
+
+ public PersistentResourceServiceStubSettings.Builder getStubSettingsBuilder() {
+ return ((PersistentResourceServiceStubSettings.Builder) getStubSettings());
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createPersistentResource. */
+ public UnaryCallSettings.Builder
+ createPersistentResourceSettings() {
+ return getStubSettingsBuilder().createPersistentResourceSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createPersistentResource. */
+ public OperationCallSettings.Builder<
+ CreatePersistentResourceRequest,
+ PersistentResource,
+ CreatePersistentResourceOperationMetadata>
+ createPersistentResourceOperationSettings() {
+ return getStubSettingsBuilder().createPersistentResourceOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getPersistentResource. */
+ public UnaryCallSettings.Builder
+ getPersistentResourceSettings() {
+ return getStubSettingsBuilder().getPersistentResourceSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listPersistentResources. */
+ public PagedCallSettings.Builder<
+ ListPersistentResourcesRequest,
+ ListPersistentResourcesResponse,
+ ListPersistentResourcesPagedResponse>
+ listPersistentResourcesSettings() {
+ return getStubSettingsBuilder().listPersistentResourcesSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deletePersistentResource. */
+ public UnaryCallSettings.Builder
+ deletePersistentResourceSettings() {
+ return getStubSettingsBuilder().deletePersistentResourceSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deletePersistentResource. */
+ public OperationCallSettings.Builder<
+ DeletePersistentResourceRequest, Empty, DeleteOperationMetadata>
+ deletePersistentResourceOperationSettings() {
+ return getStubSettingsBuilder().deletePersistentResourceOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updatePersistentResource. */
+ public UnaryCallSettings.Builder
+ updatePersistentResourceSettings() {
+ return getStubSettingsBuilder().updatePersistentResourceSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updatePersistentResource. */
+ public OperationCallSettings.Builder<
+ UpdatePersistentResourceRequest,
+ PersistentResource,
+ UpdatePersistentResourceOperationMetadata>
+ updatePersistentResourceOperationSettings() {
+ return getStubSettingsBuilder().updatePersistentResourceOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to rebootPersistentResource. */
+ public UnaryCallSettings.Builder
+ rebootPersistentResourceSettings() {
+ return getStubSettingsBuilder().rebootPersistentResourceSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to rebootPersistentResource. */
+ public OperationCallSettings.Builder<
+ RebootPersistentResourceRequest,
+ PersistentResource,
+ RebootPersistentResourceOperationMetadata>
+ rebootPersistentResourceOperationSettings() {
+ return getStubSettingsBuilder().rebootPersistentResourceOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return getStubSettingsBuilder().listLocationsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getStubSettingsBuilder().getLocationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to setIamPolicy. */
+ public UnaryCallSettings.Builder setIamPolicySettings() {
+ return getStubSettingsBuilder().setIamPolicySettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getIamPolicy. */
+ public UnaryCallSettings.Builder