Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [aiplatform] add is_default to Tensorboard in aiplatform v1 tensorboard.proto and v1beta1 tensorboard.proto #9355

Merged
merged 4 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions java-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.12.0</version>
<version>26.13.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -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.15.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-aiplatform/3.16.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void createTensorboardTest() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -184,6 +185,7 @@ public void createTensorboardTest2() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -242,6 +244,7 @@ public void getTensorboardTest() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
mockTensorboardService.addResponse(expectedResponse);

Expand Down Expand Up @@ -289,6 +292,7 @@ public void getTensorboardTest2() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
mockTensorboardService.addResponse(expectedResponse);

Expand Down Expand Up @@ -416,6 +420,7 @@ public void updateTensorboardTest() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void createTensorboardTest() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -184,6 +185,7 @@ public void createTensorboardTest2() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -242,6 +244,7 @@ public void getTensorboardTest() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
mockTensorboardService.addResponse(expectedResponse);

Expand Down Expand Up @@ -289,6 +292,7 @@ public void getTensorboardTest2() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
mockTensorboardService.addResponse(expectedResponse);

Expand Down Expand Up @@ -416,6 +420,7 @@ public void updateTensorboardTest() throws Exception {
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.setEtag("etag3123477")
.setIsDefault(true)
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,28 @@ public com.google.protobuf.ByteString getEtagBytes() {
}
}

public static final int IS_DEFAULT_FIELD_NUMBER = 12;
private boolean isDefault_ = false;
/**
*
*
* <pre>
* Used to indicate if the TensorBoard instance is the default one.
* Each project &amp; region can have at most one default TensorBoard instance.
* Creation of a default TensorBoard instance and updating an existing
* TensorBoard instance to be default will mark all other TensorBoard
* instances (if any) as non default.
* </pre>
*
* <code>bool is_default = 12;</code>
*
* @return The isDefault.
*/
@java.lang.Override
public boolean getIsDefault() {
return isDefault_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -696,6 +718,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (encryptionSpec_ != null) {
output.writeMessage(11, getEncryptionSpec());
}
if (isDefault_ != false) {
output.writeBool(12, isDefault_);
}
getUnknownFields().writeTo(output);
}

Expand Down Expand Up @@ -742,6 +767,9 @@ public int getSerializedSize() {
if (encryptionSpec_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getEncryptionSpec());
}
if (isDefault_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, isDefault_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand Down Expand Up @@ -777,6 +805,7 @@ public boolean equals(final java.lang.Object obj) {
}
if (!internalGetLabels().equals(other.internalGetLabels())) return false;
if (!getEtag().equals(other.getEtag())) return false;
if (getIsDefault() != other.getIsDefault()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand Down Expand Up @@ -816,6 +845,8 @@ public int hashCode() {
}
hash = (37 * hash) + ETAG_FIELD_NUMBER;
hash = (53 * hash) + getEtag().hashCode();
hash = (37 * hash) + IS_DEFAULT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsDefault());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -999,6 +1030,7 @@ public Builder clear() {
}
internalGetMutableLabels().clear();
etag_ = "";
isDefault_ = false;
return this;
}

Expand Down Expand Up @@ -1067,6 +1099,9 @@ private void buildPartial0(com.google.cloud.aiplatform.v1.Tensorboard result) {
if (((from_bitField0_ & 0x00000200) != 0)) {
result.etag_ = etag_;
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.isDefault_ = isDefault_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -1153,6 +1188,9 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1.Tensorboard other) {
bitField0_ |= 0x00000200;
onChanged();
}
if (other.getIsDefault() != false) {
setIsDefault(other.getIsDefault());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -1245,6 +1283,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000008;
break;
} // case 90
case 96:
{
isDefault_ = input.readBool();
bitField0_ |= 0x00000400;
break;
} // case 96
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -2696,6 +2740,71 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) {
return this;
}

private boolean isDefault_;
/**
*
*
* <pre>
* Used to indicate if the TensorBoard instance is the default one.
* Each project &amp; region can have at most one default TensorBoard instance.
* Creation of a default TensorBoard instance and updating an existing
* TensorBoard instance to be default will mark all other TensorBoard
* instances (if any) as non default.
* </pre>
*
* <code>bool is_default = 12;</code>
*
* @return The isDefault.
*/
@java.lang.Override
public boolean getIsDefault() {
return isDefault_;
}
/**
*
*
* <pre>
* Used to indicate if the TensorBoard instance is the default one.
* Each project &amp; region can have at most one default TensorBoard instance.
* Creation of a default TensorBoard instance and updating an existing
* TensorBoard instance to be default will mark all other TensorBoard
* instances (if any) as non default.
* </pre>
*
* <code>bool is_default = 12;</code>
*
* @param value The isDefault to set.
* @return This builder for chaining.
*/
public Builder setIsDefault(boolean value) {

isDefault_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
* <pre>
* Used to indicate if the TensorBoard instance is the default one.
* Each project &amp; region can have at most one default TensorBoard instance.
* Creation of a default TensorBoard instance and updating an existing
* TensorBoard instance to be default will mark all other TensorBoard
* instances (if any) as non default.
* </pre>
*
* <code>bool is_default = 12;</code>
*
* @return This builder for chaining.
*/
public Builder clearIsDefault() {
bitField0_ = (bitField0_ & ~0x00000400);
isDefault_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,21 @@ java.lang.String getLabelsOrDefault(
* @return The bytes for etag.
*/
com.google.protobuf.ByteString getEtagBytes();

/**
*
*
* <pre>
* Used to indicate if the TensorBoard instance is the default one.
* Each project &amp; region can have at most one default TensorBoard instance.
* Creation of a default TensorBoard instance and updating an existing
* TensorBoard instance to be default will mark all other TensorBoard
* instances (if any) as non default.
* </pre>
*
* <code>bool is_default = 12;</code>
*
* @return The isDefault.
*/
boolean getIsDefault();
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "le/api/field_behavior.proto\032\031google/api/"
+ "resource.proto\0320google/cloud/aiplatform/"
+ "v1/encryption_spec.proto\032\037google/protobu"
+ "f/timestamp.proto\"\262\004\n\013Tensorboard\022\021\n\004nam"
+ "f/timestamp.proto\"\306\004\n\013Tensorboard\022\021\n\004nam"
+ "e\030\001 \001(\tB\003\340A\003\022\031\n\014display_name\030\002 \001(\tB\003\340A\002\022"
+ "\023\n\013description\030\003 \001(\t\022C\n\017encryption_spec\030"
+ "\013 \001(\0132*.google.cloud.aiplatform.v1.Encry"
Expand All @@ -59,16 +59,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "pB\003\340A\003\0224\n\013update_time\030\007 \001(\0132\032.google.pro"
+ "tobuf.TimestampB\003\340A\003\022C\n\006labels\030\010 \003(\01323.g"
+ "oogle.cloud.aiplatform.v1.Tensorboard.La"
+ "belsEntry\022\014\n\004etag\030\t \001(\t\032-\n\013LabelsEntry\022\013"
+ "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:n\352Ak\n%aip"
+ "latform.googleapis.com/Tensorboard\022Bproj"
+ "ects/{project}/locations/{location}/tens"
+ "orboards/{tensorboard}B\316\001\n\036com.google.cl"
+ "oud.aiplatform.v1B\020TensorboardProtoP\001Z>c"
+ "loud.google.com/go/aiplatform/apiv1/aipl"
+ "atformpb;aiplatformpb\252\002\032Google.Cloud.AIP"
+ "latform.V1\312\002\032Google\\Cloud\\AIPlatform\\V1\352"
+ "\002\035Google::Cloud::AIPlatform::V1b\006proto3"
+ "belsEntry\022\014\n\004etag\030\t \001(\t\022\022\n\nis_default\030\014 "
+ "\001(\010\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value"
+ "\030\002 \001(\t:\0028\001:n\352Ak\n%aiplatform.googleapis.c"
+ "om/Tensorboard\022Bprojects/{project}/locat"
+ "ions/{location}/tensorboards/{tensorboar"
+ "d}B\316\001\n\036com.google.cloud.aiplatform.v1B\020T"
+ "ensorboardProtoP\001Z>cloud.google.com/go/a"
+ "iplatform/apiv1/aiplatformpb;aiplatformp"
+ "b\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Google\\"
+ "Cloud\\AIPlatform\\V1\352\002\035Google::Cloud::AIP"
+ "latform::V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand All @@ -95,6 +96,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
"UpdateTime",
"Labels",
"Etag",
"IsDefault",
});
internal_static_google_cloud_aiplatform_v1_Tensorboard_LabelsEntry_descriptor =
internal_static_google_cloud_aiplatform_v1_Tensorboard_descriptor.getNestedTypes().get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,11 @@ message Tensorboard {
// Used to perform a consistent read-modify-write updates. If not set, a blind
// "overwrite" update happens.
string etag = 9;

// Used to indicate if the TensorBoard instance is the default one.
// Each project & region can have at most one default TensorBoard instance.
// Creation of a default TensorBoard instance and updating an existing
// TensorBoard instance to be default will mark all other TensorBoard
// instances (if any) as non default.
bool is_default = 12;
}