diff --git a/generation_config.yaml b/generation_config.yaml index 58861aa8ba83..888beab6166e 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.37.0 protobuf_version: '25.2' -googleapis_commitish: 65277ddce9caa1cfd1a0eb7ab67980fc73d20b50 +googleapis_commitish: f5ed6db308e6ce3f9bcdc3afcbf2ab8b50d905d6 owlbot_cli_image: sha256:623647ee79ac605858d09e60c1382a716c125fb776f69301b72de1cd35d49409 synthtool_commitish: 6612ab8f3afcd5e292aecd647f0fa68812c9f5b5 template_excludes: diff --git a/java-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json b/java-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json index 32d17063436f..2acab3242034 100644 --- a/java-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json +++ b/java-chat/google-cloud-chat/src/main/resources/META-INF/native-image/com.google.chat.v1/reflect-config.json @@ -1709,6 +1709,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.chat.v1.DriveLinkData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.DriveLinkData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.chat.v1.Emoji", "queryAllDeclaredConstructors": true, @@ -2114,6 +2132,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.chat.v1.RichLinkMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.RichLinkMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.chat.v1.RichLinkMetadata$RichLinkType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.chat.v1.SetUpSpaceRequest", "queryAllDeclaredConstructors": true, diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/Annotation.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/Annotation.java index 39254b529c96..1b46535872e0 100644 --- a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/Annotation.java +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/Annotation.java @@ -99,6 +99,7 @@ public enum MetadataCase com.google.protobuf.AbstractMessage.InternalOneOfEnum { USER_MENTION(4), SLASH_COMMAND(5), + RICH_LINK_METADATA(6), METADATA_NOT_SET(0); private final int value; @@ -121,6 +122,8 @@ public static MetadataCase forNumber(int value) { return USER_MENTION; case 5: return SLASH_COMMAND; + case 6: + return RICH_LINK_METADATA; case 0: return METADATA_NOT_SET; default: @@ -327,6 +330,57 @@ public com.google.chat.v1.SlashCommandMetadataOrBuilder getSlashCommandOrBuilder return com.google.chat.v1.SlashCommandMetadata.getDefaultInstance(); } + public static final int RICH_LINK_METADATA_FIELD_NUMBER = 6; + /** + * + * + *
+   * The metadata for a rich link.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * + * @return Whether the richLinkMetadata field is set. + */ + @java.lang.Override + public boolean hasRichLinkMetadata() { + return metadataCase_ == 6; + } + /** + * + * + *
+   * The metadata for a rich link.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * + * @return The richLinkMetadata. + */ + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata getRichLinkMetadata() { + if (metadataCase_ == 6) { + return (com.google.chat.v1.RichLinkMetadata) metadata_; + } + return com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } + /** + * + * + *
+   * The metadata for a rich link.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + @java.lang.Override + public com.google.chat.v1.RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder() { + if (metadataCase_ == 6) { + return (com.google.chat.v1.RichLinkMetadata) metadata_; + } + return com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -356,6 +410,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (metadataCase_ == 5) { output.writeMessage(5, (com.google.chat.v1.SlashCommandMetadata) metadata_); } + if (metadataCase_ == 6) { + output.writeMessage(6, (com.google.chat.v1.RichLinkMetadata) metadata_); + } getUnknownFields().writeTo(output); } @@ -384,6 +441,11 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 5, (com.google.chat.v1.SlashCommandMetadata) metadata_); } + if (metadataCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.chat.v1.RichLinkMetadata) metadata_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -413,6 +475,9 @@ public boolean equals(final java.lang.Object obj) { case 5: if (!getSlashCommand().equals(other.getSlashCommand())) return false; break; + case 6: + if (!getRichLinkMetadata().equals(other.getRichLinkMetadata())) return false; + break; case 0: default: } @@ -444,6 +509,10 @@ public int hashCode() { hash = (37 * hash) + SLASH_COMMAND_FIELD_NUMBER; hash = (53 * hash) + getSlashCommand().hashCode(); break; + case 6: + hash = (37 * hash) + RICH_LINK_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getRichLinkMetadata().hashCode(); + break; case 0: default: } @@ -619,6 +688,9 @@ public Builder clear() { if (slashCommandBuilder_ != null) { slashCommandBuilder_.clear(); } + if (richLinkMetadataBuilder_ != null) { + richLinkMetadataBuilder_.clear(); + } metadataCase_ = 0; metadata_ = null; return this; @@ -680,6 +752,9 @@ private void buildPartialOneofs(com.google.chat.v1.Annotation result) { if (metadataCase_ == 5 && slashCommandBuilder_ != null) { result.metadata_ = slashCommandBuilder_.build(); } + if (metadataCase_ == 6 && richLinkMetadataBuilder_ != null) { + result.metadata_ = richLinkMetadataBuilder_.build(); + } } @java.lang.Override @@ -747,6 +822,11 @@ public Builder mergeFrom(com.google.chat.v1.Annotation other) { mergeSlashCommand(other.getSlashCommand()); break; } + case RICH_LINK_METADATA: + { + mergeRichLinkMetadata(other.getRichLinkMetadata()); + break; + } case METADATA_NOT_SET: { break; @@ -808,6 +888,13 @@ public Builder mergeFrom( metadataCase_ = 5; break; } // case 42 + case 50: + { + input.readMessage( + getRichLinkMetadataFieldBuilder().getBuilder(), extensionRegistry); + metadataCase_ = 6; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1475,6 +1562,213 @@ public com.google.chat.v1.SlashCommandMetadataOrBuilder getSlashCommandOrBuilder return slashCommandBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.RichLinkMetadata, + com.google.chat.v1.RichLinkMetadata.Builder, + com.google.chat.v1.RichLinkMetadataOrBuilder> + richLinkMetadataBuilder_; + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * + * @return Whether the richLinkMetadata field is set. + */ + @java.lang.Override + public boolean hasRichLinkMetadata() { + return metadataCase_ == 6; + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * + * @return The richLinkMetadata. + */ + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata getRichLinkMetadata() { + if (richLinkMetadataBuilder_ == null) { + if (metadataCase_ == 6) { + return (com.google.chat.v1.RichLinkMetadata) metadata_; + } + return com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } else { + if (metadataCase_ == 6) { + return richLinkMetadataBuilder_.getMessage(); + } + return com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + public Builder setRichLinkMetadata(com.google.chat.v1.RichLinkMetadata value) { + if (richLinkMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + richLinkMetadataBuilder_.setMessage(value); + } + metadataCase_ = 6; + return this; + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + public Builder setRichLinkMetadata( + com.google.chat.v1.RichLinkMetadata.Builder builderForValue) { + if (richLinkMetadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + richLinkMetadataBuilder_.setMessage(builderForValue.build()); + } + metadataCase_ = 6; + return this; + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + public Builder mergeRichLinkMetadata(com.google.chat.v1.RichLinkMetadata value) { + if (richLinkMetadataBuilder_ == null) { + if (metadataCase_ == 6 + && metadata_ != com.google.chat.v1.RichLinkMetadata.getDefaultInstance()) { + metadata_ = + com.google.chat.v1.RichLinkMetadata.newBuilder( + (com.google.chat.v1.RichLinkMetadata) metadata_) + .mergeFrom(value) + .buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + if (metadataCase_ == 6) { + richLinkMetadataBuilder_.mergeFrom(value); + } else { + richLinkMetadataBuilder_.setMessage(value); + } + } + metadataCase_ = 6; + return this; + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + public Builder clearRichLinkMetadata() { + if (richLinkMetadataBuilder_ == null) { + if (metadataCase_ == 6) { + metadataCase_ = 0; + metadata_ = null; + onChanged(); + } + } else { + if (metadataCase_ == 6) { + metadataCase_ = 0; + metadata_ = null; + } + richLinkMetadataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + public com.google.chat.v1.RichLinkMetadata.Builder getRichLinkMetadataBuilder() { + return getRichLinkMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + @java.lang.Override + public com.google.chat.v1.RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder() { + if ((metadataCase_ == 6) && (richLinkMetadataBuilder_ != null)) { + return richLinkMetadataBuilder_.getMessageOrBuilder(); + } else { + if (metadataCase_ == 6) { + return (com.google.chat.v1.RichLinkMetadata) metadata_; + } + return com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } + } + /** + * + * + *
+     * The metadata for a rich link.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.RichLinkMetadata, + com.google.chat.v1.RichLinkMetadata.Builder, + com.google.chat.v1.RichLinkMetadataOrBuilder> + getRichLinkMetadataFieldBuilder() { + if (richLinkMetadataBuilder_ == null) { + if (!(metadataCase_ == 6)) { + metadata_ = com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } + richLinkMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.RichLinkMetadata, + com.google.chat.v1.RichLinkMetadata.Builder, + com.google.chat.v1.RichLinkMetadataOrBuilder>( + (com.google.chat.v1.RichLinkMetadata) metadata_, getParentForChildren(), isClean()); + metadata_ = null; + } + metadataCase_ = 6; + onChanged(); + return richLinkMetadataBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationOrBuilder.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationOrBuilder.java index f8a5790d8a7a..ccf5cadf751f 100644 --- a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationOrBuilder.java +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationOrBuilder.java @@ -160,5 +160,40 @@ public interface AnnotationOrBuilder */ com.google.chat.v1.SlashCommandMetadataOrBuilder getSlashCommandOrBuilder(); + /** + * + * + *
+   * The metadata for a rich link.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * + * @return Whether the richLinkMetadata field is set. + */ + boolean hasRichLinkMetadata(); + /** + * + * + *
+   * The metadata for a rich link.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + * + * @return The richLinkMetadata. + */ + com.google.chat.v1.RichLinkMetadata getRichLinkMetadata(); + /** + * + * + *
+   * The metadata for a rich link.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata rich_link_metadata = 6; + */ + com.google.chat.v1.RichLinkMetadataOrBuilder getRichLinkMetadataOrBuilder(); + com.google.chat.v1.Annotation.MetadataCase getMetadataCase(); } diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationProto.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationProto.java index 54f9f2c317bd..35fa7041bf6c 100644 --- a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationProto.java +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationProto.java @@ -40,6 +40,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_chat_v1_SlashCommandMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_chat_v1_SlashCommandMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_chat_v1_RichLinkMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_chat_v1_RichLinkMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_chat_v1_DriveLinkData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_chat_v1_DriveLinkData_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -50,35 +58,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\037google/chat/v1/annotation.proto\022\016googl" - + "e.chat.v1\032\031google/chat/v1/user.proto\"\374\001\n" - + "\nAnnotation\022,\n\004type\030\001 \001(\0162\036.google.chat." - + "v1.AnnotationType\022\030\n\013start_index\030\002 \001(\005H\001" - + "\210\001\001\022\016\n\006length\030\003 \001(\005\022;\n\014user_mention\030\004 \001(" - + "\0132#.google.chat.v1.UserMentionMetadataH\000" - + "\022=\n\rslash_command\030\005 \001(\0132$.google.chat.v1" - + ".SlashCommandMetadataH\000B\n\n\010metadataB\016\n\014_" - + "start_index\"\245\001\n\023UserMentionMetadata\022\"\n\004u" - + "ser\030\001 \001(\0132\024.google.chat.v1.User\0226\n\004type\030" - + "\002 \001(\0162(.google.chat.v1.UserMentionMetada" - + "ta.Type\"2\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\007\n" - + "\003ADD\020\001\022\013\n\007MENTION\020\002\"\350\001\n\024SlashCommandMeta" - + "data\022!\n\003bot\030\001 \001(\0132\024.google.chat.v1.User\022" - + "7\n\004type\030\002 \001(\0162).google.chat.v1.SlashComm" - + "andMetadata.Type\022\024\n\014command_name\030\003 \001(\t\022\022" - + "\n\ncommand_id\030\004 \001(\003\022\027\n\017triggers_dialog\030\005 " - + "\001(\010\"1\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\007\n\003ADD" - + "\020\001\022\n\n\006INVOKE\020\002*V\n\016AnnotationType\022\037\n\033ANNO" - + "TATION_TYPE_UNSPECIFIED\020\000\022\020\n\014USER_MENTIO" - + "N\020\001\022\021\n\rSLASH_COMMAND\020\002B\232\001\n\022com.google.ch" - + "at.v1B\017AnnotationProtoP\001Z,cloud.google.c" - + "om/go/chat/apiv1/chatpb;chatpb\252\002\023Google." - + "Apps.Chat.V1\312\002\023Google\\Apps\\Chat\\V1\352\002\026Goo" - + "gle::Apps::Chat::V1b\006proto3" + + "e.chat.v1\032\037google/chat/v1/attachment.pro" + + "to\032\031google/chat/v1/user.proto\"\274\002\n\nAnnota" + + "tion\022,\n\004type\030\001 \001(\0162\036.google.chat.v1.Anno" + + "tationType\022\030\n\013start_index\030\002 \001(\005H\001\210\001\001\022\016\n\006" + + "length\030\003 \001(\005\022;\n\014user_mention\030\004 \001(\0132#.goo" + + "gle.chat.v1.UserMentionMetadataH\000\022=\n\rsla" + + "sh_command\030\005 \001(\0132$.google.chat.v1.SlashC" + + "ommandMetadataH\000\022>\n\022rich_link_metadata\030\006" + + " \001(\0132 .google.chat.v1.RichLinkMetadataH\000" + + "B\n\n\010metadataB\016\n\014_start_index\"\245\001\n\023UserMen" + + "tionMetadata\022\"\n\004user\030\001 \001(\0132\024.google.chat" + + ".v1.User\0226\n\004type\030\002 \001(\0162(.google.chat.v1." + + "UserMentionMetadata.Type\"2\n\004Type\022\024\n\020TYPE" + + "_UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\013\n\007MENTION\020\002\"\350\001\n" + + "\024SlashCommandMetadata\022!\n\003bot\030\001 \001(\0132\024.goo" + + "gle.chat.v1.User\0227\n\004type\030\002 \001(\0162).google." + + "chat.v1.SlashCommandMetadata.Type\022\024\n\014com" + + "mand_name\030\003 \001(\t\022\022\n\ncommand_id\030\004 \001(\003\022\027\n\017t" + + "riggers_dialog\030\005 \001(\010\"1\n\004Type\022\024\n\020TYPE_UNS" + + "PECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006INVOKE\020\002\"\350\001\n\020Rich" + + "LinkMetadata\022\013\n\003uri\030\001 \001(\t\022E\n\016rich_link_t" + + "ype\030\002 \001(\0162-.google.chat.v1.RichLinkMetad" + + "ata.RichLinkType\0228\n\017drive_link_data\030\003 \001(" + + "\0132\035.google.chat.v1.DriveLinkDataH\000\">\n\014Ri" + + "chLinkType\022\036\n\032RICH_LINK_TYPE_UNSPECIFIED" + + "\020\000\022\016\n\nDRIVE_FILE\020\001B\006\n\004data\"X\n\rDriveLinkD" + + "ata\0224\n\016drive_data_ref\030\001 \001(\0132\034.google.cha" + + "t.v1.DriveDataRef\022\021\n\tmime_type\030\002 \001(\t*e\n\016" + + "AnnotationType\022\037\n\033ANNOTATION_TYPE_UNSPEC" + + "IFIED\020\000\022\020\n\014USER_MENTION\020\001\022\021\n\rSLASH_COMMA" + + "ND\020\002\022\r\n\tRICH_LINK\020\003B\232\001\n\022com.google.chat." + + "v1B\017AnnotationProtoP\001Z,cloud.google.com/" + + "go/chat/apiv1/chatpb;chatpb\252\002\023Google.App" + + "s.Chat.V1\312\002\023Google\\Apps\\Chat\\V1\352\002\026Google" + + "::Apps::Chat::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.chat.v1.AttachmentProto.getDescriptor(), com.google.chat.v1.UserProto.getDescriptor(), }); internal_static_google_chat_v1_Annotation_descriptor = getDescriptor().getMessageTypes().get(0); @@ -86,7 +106,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_chat_v1_Annotation_descriptor, new java.lang.String[] { - "Type", "StartIndex", "Length", "UserMention", "SlashCommand", "Metadata", + "Type", + "StartIndex", + "Length", + "UserMention", + "SlashCommand", + "RichLinkMetadata", + "Metadata", }); internal_static_google_chat_v1_UserMentionMetadata_descriptor = getDescriptor().getMessageTypes().get(1); @@ -104,6 +130,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Bot", "Type", "CommandName", "CommandId", "TriggersDialog", }); + internal_static_google_chat_v1_RichLinkMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_chat_v1_RichLinkMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_chat_v1_RichLinkMetadata_descriptor, + new java.lang.String[] { + "Uri", "RichLinkType", "DriveLinkData", "Data", + }); + internal_static_google_chat_v1_DriveLinkData_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_chat_v1_DriveLinkData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_chat_v1_DriveLinkData_descriptor, + new java.lang.String[] { + "DriveDataRef", "MimeType", + }); + com.google.chat.v1.AttachmentProto.getDescriptor(); com.google.chat.v1.UserProto.getDescriptor(); } diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationType.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationType.java index 5c236f665948..6270d597e243 100644 --- a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationType.java +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/AnnotationType.java @@ -59,6 +59,16 @@ public enum AnnotationType implements com.google.protobuf.ProtocolMessageEnum { * SLASH_COMMAND = 2; */ SLASH_COMMAND(2), + /** + * + * + *
+   * A rich link annotation.
+   * 
+ * + * RICH_LINK = 3; + */ + RICH_LINK(3), UNRECOGNIZED(-1), ; @@ -92,6 +102,16 @@ public enum AnnotationType implements com.google.protobuf.ProtocolMessageEnum { * SLASH_COMMAND = 2; */ public static final int SLASH_COMMAND_VALUE = 2; + /** + * + * + *
+   * A rich link annotation.
+   * 
+ * + * RICH_LINK = 3; + */ + public static final int RICH_LINK_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -123,6 +143,8 @@ public static AnnotationType forNumber(int value) { return USER_MENTION; case 2: return SLASH_COMMAND; + case 3: + return RICH_LINK; default: return null; } diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/DriveLinkData.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/DriveLinkData.java new file mode 100644 index 000000000000..dd3697cf4337 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/DriveLinkData.java @@ -0,0 +1,924 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/chat/v1/annotation.proto + +// Protobuf Java Version: 3.25.2 +package com.google.chat.v1; + +/** + * + * + *
+ * Data for Google Drive links.
+ * 
+ * + * Protobuf type {@code google.chat.v1.DriveLinkData} + */ +public final class DriveLinkData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.chat.v1.DriveLinkData) + DriveLinkDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DriveLinkData.newBuilder() to construct. + private DriveLinkData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DriveLinkData() { + mimeType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DriveLinkData(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_DriveLinkData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_DriveLinkData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.chat.v1.DriveLinkData.class, com.google.chat.v1.DriveLinkData.Builder.class); + } + + private int bitField0_; + public static final int DRIVE_DATA_REF_FIELD_NUMBER = 1; + private com.google.chat.v1.DriveDataRef driveDataRef_; + /** + * + * + *
+   * A
+   * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+   * which references a Google Drive file.
+   * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + * + * @return Whether the driveDataRef field is set. + */ + @java.lang.Override + public boolean hasDriveDataRef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * A
+   * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+   * which references a Google Drive file.
+   * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + * + * @return The driveDataRef. + */ + @java.lang.Override + public com.google.chat.v1.DriveDataRef getDriveDataRef() { + return driveDataRef_ == null + ? com.google.chat.v1.DriveDataRef.getDefaultInstance() + : driveDataRef_; + } + /** + * + * + *
+   * A
+   * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+   * which references a Google Drive file.
+   * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + @java.lang.Override + public com.google.chat.v1.DriveDataRefOrBuilder getDriveDataRefOrBuilder() { + return driveDataRef_ == null + ? com.google.chat.v1.DriveDataRef.getDefaultInstance() + : driveDataRef_; + } + + public static final int MIME_TYPE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * + * + *
+   * The mime type of the linked Google Drive resource.
+   * 
+ * + * string mime_type = 2; + * + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } + } + /** + * + * + *
+   * The mime type of the linked Google Drive resource.
+   * 
+ * + * string mime_type = 2; + * + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getDriveDataRef()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDriveDataRef()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.chat.v1.DriveLinkData)) { + return super.equals(obj); + } + com.google.chat.v1.DriveLinkData other = (com.google.chat.v1.DriveLinkData) obj; + + if (hasDriveDataRef() != other.hasDriveDataRef()) return false; + if (hasDriveDataRef()) { + if (!getDriveDataRef().equals(other.getDriveDataRef())) return false; + } + if (!getMimeType().equals(other.getMimeType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDriveDataRef()) { + hash = (37 * hash) + DRIVE_DATA_REF_FIELD_NUMBER; + hash = (53 * hash) + getDriveDataRef().hashCode(); + } + hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.chat.v1.DriveLinkData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.chat.v1.DriveLinkData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.chat.v1.DriveLinkData parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.chat.v1.DriveLinkData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.chat.v1.DriveLinkData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.chat.v1.DriveLinkData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.chat.v1.DriveLinkData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.chat.v1.DriveLinkData parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.chat.v1.DriveLinkData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.chat.v1.DriveLinkData parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.chat.v1.DriveLinkData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.chat.v1.DriveLinkData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.chat.v1.DriveLinkData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Data for Google Drive links.
+   * 
+ * + * Protobuf type {@code google.chat.v1.DriveLinkData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.chat.v1.DriveLinkData) + com.google.chat.v1.DriveLinkDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_DriveLinkData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_DriveLinkData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.chat.v1.DriveLinkData.class, + com.google.chat.v1.DriveLinkData.Builder.class); + } + + // Construct using com.google.chat.v1.DriveLinkData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDriveDataRefFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + driveDataRef_ = null; + if (driveDataRefBuilder_ != null) { + driveDataRefBuilder_.dispose(); + driveDataRefBuilder_ = null; + } + mimeType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_DriveLinkData_descriptor; + } + + @java.lang.Override + public com.google.chat.v1.DriveLinkData getDefaultInstanceForType() { + return com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.chat.v1.DriveLinkData build() { + com.google.chat.v1.DriveLinkData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.chat.v1.DriveLinkData buildPartial() { + com.google.chat.v1.DriveLinkData result = new com.google.chat.v1.DriveLinkData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.chat.v1.DriveLinkData result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.driveDataRef_ = + driveDataRefBuilder_ == null ? driveDataRef_ : driveDataRefBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mimeType_ = mimeType_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.chat.v1.DriveLinkData) { + return mergeFrom((com.google.chat.v1.DriveLinkData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.chat.v1.DriveLinkData other) { + if (other == com.google.chat.v1.DriveLinkData.getDefaultInstance()) return this; + if (other.hasDriveDataRef()) { + mergeDriveDataRef(other.getDriveDataRef()); + } + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getDriveDataRefFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.chat.v1.DriveDataRef driveDataRef_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.DriveDataRef, + com.google.chat.v1.DriveDataRef.Builder, + com.google.chat.v1.DriveDataRefOrBuilder> + driveDataRefBuilder_; + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + * + * @return Whether the driveDataRef field is set. + */ + public boolean hasDriveDataRef() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + * + * @return The driveDataRef. + */ + public com.google.chat.v1.DriveDataRef getDriveDataRef() { + if (driveDataRefBuilder_ == null) { + return driveDataRef_ == null + ? com.google.chat.v1.DriveDataRef.getDefaultInstance() + : driveDataRef_; + } else { + return driveDataRefBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + public Builder setDriveDataRef(com.google.chat.v1.DriveDataRef value) { + if (driveDataRefBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + driveDataRef_ = value; + } else { + driveDataRefBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + public Builder setDriveDataRef(com.google.chat.v1.DriveDataRef.Builder builderForValue) { + if (driveDataRefBuilder_ == null) { + driveDataRef_ = builderForValue.build(); + } else { + driveDataRefBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + public Builder mergeDriveDataRef(com.google.chat.v1.DriveDataRef value) { + if (driveDataRefBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && driveDataRef_ != null + && driveDataRef_ != com.google.chat.v1.DriveDataRef.getDefaultInstance()) { + getDriveDataRefBuilder().mergeFrom(value); + } else { + driveDataRef_ = value; + } + } else { + driveDataRefBuilder_.mergeFrom(value); + } + if (driveDataRef_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + public Builder clearDriveDataRef() { + bitField0_ = (bitField0_ & ~0x00000001); + driveDataRef_ = null; + if (driveDataRefBuilder_ != null) { + driveDataRefBuilder_.dispose(); + driveDataRefBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + public com.google.chat.v1.DriveDataRef.Builder getDriveDataRefBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDriveDataRefFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + public com.google.chat.v1.DriveDataRefOrBuilder getDriveDataRefOrBuilder() { + if (driveDataRefBuilder_ != null) { + return driveDataRefBuilder_.getMessageOrBuilder(); + } else { + return driveDataRef_ == null + ? com.google.chat.v1.DriveDataRef.getDefaultInstance() + : driveDataRef_; + } + } + /** + * + * + *
+     * A
+     * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+     * which references a Google Drive file.
+     * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.DriveDataRef, + com.google.chat.v1.DriveDataRef.Builder, + com.google.chat.v1.DriveDataRefOrBuilder> + getDriveDataRefFieldBuilder() { + if (driveDataRefBuilder_ == null) { + driveDataRefBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.DriveDataRef, + com.google.chat.v1.DriveDataRef.Builder, + com.google.chat.v1.DriveDataRefOrBuilder>( + getDriveDataRef(), getParentForChildren(), isClean()); + driveDataRef_ = null; + } + return driveDataRefBuilder_; + } + + private java.lang.Object mimeType_ = ""; + /** + * + * + *
+     * The mime type of the linked Google Drive resource.
+     * 
+ * + * string mime_type = 2; + * + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The mime type of the linked Google Drive resource.
+     * 
+ * + * string mime_type = 2; + * + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The mime type of the linked Google Drive resource.
+     * 
+ * + * string mime_type = 2; + * + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mimeType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The mime type of the linked Google Drive resource.
+     * 
+ * + * string mime_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The mime type of the linked Google Drive resource.
+     * 
+ * + * string mime_type = 2; + * + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.chat.v1.DriveLinkData) + } + + // @@protoc_insertion_point(class_scope:google.chat.v1.DriveLinkData) + private static final com.google.chat.v1.DriveLinkData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.chat.v1.DriveLinkData(); + } + + public static com.google.chat.v1.DriveLinkData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DriveLinkData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.chat.v1.DriveLinkData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/DriveLinkDataOrBuilder.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/DriveLinkDataOrBuilder.java new file mode 100644 index 000000000000..20d2b8696e7f --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/DriveLinkDataOrBuilder.java @@ -0,0 +1,92 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/chat/v1/annotation.proto + +// Protobuf Java Version: 3.25.2 +package com.google.chat.v1; + +public interface DriveLinkDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.chat.v1.DriveLinkData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A
+   * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+   * which references a Google Drive file.
+   * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + * + * @return Whether the driveDataRef field is set. + */ + boolean hasDriveDataRef(); + /** + * + * + *
+   * A
+   * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+   * which references a Google Drive file.
+   * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + * + * @return The driveDataRef. + */ + com.google.chat.v1.DriveDataRef getDriveDataRef(); + /** + * + * + *
+   * A
+   * [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
+   * which references a Google Drive file.
+   * 
+ * + * .google.chat.v1.DriveDataRef drive_data_ref = 1; + */ + com.google.chat.v1.DriveDataRefOrBuilder getDriveDataRefOrBuilder(); + + /** + * + * + *
+   * The mime type of the linked Google Drive resource.
+   * 
+ * + * string mime_type = 2; + * + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * + * + *
+   * The mime type of the linked Google Drive resource.
+   * 
+ * + * string mime_type = 2; + * + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString getMimeTypeBytes(); +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/RichLinkMetadata.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/RichLinkMetadata.java new file mode 100644 index 000000000000..59de73846e92 --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/RichLinkMetadata.java @@ -0,0 +1,1280 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/chat/v1/annotation.proto + +// Protobuf Java Version: 3.25.2 +package com.google.chat.v1; + +/** + * + * + *
+ * A rich link to a resource.
+ * 
+ * + * Protobuf type {@code google.chat.v1.RichLinkMetadata} + */ +public final class RichLinkMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.chat.v1.RichLinkMetadata) + RichLinkMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RichLinkMetadata.newBuilder() to construct. + private RichLinkMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RichLinkMetadata() { + uri_ = ""; + richLinkType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RichLinkMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_RichLinkMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_RichLinkMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.chat.v1.RichLinkMetadata.class, + com.google.chat.v1.RichLinkMetadata.Builder.class); + } + + /** + * + * + *
+   * The rich link type. More types might be added in the future.
+   * 
+ * + * Protobuf enum {@code google.chat.v1.RichLinkMetadata.RichLinkType} + */ + public enum RichLinkType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value for the enum. Don't use.
+     * 
+ * + * RICH_LINK_TYPE_UNSPECIFIED = 0; + */ + RICH_LINK_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * A Google Drive rich link type.
+     * 
+ * + * DRIVE_FILE = 1; + */ + DRIVE_FILE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value for the enum. Don't use.
+     * 
+ * + * RICH_LINK_TYPE_UNSPECIFIED = 0; + */ + public static final int RICH_LINK_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * A Google Drive rich link type.
+     * 
+ * + * DRIVE_FILE = 1; + */ + public static final int DRIVE_FILE_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RichLinkType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RichLinkType forNumber(int value) { + switch (value) { + case 0: + return RICH_LINK_TYPE_UNSPECIFIED; + case 1: + return DRIVE_FILE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RichLinkType findValueByNumber(int number) { + return RichLinkType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.chat.v1.RichLinkMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final RichLinkType[] VALUES = values(); + + public static RichLinkType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RichLinkType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.chat.v1.RichLinkMetadata.RichLinkType) + } + + private int dataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object data_; + + public enum DataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DRIVE_LINK_DATA(3), + DATA_NOT_SET(0); + private final int value; + + private DataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 3: + return DRIVE_LINK_DATA; + case 0: + return DATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public static final int URI_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + * + * + *
+   * The URI of this link.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * The URI of this link.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RICH_LINK_TYPE_FIELD_NUMBER = 2; + private int richLinkType_ = 0; + /** + * + * + *
+   * The rich link type.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return The enum numeric value on the wire for richLinkType. + */ + @java.lang.Override + public int getRichLinkTypeValue() { + return richLinkType_; + } + /** + * + * + *
+   * The rich link type.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return The richLinkType. + */ + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata.RichLinkType getRichLinkType() { + com.google.chat.v1.RichLinkMetadata.RichLinkType result = + com.google.chat.v1.RichLinkMetadata.RichLinkType.forNumber(richLinkType_); + return result == null ? com.google.chat.v1.RichLinkMetadata.RichLinkType.UNRECOGNIZED : result; + } + + public static final int DRIVE_LINK_DATA_FIELD_NUMBER = 3; + /** + * + * + *
+   * Data for a drive link.
+   * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + * + * @return Whether the driveLinkData field is set. + */ + @java.lang.Override + public boolean hasDriveLinkData() { + return dataCase_ == 3; + } + /** + * + * + *
+   * Data for a drive link.
+   * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + * + * @return The driveLinkData. + */ + @java.lang.Override + public com.google.chat.v1.DriveLinkData getDriveLinkData() { + if (dataCase_ == 3) { + return (com.google.chat.v1.DriveLinkData) data_; + } + return com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } + /** + * + * + *
+   * Data for a drive link.
+   * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + @java.lang.Override + public com.google.chat.v1.DriveLinkDataOrBuilder getDriveLinkDataOrBuilder() { + if (dataCase_ == 3) { + return (com.google.chat.v1.DriveLinkData) data_; + } + return com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_); + } + if (richLinkType_ + != com.google.chat.v1.RichLinkMetadata.RichLinkType.RICH_LINK_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, richLinkType_); + } + if (dataCase_ == 3) { + output.writeMessage(3, (com.google.chat.v1.DriveLinkData) data_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_); + } + if (richLinkType_ + != com.google.chat.v1.RichLinkMetadata.RichLinkType.RICH_LINK_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, richLinkType_); + } + if (dataCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.chat.v1.DriveLinkData) data_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.chat.v1.RichLinkMetadata)) { + return super.equals(obj); + } + com.google.chat.v1.RichLinkMetadata other = (com.google.chat.v1.RichLinkMetadata) obj; + + if (!getUri().equals(other.getUri())) return false; + if (richLinkType_ != other.richLinkType_) return false; + if (!getDataCase().equals(other.getDataCase())) return false; + switch (dataCase_) { + case 3: + if (!getDriveLinkData().equals(other.getDriveLinkData())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + RICH_LINK_TYPE_FIELD_NUMBER; + hash = (53 * hash) + richLinkType_; + switch (dataCase_) { + case 3: + hash = (37 * hash) + DRIVE_LINK_DATA_FIELD_NUMBER; + hash = (53 * hash) + getDriveLinkData().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.chat.v1.RichLinkMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.chat.v1.RichLinkMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.chat.v1.RichLinkMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.chat.v1.RichLinkMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A rich link to a resource.
+   * 
+ * + * Protobuf type {@code google.chat.v1.RichLinkMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.chat.v1.RichLinkMetadata) + com.google.chat.v1.RichLinkMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_RichLinkMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_RichLinkMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.chat.v1.RichLinkMetadata.class, + com.google.chat.v1.RichLinkMetadata.Builder.class); + } + + // Construct using com.google.chat.v1.RichLinkMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + richLinkType_ = 0; + if (driveLinkDataBuilder_ != null) { + driveLinkDataBuilder_.clear(); + } + dataCase_ = 0; + data_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.chat.v1.AnnotationProto + .internal_static_google_chat_v1_RichLinkMetadata_descriptor; + } + + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata getDefaultInstanceForType() { + return com.google.chat.v1.RichLinkMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata build() { + com.google.chat.v1.RichLinkMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata buildPartial() { + com.google.chat.v1.RichLinkMetadata result = new com.google.chat.v1.RichLinkMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.chat.v1.RichLinkMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.richLinkType_ = richLinkType_; + } + } + + private void buildPartialOneofs(com.google.chat.v1.RichLinkMetadata result) { + result.dataCase_ = dataCase_; + result.data_ = this.data_; + if (dataCase_ == 3 && driveLinkDataBuilder_ != null) { + result.data_ = driveLinkDataBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.chat.v1.RichLinkMetadata) { + return mergeFrom((com.google.chat.v1.RichLinkMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.chat.v1.RichLinkMetadata other) { + if (other == com.google.chat.v1.RichLinkMetadata.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.richLinkType_ != 0) { + setRichLinkTypeValue(other.getRichLinkTypeValue()); + } + switch (other.getDataCase()) { + case DRIVE_LINK_DATA: + { + mergeDriveLinkData(other.getDriveLinkData()); + break; + } + case DATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + richLinkType_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getDriveLinkDataFieldBuilder().getBuilder(), extensionRegistry); + dataCase_ = 3; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * The URI of this link.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URI of this link.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URI of this link.
+     * 
+ * + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of this link.
+     * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The URI of this link.
+     * 
+ * + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int richLinkType_ = 0; + /** + * + * + *
+     * The rich link type.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return The enum numeric value on the wire for richLinkType. + */ + @java.lang.Override + public int getRichLinkTypeValue() { + return richLinkType_; + } + /** + * + * + *
+     * The rich link type.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @param value The enum numeric value on the wire for richLinkType to set. + * @return This builder for chaining. + */ + public Builder setRichLinkTypeValue(int value) { + richLinkType_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The rich link type.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return The richLinkType. + */ + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata.RichLinkType getRichLinkType() { + com.google.chat.v1.RichLinkMetadata.RichLinkType result = + com.google.chat.v1.RichLinkMetadata.RichLinkType.forNumber(richLinkType_); + return result == null + ? com.google.chat.v1.RichLinkMetadata.RichLinkType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The rich link type.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @param value The richLinkType to set. + * @return This builder for chaining. + */ + public Builder setRichLinkType(com.google.chat.v1.RichLinkMetadata.RichLinkType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + richLinkType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The rich link type.
+     * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearRichLinkType() { + bitField0_ = (bitField0_ & ~0x00000002); + richLinkType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.DriveLinkData, + com.google.chat.v1.DriveLinkData.Builder, + com.google.chat.v1.DriveLinkDataOrBuilder> + driveLinkDataBuilder_; + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + * + * @return Whether the driveLinkData field is set. + */ + @java.lang.Override + public boolean hasDriveLinkData() { + return dataCase_ == 3; + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + * + * @return The driveLinkData. + */ + @java.lang.Override + public com.google.chat.v1.DriveLinkData getDriveLinkData() { + if (driveLinkDataBuilder_ == null) { + if (dataCase_ == 3) { + return (com.google.chat.v1.DriveLinkData) data_; + } + return com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } else { + if (dataCase_ == 3) { + return driveLinkDataBuilder_.getMessage(); + } + return com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + public Builder setDriveLinkData(com.google.chat.v1.DriveLinkData value) { + if (driveLinkDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + driveLinkDataBuilder_.setMessage(value); + } + dataCase_ = 3; + return this; + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + public Builder setDriveLinkData(com.google.chat.v1.DriveLinkData.Builder builderForValue) { + if (driveLinkDataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + driveLinkDataBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 3; + return this; + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + public Builder mergeDriveLinkData(com.google.chat.v1.DriveLinkData value) { + if (driveLinkDataBuilder_ == null) { + if (dataCase_ == 3 && data_ != com.google.chat.v1.DriveLinkData.getDefaultInstance()) { + data_ = + com.google.chat.v1.DriveLinkData.newBuilder((com.google.chat.v1.DriveLinkData) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 3) { + driveLinkDataBuilder_.mergeFrom(value); + } else { + driveLinkDataBuilder_.setMessage(value); + } + } + dataCase_ = 3; + return this; + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + public Builder clearDriveLinkData() { + if (driveLinkDataBuilder_ == null) { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 3) { + dataCase_ = 0; + data_ = null; + } + driveLinkDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + public com.google.chat.v1.DriveLinkData.Builder getDriveLinkDataBuilder() { + return getDriveLinkDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + @java.lang.Override + public com.google.chat.v1.DriveLinkDataOrBuilder getDriveLinkDataOrBuilder() { + if ((dataCase_ == 3) && (driveLinkDataBuilder_ != null)) { + return driveLinkDataBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 3) { + return (com.google.chat.v1.DriveLinkData) data_; + } + return com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } + } + /** + * + * + *
+     * Data for a drive link.
+     * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.DriveLinkData, + com.google.chat.v1.DriveLinkData.Builder, + com.google.chat.v1.DriveLinkDataOrBuilder> + getDriveLinkDataFieldBuilder() { + if (driveLinkDataBuilder_ == null) { + if (!(dataCase_ == 3)) { + data_ = com.google.chat.v1.DriveLinkData.getDefaultInstance(); + } + driveLinkDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.chat.v1.DriveLinkData, + com.google.chat.v1.DriveLinkData.Builder, + com.google.chat.v1.DriveLinkDataOrBuilder>( + (com.google.chat.v1.DriveLinkData) data_, getParentForChildren(), isClean()); + data_ = null; + } + dataCase_ = 3; + onChanged(); + return driveLinkDataBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.chat.v1.RichLinkMetadata) + } + + // @@protoc_insertion_point(class_scope:google.chat.v1.RichLinkMetadata) + private static final com.google.chat.v1.RichLinkMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.chat.v1.RichLinkMetadata(); + } + + public static com.google.chat.v1.RichLinkMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RichLinkMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.chat.v1.RichLinkMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/RichLinkMetadataOrBuilder.java b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/RichLinkMetadataOrBuilder.java new file mode 100644 index 000000000000..833cc606adad --- /dev/null +++ b/java-chat/proto-google-cloud-chat-v1/src/main/java/com/google/chat/v1/RichLinkMetadataOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/chat/v1/annotation.proto + +// Protobuf Java Version: 3.25.2 +package com.google.chat.v1; + +public interface RichLinkMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.chat.v1.RichLinkMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URI of this link.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The URI of this link.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The rich link type.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return The enum numeric value on the wire for richLinkType. + */ + int getRichLinkTypeValue(); + /** + * + * + *
+   * The rich link type.
+   * 
+ * + * .google.chat.v1.RichLinkMetadata.RichLinkType rich_link_type = 2; + * + * @return The richLinkType. + */ + com.google.chat.v1.RichLinkMetadata.RichLinkType getRichLinkType(); + + /** + * + * + *
+   * Data for a drive link.
+   * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + * + * @return Whether the driveLinkData field is set. + */ + boolean hasDriveLinkData(); + /** + * + * + *
+   * Data for a drive link.
+   * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + * + * @return The driveLinkData. + */ + com.google.chat.v1.DriveLinkData getDriveLinkData(); + /** + * + * + *
+   * Data for a drive link.
+   * 
+ * + * .google.chat.v1.DriveLinkData drive_link_data = 3; + */ + com.google.chat.v1.DriveLinkDataOrBuilder getDriveLinkDataOrBuilder(); + + com.google.chat.v1.RichLinkMetadata.DataCase getDataCase(); +} diff --git a/java-chat/proto-google-cloud-chat-v1/src/main/proto/google/chat/v1/annotation.proto b/java-chat/proto-google-cloud-chat-v1/src/main/proto/google/chat/v1/annotation.proto index 9eb686bfe39a..d9ca0c1915b5 100644 --- a/java-chat/proto-google-cloud-chat-v1/src/main/proto/google/chat/v1/annotation.proto +++ b/java-chat/proto-google-cloud-chat-v1/src/main/proto/google/chat/v1/annotation.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.chat.v1; +import "google/chat/v1/attachment.proto"; import "google/chat/v1/user.proto"; option csharp_namespace = "Google.Apps.Chat.V1"; @@ -72,6 +73,9 @@ message Annotation { // The metadata for a slash command. SlashCommandMetadata slash_command = 5; + + // The metadata for a rich link. + RichLinkMetadata rich_link_metadata = 6; } } @@ -124,6 +128,41 @@ message SlashCommandMetadata { bool triggers_dialog = 5; } +// A rich link to a resource. +message RichLinkMetadata { + // The rich link type. More types might be added in the future. + enum RichLinkType { + // Default value for the enum. Don't use. + RICH_LINK_TYPE_UNSPECIFIED = 0; + + // A Google Drive rich link type. + DRIVE_FILE = 1; + } + + // The URI of this link. + string uri = 1; + + // The rich link type. + RichLinkType rich_link_type = 2; + + // Data for the linked resource. + oneof data { + // Data for a drive link. + DriveLinkData drive_link_data = 3; + } +} + +// Data for Google Drive links. +message DriveLinkData { + // A + // [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + // which references a Google Drive file. + DriveDataRef drive_data_ref = 1; + + // The mime type of the linked Google Drive resource. + string mime_type = 2; +} + // Type of the annotation. enum AnnotationType { // Default value for the enum. Don't use. @@ -134,4 +173,7 @@ enum AnnotationType { // A slash command is invoked. SLASH_COMMAND = 2; + + // A rich link annotation. + RICH_LINK = 3; } diff --git a/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java b/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java index 9ce680665fa5..bcf3a0c633c4 100644 --- a/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java +++ b/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientHttpJsonTest.java @@ -592,7 +592,7 @@ public void getLocationExceptionTest() throws Exception { } } - @Ignore + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void setIamPolicyTest() throws Exception { Policy expectedResponse = @@ -650,7 +650,7 @@ public void setIamPolicyExceptionTest() throws Exception { } } - @Ignore + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void getIamPolicyTest() throws Exception { Policy expectedResponse = @@ -706,7 +706,7 @@ public void getIamPolicyExceptionTest() throws Exception { } } - @Ignore + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void testIamPermissionsTest() throws Exception { TestIamPermissionsResponse expectedResponse = diff --git a/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java b/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java index 09b2bb2eef56..e12b4224de02 100644 --- a/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java +++ b/java-network-management/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientHttpJsonTest.java @@ -630,7 +630,7 @@ public void getLocationExceptionTest() throws Exception { } } - @Ignore + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void setIamPolicyTest() throws Exception { Policy expectedResponse = @@ -688,7 +688,7 @@ public void setIamPolicyExceptionTest() throws Exception { } } - @Ignore + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void getIamPolicyTest() throws Exception { Policy expectedResponse = @@ -744,7 +744,7 @@ public void getIamPolicyExceptionTest() throws Exception { } } - @Ignore + @Ignore("See: https://github.com/googleapis/sdk-platform-java/issues/1839") @Test public void testIamPermissionsTest() throws Exception { TestIamPermissionsResponse expectedResponse =