1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/discoveryengine/v1beta/document.proto 18 19 package com.google.cloud.discoveryengine.v1beta; 20 21 /** 22 * 23 * 24 * <pre> 25 * Document captures all raw metadata information of items to be recommended or 26 * searched. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.discoveryengine.v1beta.Document} 30 */ 31 public final class Document extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.Document) 34 DocumentOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use Document.newBuilder() to construct. Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 Document()41 private Document() { 42 name_ = ""; 43 id_ = ""; 44 schemaId_ = ""; 45 parentDocumentId_ = ""; 46 } 47 48 @java.lang.Override 49 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)50 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 51 return new Document(); 52 } 53 54 @java.lang.Override getUnknownFields()55 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 56 return this.unknownFields; 57 } 58 getDescriptor()59 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 60 return com.google.cloud.discoveryengine.v1beta.DocumentProto 61 .internal_static_google_cloud_discoveryengine_v1beta_Document_descriptor; 62 } 63 64 @java.lang.Override 65 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()66 internalGetFieldAccessorTable() { 67 return com.google.cloud.discoveryengine.v1beta.DocumentProto 68 .internal_static_google_cloud_discoveryengine_v1beta_Document_fieldAccessorTable 69 .ensureFieldAccessorsInitialized( 70 com.google.cloud.discoveryengine.v1beta.Document.class, 71 com.google.cloud.discoveryengine.v1beta.Document.Builder.class); 72 } 73 74 public interface ContentOrBuilder 75 extends 76 // @@protoc_insertion_point(interface_extends:google.cloud.discoveryengine.v1beta.Document.Content) 77 com.google.protobuf.MessageOrBuilder { 78 79 /** 80 * 81 * 82 * <pre> 83 * The content represented as a stream of bytes. The maximum length is 84 * 1,000,000 bytes (1 MB / ~0.95 MiB). 85 * Note: As with all `bytes` fields, this field is represented as pure 86 * binary in Protocol Buffers and base64-encoded string in JSON. For 87 * example, `abc123!?$*&()'-=@~` should be represented as 88 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 89 * https://developers.google.com/protocol-buffers/docs/proto3#json. 90 * </pre> 91 * 92 * <code>bytes raw_bytes = 2;</code> 93 * 94 * @return Whether the rawBytes field is set. 95 */ hasRawBytes()96 boolean hasRawBytes(); 97 /** 98 * 99 * 100 * <pre> 101 * The content represented as a stream of bytes. The maximum length is 102 * 1,000,000 bytes (1 MB / ~0.95 MiB). 103 * Note: As with all `bytes` fields, this field is represented as pure 104 * binary in Protocol Buffers and base64-encoded string in JSON. For 105 * example, `abc123!?$*&()'-=@~` should be represented as 106 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 107 * https://developers.google.com/protocol-buffers/docs/proto3#json. 108 * </pre> 109 * 110 * <code>bytes raw_bytes = 2;</code> 111 * 112 * @return The rawBytes. 113 */ getRawBytes()114 com.google.protobuf.ByteString getRawBytes(); 115 116 /** 117 * 118 * 119 * <pre> 120 * The URI of the content. Only Cloud Storage URIs (e.g. 121 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 122 * is 100 MB. 123 * </pre> 124 * 125 * <code>string uri = 3;</code> 126 * 127 * @return Whether the uri field is set. 128 */ hasUri()129 boolean hasUri(); 130 /** 131 * 132 * 133 * <pre> 134 * The URI of the content. Only Cloud Storage URIs (e.g. 135 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 136 * is 100 MB. 137 * </pre> 138 * 139 * <code>string uri = 3;</code> 140 * 141 * @return The uri. 142 */ getUri()143 java.lang.String getUri(); 144 /** 145 * 146 * 147 * <pre> 148 * The URI of the content. Only Cloud Storage URIs (e.g. 149 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 150 * is 100 MB. 151 * </pre> 152 * 153 * <code>string uri = 3;</code> 154 * 155 * @return The bytes for uri. 156 */ getUriBytes()157 com.google.protobuf.ByteString getUriBytes(); 158 159 /** 160 * 161 * 162 * <pre> 163 * The MIME type of the content. Supported types: 164 * * `application/pdf` (PDF) 165 * * `text/html` (HTML) 166 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 167 * </pre> 168 * 169 * <code>string mime_type = 1;</code> 170 * 171 * @return The mimeType. 172 */ getMimeType()173 java.lang.String getMimeType(); 174 /** 175 * 176 * 177 * <pre> 178 * The MIME type of the content. Supported types: 179 * * `application/pdf` (PDF) 180 * * `text/html` (HTML) 181 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 182 * </pre> 183 * 184 * <code>string mime_type = 1;</code> 185 * 186 * @return The bytes for mimeType. 187 */ getMimeTypeBytes()188 com.google.protobuf.ByteString getMimeTypeBytes(); 189 getContentCase()190 public com.google.cloud.discoveryengine.v1beta.Document.Content.ContentCase getContentCase(); 191 } 192 /** 193 * 194 * 195 * <pre> 196 * Unstructured data linked to this document. 197 * </pre> 198 * 199 * Protobuf type {@code google.cloud.discoveryengine.v1beta.Document.Content} 200 */ 201 public static final class Content extends com.google.protobuf.GeneratedMessageV3 202 implements 203 // @@protoc_insertion_point(message_implements:google.cloud.discoveryengine.v1beta.Document.Content) 204 ContentOrBuilder { 205 private static final long serialVersionUID = 0L; 206 // Use Content.newBuilder() to construct. Content(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)207 private Content(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 208 super(builder); 209 } 210 Content()211 private Content() { 212 mimeType_ = ""; 213 } 214 215 @java.lang.Override 216 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)217 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 218 return new Content(); 219 } 220 221 @java.lang.Override getUnknownFields()222 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 223 return this.unknownFields; 224 } 225 getDescriptor()226 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 227 return com.google.cloud.discoveryengine.v1beta.DocumentProto 228 .internal_static_google_cloud_discoveryengine_v1beta_Document_Content_descriptor; 229 } 230 231 @java.lang.Override 232 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()233 internalGetFieldAccessorTable() { 234 return com.google.cloud.discoveryengine.v1beta.DocumentProto 235 .internal_static_google_cloud_discoveryengine_v1beta_Document_Content_fieldAccessorTable 236 .ensureFieldAccessorsInitialized( 237 com.google.cloud.discoveryengine.v1beta.Document.Content.class, 238 com.google.cloud.discoveryengine.v1beta.Document.Content.Builder.class); 239 } 240 241 private int contentCase_ = 0; 242 private java.lang.Object content_; 243 244 public enum ContentCase 245 implements 246 com.google.protobuf.Internal.EnumLite, 247 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 248 RAW_BYTES(2), 249 URI(3), 250 CONTENT_NOT_SET(0); 251 private final int value; 252 ContentCase(int value)253 private ContentCase(int value) { 254 this.value = value; 255 } 256 /** 257 * @param value The number of the enum to look for. 258 * @return The enum associated with the given number. 259 * @deprecated Use {@link #forNumber(int)} instead. 260 */ 261 @java.lang.Deprecated valueOf(int value)262 public static ContentCase valueOf(int value) { 263 return forNumber(value); 264 } 265 forNumber(int value)266 public static ContentCase forNumber(int value) { 267 switch (value) { 268 case 2: 269 return RAW_BYTES; 270 case 3: 271 return URI; 272 case 0: 273 return CONTENT_NOT_SET; 274 default: 275 return null; 276 } 277 } 278 getNumber()279 public int getNumber() { 280 return this.value; 281 } 282 }; 283 getContentCase()284 public ContentCase getContentCase() { 285 return ContentCase.forNumber(contentCase_); 286 } 287 288 public static final int RAW_BYTES_FIELD_NUMBER = 2; 289 /** 290 * 291 * 292 * <pre> 293 * The content represented as a stream of bytes. The maximum length is 294 * 1,000,000 bytes (1 MB / ~0.95 MiB). 295 * Note: As with all `bytes` fields, this field is represented as pure 296 * binary in Protocol Buffers and base64-encoded string in JSON. For 297 * example, `abc123!?$*&()'-=@~` should be represented as 298 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 299 * https://developers.google.com/protocol-buffers/docs/proto3#json. 300 * </pre> 301 * 302 * <code>bytes raw_bytes = 2;</code> 303 * 304 * @return Whether the rawBytes field is set. 305 */ 306 @java.lang.Override hasRawBytes()307 public boolean hasRawBytes() { 308 return contentCase_ == 2; 309 } 310 /** 311 * 312 * 313 * <pre> 314 * The content represented as a stream of bytes. The maximum length is 315 * 1,000,000 bytes (1 MB / ~0.95 MiB). 316 * Note: As with all `bytes` fields, this field is represented as pure 317 * binary in Protocol Buffers and base64-encoded string in JSON. For 318 * example, `abc123!?$*&()'-=@~` should be represented as 319 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 320 * https://developers.google.com/protocol-buffers/docs/proto3#json. 321 * </pre> 322 * 323 * <code>bytes raw_bytes = 2;</code> 324 * 325 * @return The rawBytes. 326 */ 327 @java.lang.Override getRawBytes()328 public com.google.protobuf.ByteString getRawBytes() { 329 if (contentCase_ == 2) { 330 return (com.google.protobuf.ByteString) content_; 331 } 332 return com.google.protobuf.ByteString.EMPTY; 333 } 334 335 public static final int URI_FIELD_NUMBER = 3; 336 /** 337 * 338 * 339 * <pre> 340 * The URI of the content. Only Cloud Storage URIs (e.g. 341 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 342 * is 100 MB. 343 * </pre> 344 * 345 * <code>string uri = 3;</code> 346 * 347 * @return Whether the uri field is set. 348 */ hasUri()349 public boolean hasUri() { 350 return contentCase_ == 3; 351 } 352 /** 353 * 354 * 355 * <pre> 356 * The URI of the content. Only Cloud Storage URIs (e.g. 357 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 358 * is 100 MB. 359 * </pre> 360 * 361 * <code>string uri = 3;</code> 362 * 363 * @return The uri. 364 */ getUri()365 public java.lang.String getUri() { 366 java.lang.Object ref = ""; 367 if (contentCase_ == 3) { 368 ref = content_; 369 } 370 if (ref instanceof java.lang.String) { 371 return (java.lang.String) ref; 372 } else { 373 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 374 java.lang.String s = bs.toStringUtf8(); 375 if (contentCase_ == 3) { 376 content_ = s; 377 } 378 return s; 379 } 380 } 381 /** 382 * 383 * 384 * <pre> 385 * The URI of the content. Only Cloud Storage URIs (e.g. 386 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 387 * is 100 MB. 388 * </pre> 389 * 390 * <code>string uri = 3;</code> 391 * 392 * @return The bytes for uri. 393 */ getUriBytes()394 public com.google.protobuf.ByteString getUriBytes() { 395 java.lang.Object ref = ""; 396 if (contentCase_ == 3) { 397 ref = content_; 398 } 399 if (ref instanceof java.lang.String) { 400 com.google.protobuf.ByteString b = 401 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 402 if (contentCase_ == 3) { 403 content_ = b; 404 } 405 return b; 406 } else { 407 return (com.google.protobuf.ByteString) ref; 408 } 409 } 410 411 public static final int MIME_TYPE_FIELD_NUMBER = 1; 412 413 @SuppressWarnings("serial") 414 private volatile java.lang.Object mimeType_ = ""; 415 /** 416 * 417 * 418 * <pre> 419 * The MIME type of the content. Supported types: 420 * * `application/pdf` (PDF) 421 * * `text/html` (HTML) 422 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 423 * </pre> 424 * 425 * <code>string mime_type = 1;</code> 426 * 427 * @return The mimeType. 428 */ 429 @java.lang.Override getMimeType()430 public java.lang.String getMimeType() { 431 java.lang.Object ref = mimeType_; 432 if (ref instanceof java.lang.String) { 433 return (java.lang.String) ref; 434 } else { 435 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 436 java.lang.String s = bs.toStringUtf8(); 437 mimeType_ = s; 438 return s; 439 } 440 } 441 /** 442 * 443 * 444 * <pre> 445 * The MIME type of the content. Supported types: 446 * * `application/pdf` (PDF) 447 * * `text/html` (HTML) 448 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 449 * </pre> 450 * 451 * <code>string mime_type = 1;</code> 452 * 453 * @return The bytes for mimeType. 454 */ 455 @java.lang.Override getMimeTypeBytes()456 public com.google.protobuf.ByteString getMimeTypeBytes() { 457 java.lang.Object ref = mimeType_; 458 if (ref instanceof java.lang.String) { 459 com.google.protobuf.ByteString b = 460 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 461 mimeType_ = b; 462 return b; 463 } else { 464 return (com.google.protobuf.ByteString) ref; 465 } 466 } 467 468 private byte memoizedIsInitialized = -1; 469 470 @java.lang.Override isInitialized()471 public final boolean isInitialized() { 472 byte isInitialized = memoizedIsInitialized; 473 if (isInitialized == 1) return true; 474 if (isInitialized == 0) return false; 475 476 memoizedIsInitialized = 1; 477 return true; 478 } 479 480 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)481 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 482 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { 483 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mimeType_); 484 } 485 if (contentCase_ == 2) { 486 output.writeBytes(2, (com.google.protobuf.ByteString) content_); 487 } 488 if (contentCase_ == 3) { 489 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); 490 } 491 getUnknownFields().writeTo(output); 492 } 493 494 @java.lang.Override getSerializedSize()495 public int getSerializedSize() { 496 int size = memoizedSize; 497 if (size != -1) return size; 498 499 size = 0; 500 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { 501 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mimeType_); 502 } 503 if (contentCase_ == 2) { 504 size += 505 com.google.protobuf.CodedOutputStream.computeBytesSize( 506 2, (com.google.protobuf.ByteString) content_); 507 } 508 if (contentCase_ == 3) { 509 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); 510 } 511 size += getUnknownFields().getSerializedSize(); 512 memoizedSize = size; 513 return size; 514 } 515 516 @java.lang.Override equals(final java.lang.Object obj)517 public boolean equals(final java.lang.Object obj) { 518 if (obj == this) { 519 return true; 520 } 521 if (!(obj instanceof com.google.cloud.discoveryengine.v1beta.Document.Content)) { 522 return super.equals(obj); 523 } 524 com.google.cloud.discoveryengine.v1beta.Document.Content other = 525 (com.google.cloud.discoveryengine.v1beta.Document.Content) obj; 526 527 if (!getMimeType().equals(other.getMimeType())) return false; 528 if (!getContentCase().equals(other.getContentCase())) return false; 529 switch (contentCase_) { 530 case 2: 531 if (!getRawBytes().equals(other.getRawBytes())) return false; 532 break; 533 case 3: 534 if (!getUri().equals(other.getUri())) return false; 535 break; 536 case 0: 537 default: 538 } 539 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 540 return true; 541 } 542 543 @java.lang.Override hashCode()544 public int hashCode() { 545 if (memoizedHashCode != 0) { 546 return memoizedHashCode; 547 } 548 int hash = 41; 549 hash = (19 * hash) + getDescriptor().hashCode(); 550 hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; 551 hash = (53 * hash) + getMimeType().hashCode(); 552 switch (contentCase_) { 553 case 2: 554 hash = (37 * hash) + RAW_BYTES_FIELD_NUMBER; 555 hash = (53 * hash) + getRawBytes().hashCode(); 556 break; 557 case 3: 558 hash = (37 * hash) + URI_FIELD_NUMBER; 559 hash = (53 * hash) + getUri().hashCode(); 560 break; 561 case 0: 562 default: 563 } 564 hash = (29 * hash) + getUnknownFields().hashCode(); 565 memoizedHashCode = hash; 566 return hash; 567 } 568 parseFrom( java.nio.ByteBuffer data)569 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 570 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 571 return PARSER.parseFrom(data); 572 } 573 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)574 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 575 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 576 throws com.google.protobuf.InvalidProtocolBufferException { 577 return PARSER.parseFrom(data, extensionRegistry); 578 } 579 parseFrom( com.google.protobuf.ByteString data)580 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 581 com.google.protobuf.ByteString data) 582 throws com.google.protobuf.InvalidProtocolBufferException { 583 return PARSER.parseFrom(data); 584 } 585 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)586 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 587 com.google.protobuf.ByteString data, 588 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 589 throws com.google.protobuf.InvalidProtocolBufferException { 590 return PARSER.parseFrom(data, extensionRegistry); 591 } 592 parseFrom(byte[] data)593 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom(byte[] data) 594 throws com.google.protobuf.InvalidProtocolBufferException { 595 return PARSER.parseFrom(data); 596 } 597 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)598 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 599 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 600 throws com.google.protobuf.InvalidProtocolBufferException { 601 return PARSER.parseFrom(data, extensionRegistry); 602 } 603 parseFrom( java.io.InputStream input)604 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 605 java.io.InputStream input) throws java.io.IOException { 606 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 607 } 608 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)609 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 610 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 611 throws java.io.IOException { 612 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 613 PARSER, input, extensionRegistry); 614 } 615 parseDelimitedFrom( java.io.InputStream input)616 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseDelimitedFrom( 617 java.io.InputStream input) throws java.io.IOException { 618 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 619 } 620 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)621 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseDelimitedFrom( 622 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 623 throws java.io.IOException { 624 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 625 PARSER, input, extensionRegistry); 626 } 627 parseFrom( com.google.protobuf.CodedInputStream input)628 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 629 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 630 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 631 } 632 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)633 public static com.google.cloud.discoveryengine.v1beta.Document.Content parseFrom( 634 com.google.protobuf.CodedInputStream input, 635 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 636 throws java.io.IOException { 637 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 638 PARSER, input, extensionRegistry); 639 } 640 641 @java.lang.Override newBuilderForType()642 public Builder newBuilderForType() { 643 return newBuilder(); 644 } 645 newBuilder()646 public static Builder newBuilder() { 647 return DEFAULT_INSTANCE.toBuilder(); 648 } 649 newBuilder( com.google.cloud.discoveryengine.v1beta.Document.Content prototype)650 public static Builder newBuilder( 651 com.google.cloud.discoveryengine.v1beta.Document.Content prototype) { 652 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 653 } 654 655 @java.lang.Override toBuilder()656 public Builder toBuilder() { 657 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 658 } 659 660 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)661 protected Builder newBuilderForType( 662 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 663 Builder builder = new Builder(parent); 664 return builder; 665 } 666 /** 667 * 668 * 669 * <pre> 670 * Unstructured data linked to this document. 671 * </pre> 672 * 673 * Protobuf type {@code google.cloud.discoveryengine.v1beta.Document.Content} 674 */ 675 public static final class Builder 676 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 677 implements 678 // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.Document.Content) 679 com.google.cloud.discoveryengine.v1beta.Document.ContentOrBuilder { getDescriptor()680 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 681 return com.google.cloud.discoveryengine.v1beta.DocumentProto 682 .internal_static_google_cloud_discoveryengine_v1beta_Document_Content_descriptor; 683 } 684 685 @java.lang.Override 686 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()687 internalGetFieldAccessorTable() { 688 return com.google.cloud.discoveryengine.v1beta.DocumentProto 689 .internal_static_google_cloud_discoveryengine_v1beta_Document_Content_fieldAccessorTable 690 .ensureFieldAccessorsInitialized( 691 com.google.cloud.discoveryengine.v1beta.Document.Content.class, 692 com.google.cloud.discoveryengine.v1beta.Document.Content.Builder.class); 693 } 694 695 // Construct using com.google.cloud.discoveryengine.v1beta.Document.Content.newBuilder() Builder()696 private Builder() {} 697 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)698 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 699 super(parent); 700 } 701 702 @java.lang.Override clear()703 public Builder clear() { 704 super.clear(); 705 bitField0_ = 0; 706 mimeType_ = ""; 707 contentCase_ = 0; 708 content_ = null; 709 return this; 710 } 711 712 @java.lang.Override getDescriptorForType()713 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 714 return com.google.cloud.discoveryengine.v1beta.DocumentProto 715 .internal_static_google_cloud_discoveryengine_v1beta_Document_Content_descriptor; 716 } 717 718 @java.lang.Override getDefaultInstanceForType()719 public com.google.cloud.discoveryengine.v1beta.Document.Content getDefaultInstanceForType() { 720 return com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance(); 721 } 722 723 @java.lang.Override build()724 public com.google.cloud.discoveryengine.v1beta.Document.Content build() { 725 com.google.cloud.discoveryengine.v1beta.Document.Content result = buildPartial(); 726 if (!result.isInitialized()) { 727 throw newUninitializedMessageException(result); 728 } 729 return result; 730 } 731 732 @java.lang.Override buildPartial()733 public com.google.cloud.discoveryengine.v1beta.Document.Content buildPartial() { 734 com.google.cloud.discoveryengine.v1beta.Document.Content result = 735 new com.google.cloud.discoveryengine.v1beta.Document.Content(this); 736 if (bitField0_ != 0) { 737 buildPartial0(result); 738 } 739 buildPartialOneofs(result); 740 onBuilt(); 741 return result; 742 } 743 buildPartial0(com.google.cloud.discoveryengine.v1beta.Document.Content result)744 private void buildPartial0(com.google.cloud.discoveryengine.v1beta.Document.Content result) { 745 int from_bitField0_ = bitField0_; 746 if (((from_bitField0_ & 0x00000004) != 0)) { 747 result.mimeType_ = mimeType_; 748 } 749 } 750 buildPartialOneofs( com.google.cloud.discoveryengine.v1beta.Document.Content result)751 private void buildPartialOneofs( 752 com.google.cloud.discoveryengine.v1beta.Document.Content result) { 753 result.contentCase_ = contentCase_; 754 result.content_ = this.content_; 755 } 756 757 @java.lang.Override clone()758 public Builder clone() { 759 return super.clone(); 760 } 761 762 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)763 public Builder setField( 764 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 765 return super.setField(field, value); 766 } 767 768 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)769 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 770 return super.clearField(field); 771 } 772 773 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)774 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 775 return super.clearOneof(oneof); 776 } 777 778 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)779 public Builder setRepeatedField( 780 com.google.protobuf.Descriptors.FieldDescriptor field, 781 int index, 782 java.lang.Object value) { 783 return super.setRepeatedField(field, index, value); 784 } 785 786 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)787 public Builder addRepeatedField( 788 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 789 return super.addRepeatedField(field, value); 790 } 791 792 @java.lang.Override mergeFrom(com.google.protobuf.Message other)793 public Builder mergeFrom(com.google.protobuf.Message other) { 794 if (other instanceof com.google.cloud.discoveryengine.v1beta.Document.Content) { 795 return mergeFrom((com.google.cloud.discoveryengine.v1beta.Document.Content) other); 796 } else { 797 super.mergeFrom(other); 798 return this; 799 } 800 } 801 mergeFrom(com.google.cloud.discoveryengine.v1beta.Document.Content other)802 public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.Document.Content other) { 803 if (other == com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance()) 804 return this; 805 if (!other.getMimeType().isEmpty()) { 806 mimeType_ = other.mimeType_; 807 bitField0_ |= 0x00000004; 808 onChanged(); 809 } 810 switch (other.getContentCase()) { 811 case RAW_BYTES: 812 { 813 setRawBytes(other.getRawBytes()); 814 break; 815 } 816 case URI: 817 { 818 contentCase_ = 3; 819 content_ = other.content_; 820 onChanged(); 821 break; 822 } 823 case CONTENT_NOT_SET: 824 { 825 break; 826 } 827 } 828 this.mergeUnknownFields(other.getUnknownFields()); 829 onChanged(); 830 return this; 831 } 832 833 @java.lang.Override isInitialized()834 public final boolean isInitialized() { 835 return true; 836 } 837 838 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)839 public Builder mergeFrom( 840 com.google.protobuf.CodedInputStream input, 841 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 842 throws java.io.IOException { 843 if (extensionRegistry == null) { 844 throw new java.lang.NullPointerException(); 845 } 846 try { 847 boolean done = false; 848 while (!done) { 849 int tag = input.readTag(); 850 switch (tag) { 851 case 0: 852 done = true; 853 break; 854 case 10: 855 { 856 mimeType_ = input.readStringRequireUtf8(); 857 bitField0_ |= 0x00000004; 858 break; 859 } // case 10 860 case 18: 861 { 862 content_ = input.readBytes(); 863 contentCase_ = 2; 864 break; 865 } // case 18 866 case 26: 867 { 868 java.lang.String s = input.readStringRequireUtf8(); 869 contentCase_ = 3; 870 content_ = s; 871 break; 872 } // case 26 873 default: 874 { 875 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 876 done = true; // was an endgroup tag 877 } 878 break; 879 } // default: 880 } // switch (tag) 881 } // while (!done) 882 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 883 throw e.unwrapIOException(); 884 } finally { 885 onChanged(); 886 } // finally 887 return this; 888 } 889 890 private int contentCase_ = 0; 891 private java.lang.Object content_; 892 getContentCase()893 public ContentCase getContentCase() { 894 return ContentCase.forNumber(contentCase_); 895 } 896 clearContent()897 public Builder clearContent() { 898 contentCase_ = 0; 899 content_ = null; 900 onChanged(); 901 return this; 902 } 903 904 private int bitField0_; 905 906 /** 907 * 908 * 909 * <pre> 910 * The content represented as a stream of bytes. The maximum length is 911 * 1,000,000 bytes (1 MB / ~0.95 MiB). 912 * Note: As with all `bytes` fields, this field is represented as pure 913 * binary in Protocol Buffers and base64-encoded string in JSON. For 914 * example, `abc123!?$*&()'-=@~` should be represented as 915 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 916 * https://developers.google.com/protocol-buffers/docs/proto3#json. 917 * </pre> 918 * 919 * <code>bytes raw_bytes = 2;</code> 920 * 921 * @return Whether the rawBytes field is set. 922 */ hasRawBytes()923 public boolean hasRawBytes() { 924 return contentCase_ == 2; 925 } 926 /** 927 * 928 * 929 * <pre> 930 * The content represented as a stream of bytes. The maximum length is 931 * 1,000,000 bytes (1 MB / ~0.95 MiB). 932 * Note: As with all `bytes` fields, this field is represented as pure 933 * binary in Protocol Buffers and base64-encoded string in JSON. For 934 * example, `abc123!?$*&()'-=@~` should be represented as 935 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 936 * https://developers.google.com/protocol-buffers/docs/proto3#json. 937 * </pre> 938 * 939 * <code>bytes raw_bytes = 2;</code> 940 * 941 * @return The rawBytes. 942 */ getRawBytes()943 public com.google.protobuf.ByteString getRawBytes() { 944 if (contentCase_ == 2) { 945 return (com.google.protobuf.ByteString) content_; 946 } 947 return com.google.protobuf.ByteString.EMPTY; 948 } 949 /** 950 * 951 * 952 * <pre> 953 * The content represented as a stream of bytes. The maximum length is 954 * 1,000,000 bytes (1 MB / ~0.95 MiB). 955 * Note: As with all `bytes` fields, this field is represented as pure 956 * binary in Protocol Buffers and base64-encoded string in JSON. For 957 * example, `abc123!?$*&()'-=@~` should be represented as 958 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 959 * https://developers.google.com/protocol-buffers/docs/proto3#json. 960 * </pre> 961 * 962 * <code>bytes raw_bytes = 2;</code> 963 * 964 * @param value The rawBytes to set. 965 * @return This builder for chaining. 966 */ setRawBytes(com.google.protobuf.ByteString value)967 public Builder setRawBytes(com.google.protobuf.ByteString value) { 968 if (value == null) { 969 throw new NullPointerException(); 970 } 971 contentCase_ = 2; 972 content_ = value; 973 onChanged(); 974 return this; 975 } 976 /** 977 * 978 * 979 * <pre> 980 * The content represented as a stream of bytes. The maximum length is 981 * 1,000,000 bytes (1 MB / ~0.95 MiB). 982 * Note: As with all `bytes` fields, this field is represented as pure 983 * binary in Protocol Buffers and base64-encoded string in JSON. For 984 * example, `abc123!?$*&()'-=@~` should be represented as 985 * `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See 986 * https://developers.google.com/protocol-buffers/docs/proto3#json. 987 * </pre> 988 * 989 * <code>bytes raw_bytes = 2;</code> 990 * 991 * @return This builder for chaining. 992 */ clearRawBytes()993 public Builder clearRawBytes() { 994 if (contentCase_ == 2) { 995 contentCase_ = 0; 996 content_ = null; 997 onChanged(); 998 } 999 return this; 1000 } 1001 1002 /** 1003 * 1004 * 1005 * <pre> 1006 * The URI of the content. Only Cloud Storage URIs (e.g. 1007 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 1008 * is 100 MB. 1009 * </pre> 1010 * 1011 * <code>string uri = 3;</code> 1012 * 1013 * @return Whether the uri field is set. 1014 */ 1015 @java.lang.Override hasUri()1016 public boolean hasUri() { 1017 return contentCase_ == 3; 1018 } 1019 /** 1020 * 1021 * 1022 * <pre> 1023 * The URI of the content. Only Cloud Storage URIs (e.g. 1024 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 1025 * is 100 MB. 1026 * </pre> 1027 * 1028 * <code>string uri = 3;</code> 1029 * 1030 * @return The uri. 1031 */ 1032 @java.lang.Override getUri()1033 public java.lang.String getUri() { 1034 java.lang.Object ref = ""; 1035 if (contentCase_ == 3) { 1036 ref = content_; 1037 } 1038 if (!(ref instanceof java.lang.String)) { 1039 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1040 java.lang.String s = bs.toStringUtf8(); 1041 if (contentCase_ == 3) { 1042 content_ = s; 1043 } 1044 return s; 1045 } else { 1046 return (java.lang.String) ref; 1047 } 1048 } 1049 /** 1050 * 1051 * 1052 * <pre> 1053 * The URI of the content. Only Cloud Storage URIs (e.g. 1054 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 1055 * is 100 MB. 1056 * </pre> 1057 * 1058 * <code>string uri = 3;</code> 1059 * 1060 * @return The bytes for uri. 1061 */ 1062 @java.lang.Override getUriBytes()1063 public com.google.protobuf.ByteString getUriBytes() { 1064 java.lang.Object ref = ""; 1065 if (contentCase_ == 3) { 1066 ref = content_; 1067 } 1068 if (ref instanceof String) { 1069 com.google.protobuf.ByteString b = 1070 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1071 if (contentCase_ == 3) { 1072 content_ = b; 1073 } 1074 return b; 1075 } else { 1076 return (com.google.protobuf.ByteString) ref; 1077 } 1078 } 1079 /** 1080 * 1081 * 1082 * <pre> 1083 * The URI of the content. Only Cloud Storage URIs (e.g. 1084 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 1085 * is 100 MB. 1086 * </pre> 1087 * 1088 * <code>string uri = 3;</code> 1089 * 1090 * @param value The uri to set. 1091 * @return This builder for chaining. 1092 */ setUri(java.lang.String value)1093 public Builder setUri(java.lang.String value) { 1094 if (value == null) { 1095 throw new NullPointerException(); 1096 } 1097 contentCase_ = 3; 1098 content_ = value; 1099 onChanged(); 1100 return this; 1101 } 1102 /** 1103 * 1104 * 1105 * <pre> 1106 * The URI of the content. Only Cloud Storage URIs (e.g. 1107 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 1108 * is 100 MB. 1109 * </pre> 1110 * 1111 * <code>string uri = 3;</code> 1112 * 1113 * @return This builder for chaining. 1114 */ clearUri()1115 public Builder clearUri() { 1116 if (contentCase_ == 3) { 1117 contentCase_ = 0; 1118 content_ = null; 1119 onChanged(); 1120 } 1121 return this; 1122 } 1123 /** 1124 * 1125 * 1126 * <pre> 1127 * The URI of the content. Only Cloud Storage URIs (e.g. 1128 * `gs://bucket-name/path/to/file`) are supported. The maximum file size 1129 * is 100 MB. 1130 * </pre> 1131 * 1132 * <code>string uri = 3;</code> 1133 * 1134 * @param value The bytes for uri to set. 1135 * @return This builder for chaining. 1136 */ setUriBytes(com.google.protobuf.ByteString value)1137 public Builder setUriBytes(com.google.protobuf.ByteString value) { 1138 if (value == null) { 1139 throw new NullPointerException(); 1140 } 1141 checkByteStringIsUtf8(value); 1142 contentCase_ = 3; 1143 content_ = value; 1144 onChanged(); 1145 return this; 1146 } 1147 1148 private java.lang.Object mimeType_ = ""; 1149 /** 1150 * 1151 * 1152 * <pre> 1153 * The MIME type of the content. Supported types: 1154 * * `application/pdf` (PDF) 1155 * * `text/html` (HTML) 1156 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 1157 * </pre> 1158 * 1159 * <code>string mime_type = 1;</code> 1160 * 1161 * @return The mimeType. 1162 */ getMimeType()1163 public java.lang.String getMimeType() { 1164 java.lang.Object ref = mimeType_; 1165 if (!(ref instanceof java.lang.String)) { 1166 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1167 java.lang.String s = bs.toStringUtf8(); 1168 mimeType_ = s; 1169 return s; 1170 } else { 1171 return (java.lang.String) ref; 1172 } 1173 } 1174 /** 1175 * 1176 * 1177 * <pre> 1178 * The MIME type of the content. Supported types: 1179 * * `application/pdf` (PDF) 1180 * * `text/html` (HTML) 1181 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 1182 * </pre> 1183 * 1184 * <code>string mime_type = 1;</code> 1185 * 1186 * @return The bytes for mimeType. 1187 */ getMimeTypeBytes()1188 public com.google.protobuf.ByteString getMimeTypeBytes() { 1189 java.lang.Object ref = mimeType_; 1190 if (ref instanceof String) { 1191 com.google.protobuf.ByteString b = 1192 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1193 mimeType_ = b; 1194 return b; 1195 } else { 1196 return (com.google.protobuf.ByteString) ref; 1197 } 1198 } 1199 /** 1200 * 1201 * 1202 * <pre> 1203 * The MIME type of the content. Supported types: 1204 * * `application/pdf` (PDF) 1205 * * `text/html` (HTML) 1206 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 1207 * </pre> 1208 * 1209 * <code>string mime_type = 1;</code> 1210 * 1211 * @param value The mimeType to set. 1212 * @return This builder for chaining. 1213 */ setMimeType(java.lang.String value)1214 public Builder setMimeType(java.lang.String value) { 1215 if (value == null) { 1216 throw new NullPointerException(); 1217 } 1218 mimeType_ = value; 1219 bitField0_ |= 0x00000004; 1220 onChanged(); 1221 return this; 1222 } 1223 /** 1224 * 1225 * 1226 * <pre> 1227 * The MIME type of the content. Supported types: 1228 * * `application/pdf` (PDF) 1229 * * `text/html` (HTML) 1230 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 1231 * </pre> 1232 * 1233 * <code>string mime_type = 1;</code> 1234 * 1235 * @return This builder for chaining. 1236 */ clearMimeType()1237 public Builder clearMimeType() { 1238 mimeType_ = getDefaultInstance().getMimeType(); 1239 bitField0_ = (bitField0_ & ~0x00000004); 1240 onChanged(); 1241 return this; 1242 } 1243 /** 1244 * 1245 * 1246 * <pre> 1247 * The MIME type of the content. Supported types: 1248 * * `application/pdf` (PDF) 1249 * * `text/html` (HTML) 1250 * See https://www.iana.org/assignments/media-types/media-types.xhtml. 1251 * </pre> 1252 * 1253 * <code>string mime_type = 1;</code> 1254 * 1255 * @param value The bytes for mimeType to set. 1256 * @return This builder for chaining. 1257 */ setMimeTypeBytes(com.google.protobuf.ByteString value)1258 public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { 1259 if (value == null) { 1260 throw new NullPointerException(); 1261 } 1262 checkByteStringIsUtf8(value); 1263 mimeType_ = value; 1264 bitField0_ |= 0x00000004; 1265 onChanged(); 1266 return this; 1267 } 1268 1269 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1270 public final Builder setUnknownFields( 1271 final com.google.protobuf.UnknownFieldSet unknownFields) { 1272 return super.setUnknownFields(unknownFields); 1273 } 1274 1275 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1276 public final Builder mergeUnknownFields( 1277 final com.google.protobuf.UnknownFieldSet unknownFields) { 1278 return super.mergeUnknownFields(unknownFields); 1279 } 1280 1281 // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.Document.Content) 1282 } 1283 1284 // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.Document.Content) 1285 private static final com.google.cloud.discoveryengine.v1beta.Document.Content DEFAULT_INSTANCE; 1286 1287 static { 1288 DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.Document.Content(); 1289 } 1290 getDefaultInstance()1291 public static com.google.cloud.discoveryengine.v1beta.Document.Content getDefaultInstance() { 1292 return DEFAULT_INSTANCE; 1293 } 1294 1295 private static final com.google.protobuf.Parser<Content> PARSER = 1296 new com.google.protobuf.AbstractParser<Content>() { 1297 @java.lang.Override 1298 public Content parsePartialFrom( 1299 com.google.protobuf.CodedInputStream input, 1300 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1301 throws com.google.protobuf.InvalidProtocolBufferException { 1302 Builder builder = newBuilder(); 1303 try { 1304 builder.mergeFrom(input, extensionRegistry); 1305 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1306 throw e.setUnfinishedMessage(builder.buildPartial()); 1307 } catch (com.google.protobuf.UninitializedMessageException e) { 1308 throw e.asInvalidProtocolBufferException() 1309 .setUnfinishedMessage(builder.buildPartial()); 1310 } catch (java.io.IOException e) { 1311 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1312 .setUnfinishedMessage(builder.buildPartial()); 1313 } 1314 return builder.buildPartial(); 1315 } 1316 }; 1317 parser()1318 public static com.google.protobuf.Parser<Content> parser() { 1319 return PARSER; 1320 } 1321 1322 @java.lang.Override getParserForType()1323 public com.google.protobuf.Parser<Content> getParserForType() { 1324 return PARSER; 1325 } 1326 1327 @java.lang.Override getDefaultInstanceForType()1328 public com.google.cloud.discoveryengine.v1beta.Document.Content getDefaultInstanceForType() { 1329 return DEFAULT_INSTANCE; 1330 } 1331 } 1332 1333 private int dataCase_ = 0; 1334 private java.lang.Object data_; 1335 1336 public enum DataCase 1337 implements 1338 com.google.protobuf.Internal.EnumLite, 1339 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 1340 STRUCT_DATA(4), 1341 JSON_DATA(5), 1342 DATA_NOT_SET(0); 1343 private final int value; 1344 DataCase(int value)1345 private DataCase(int value) { 1346 this.value = value; 1347 } 1348 /** 1349 * @param value The number of the enum to look for. 1350 * @return The enum associated with the given number. 1351 * @deprecated Use {@link #forNumber(int)} instead. 1352 */ 1353 @java.lang.Deprecated valueOf(int value)1354 public static DataCase valueOf(int value) { 1355 return forNumber(value); 1356 } 1357 forNumber(int value)1358 public static DataCase forNumber(int value) { 1359 switch (value) { 1360 case 4: 1361 return STRUCT_DATA; 1362 case 5: 1363 return JSON_DATA; 1364 case 0: 1365 return DATA_NOT_SET; 1366 default: 1367 return null; 1368 } 1369 } 1370 getNumber()1371 public int getNumber() { 1372 return this.value; 1373 } 1374 }; 1375 getDataCase()1376 public DataCase getDataCase() { 1377 return DataCase.forNumber(dataCase_); 1378 } 1379 1380 public static final int STRUCT_DATA_FIELD_NUMBER = 4; 1381 /** 1382 * 1383 * 1384 * <pre> 1385 * The structured JSON data for the document. It should conform to the 1386 * registered 1387 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 1388 * `INVALID_ARGUMENT` error is thrown. 1389 * </pre> 1390 * 1391 * <code>.google.protobuf.Struct struct_data = 4;</code> 1392 * 1393 * @return Whether the structData field is set. 1394 */ 1395 @java.lang.Override hasStructData()1396 public boolean hasStructData() { 1397 return dataCase_ == 4; 1398 } 1399 /** 1400 * 1401 * 1402 * <pre> 1403 * The structured JSON data for the document. It should conform to the 1404 * registered 1405 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 1406 * `INVALID_ARGUMENT` error is thrown. 1407 * </pre> 1408 * 1409 * <code>.google.protobuf.Struct struct_data = 4;</code> 1410 * 1411 * @return The structData. 1412 */ 1413 @java.lang.Override getStructData()1414 public com.google.protobuf.Struct getStructData() { 1415 if (dataCase_ == 4) { 1416 return (com.google.protobuf.Struct) data_; 1417 } 1418 return com.google.protobuf.Struct.getDefaultInstance(); 1419 } 1420 /** 1421 * 1422 * 1423 * <pre> 1424 * The structured JSON data for the document. It should conform to the 1425 * registered 1426 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 1427 * `INVALID_ARGUMENT` error is thrown. 1428 * </pre> 1429 * 1430 * <code>.google.protobuf.Struct struct_data = 4;</code> 1431 */ 1432 @java.lang.Override getStructDataOrBuilder()1433 public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { 1434 if (dataCase_ == 4) { 1435 return (com.google.protobuf.Struct) data_; 1436 } 1437 return com.google.protobuf.Struct.getDefaultInstance(); 1438 } 1439 1440 public static final int JSON_DATA_FIELD_NUMBER = 5; 1441 /** 1442 * 1443 * 1444 * <pre> 1445 * The JSON string representation of the document. It should conform to the 1446 * registered 1447 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 1448 * `INVALID_ARGUMENT` error is thrown. 1449 * </pre> 1450 * 1451 * <code>string json_data = 5;</code> 1452 * 1453 * @return Whether the jsonData field is set. 1454 */ hasJsonData()1455 public boolean hasJsonData() { 1456 return dataCase_ == 5; 1457 } 1458 /** 1459 * 1460 * 1461 * <pre> 1462 * The JSON string representation of the document. It should conform to the 1463 * registered 1464 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 1465 * `INVALID_ARGUMENT` error is thrown. 1466 * </pre> 1467 * 1468 * <code>string json_data = 5;</code> 1469 * 1470 * @return The jsonData. 1471 */ getJsonData()1472 public java.lang.String getJsonData() { 1473 java.lang.Object ref = ""; 1474 if (dataCase_ == 5) { 1475 ref = data_; 1476 } 1477 if (ref instanceof java.lang.String) { 1478 return (java.lang.String) ref; 1479 } else { 1480 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1481 java.lang.String s = bs.toStringUtf8(); 1482 if (dataCase_ == 5) { 1483 data_ = s; 1484 } 1485 return s; 1486 } 1487 } 1488 /** 1489 * 1490 * 1491 * <pre> 1492 * The JSON string representation of the document. It should conform to the 1493 * registered 1494 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 1495 * `INVALID_ARGUMENT` error is thrown. 1496 * </pre> 1497 * 1498 * <code>string json_data = 5;</code> 1499 * 1500 * @return The bytes for jsonData. 1501 */ getJsonDataBytes()1502 public com.google.protobuf.ByteString getJsonDataBytes() { 1503 java.lang.Object ref = ""; 1504 if (dataCase_ == 5) { 1505 ref = data_; 1506 } 1507 if (ref instanceof java.lang.String) { 1508 com.google.protobuf.ByteString b = 1509 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1510 if (dataCase_ == 5) { 1511 data_ = b; 1512 } 1513 return b; 1514 } else { 1515 return (com.google.protobuf.ByteString) ref; 1516 } 1517 } 1518 1519 public static final int NAME_FIELD_NUMBER = 1; 1520 1521 @SuppressWarnings("serial") 1522 private volatile java.lang.Object name_ = ""; 1523 /** 1524 * 1525 * 1526 * <pre> 1527 * Immutable. The full resource name of the document. 1528 * Format: 1529 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 1530 * This field must be a UTF-8 encoded string with a length limit of 1024 1531 * characters. 1532 * </pre> 1533 * 1534 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 1535 * 1536 * @return The name. 1537 */ 1538 @java.lang.Override getName()1539 public java.lang.String getName() { 1540 java.lang.Object ref = name_; 1541 if (ref instanceof java.lang.String) { 1542 return (java.lang.String) ref; 1543 } else { 1544 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1545 java.lang.String s = bs.toStringUtf8(); 1546 name_ = s; 1547 return s; 1548 } 1549 } 1550 /** 1551 * 1552 * 1553 * <pre> 1554 * Immutable. The full resource name of the document. 1555 * Format: 1556 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 1557 * This field must be a UTF-8 encoded string with a length limit of 1024 1558 * characters. 1559 * </pre> 1560 * 1561 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 1562 * 1563 * @return The bytes for name. 1564 */ 1565 @java.lang.Override getNameBytes()1566 public com.google.protobuf.ByteString getNameBytes() { 1567 java.lang.Object ref = name_; 1568 if (ref instanceof java.lang.String) { 1569 com.google.protobuf.ByteString b = 1570 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1571 name_ = b; 1572 return b; 1573 } else { 1574 return (com.google.protobuf.ByteString) ref; 1575 } 1576 } 1577 1578 public static final int ID_FIELD_NUMBER = 2; 1579 1580 @SuppressWarnings("serial") 1581 private volatile java.lang.Object id_ = ""; 1582 /** 1583 * 1584 * 1585 * <pre> 1586 * Immutable. The identifier of the document. 1587 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 1588 * standard with a length limit of 63 characters. 1589 * </pre> 1590 * 1591 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 1592 * 1593 * @return The id. 1594 */ 1595 @java.lang.Override getId()1596 public java.lang.String getId() { 1597 java.lang.Object ref = id_; 1598 if (ref instanceof java.lang.String) { 1599 return (java.lang.String) ref; 1600 } else { 1601 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1602 java.lang.String s = bs.toStringUtf8(); 1603 id_ = s; 1604 return s; 1605 } 1606 } 1607 /** 1608 * 1609 * 1610 * <pre> 1611 * Immutable. The identifier of the document. 1612 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 1613 * standard with a length limit of 63 characters. 1614 * </pre> 1615 * 1616 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 1617 * 1618 * @return The bytes for id. 1619 */ 1620 @java.lang.Override getIdBytes()1621 public com.google.protobuf.ByteString getIdBytes() { 1622 java.lang.Object ref = id_; 1623 if (ref instanceof java.lang.String) { 1624 com.google.protobuf.ByteString b = 1625 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1626 id_ = b; 1627 return b; 1628 } else { 1629 return (com.google.protobuf.ByteString) ref; 1630 } 1631 } 1632 1633 public static final int SCHEMA_ID_FIELD_NUMBER = 3; 1634 1635 @SuppressWarnings("serial") 1636 private volatile java.lang.Object schemaId_ = ""; 1637 /** 1638 * 1639 * 1640 * <pre> 1641 * The identifier of the schema located in the same data store. 1642 * </pre> 1643 * 1644 * <code>string schema_id = 3;</code> 1645 * 1646 * @return The schemaId. 1647 */ 1648 @java.lang.Override getSchemaId()1649 public java.lang.String getSchemaId() { 1650 java.lang.Object ref = schemaId_; 1651 if (ref instanceof java.lang.String) { 1652 return (java.lang.String) ref; 1653 } else { 1654 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1655 java.lang.String s = bs.toStringUtf8(); 1656 schemaId_ = s; 1657 return s; 1658 } 1659 } 1660 /** 1661 * 1662 * 1663 * <pre> 1664 * The identifier of the schema located in the same data store. 1665 * </pre> 1666 * 1667 * <code>string schema_id = 3;</code> 1668 * 1669 * @return The bytes for schemaId. 1670 */ 1671 @java.lang.Override getSchemaIdBytes()1672 public com.google.protobuf.ByteString getSchemaIdBytes() { 1673 java.lang.Object ref = schemaId_; 1674 if (ref instanceof java.lang.String) { 1675 com.google.protobuf.ByteString b = 1676 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1677 schemaId_ = b; 1678 return b; 1679 } else { 1680 return (com.google.protobuf.ByteString) ref; 1681 } 1682 } 1683 1684 public static final int CONTENT_FIELD_NUMBER = 10; 1685 private com.google.cloud.discoveryengine.v1beta.Document.Content content_; 1686 /** 1687 * 1688 * 1689 * <pre> 1690 * The unstructured data linked to this document. Content must be set if this 1691 * document is under a 1692 * `CONTENT_REQUIRED` data store. 1693 * </pre> 1694 * 1695 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 1696 * 1697 * @return Whether the content field is set. 1698 */ 1699 @java.lang.Override hasContent()1700 public boolean hasContent() { 1701 return content_ != null; 1702 } 1703 /** 1704 * 1705 * 1706 * <pre> 1707 * The unstructured data linked to this document. Content must be set if this 1708 * document is under a 1709 * `CONTENT_REQUIRED` data store. 1710 * </pre> 1711 * 1712 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 1713 * 1714 * @return The content. 1715 */ 1716 @java.lang.Override getContent()1717 public com.google.cloud.discoveryengine.v1beta.Document.Content getContent() { 1718 return content_ == null 1719 ? com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance() 1720 : content_; 1721 } 1722 /** 1723 * 1724 * 1725 * <pre> 1726 * The unstructured data linked to this document. Content must be set if this 1727 * document is under a 1728 * `CONTENT_REQUIRED` data store. 1729 * </pre> 1730 * 1731 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 1732 */ 1733 @java.lang.Override getContentOrBuilder()1734 public com.google.cloud.discoveryengine.v1beta.Document.ContentOrBuilder getContentOrBuilder() { 1735 return content_ == null 1736 ? com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance() 1737 : content_; 1738 } 1739 1740 public static final int PARENT_DOCUMENT_ID_FIELD_NUMBER = 7; 1741 1742 @SuppressWarnings("serial") 1743 private volatile java.lang.Object parentDocumentId_ = ""; 1744 /** 1745 * 1746 * 1747 * <pre> 1748 * The identifier of the parent document. Currently supports at most two level 1749 * document hierarchy. 1750 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 1751 * standard with a length limit of 63 characters. 1752 * </pre> 1753 * 1754 * <code>string parent_document_id = 7;</code> 1755 * 1756 * @return The parentDocumentId. 1757 */ 1758 @java.lang.Override getParentDocumentId()1759 public java.lang.String getParentDocumentId() { 1760 java.lang.Object ref = parentDocumentId_; 1761 if (ref instanceof java.lang.String) { 1762 return (java.lang.String) ref; 1763 } else { 1764 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1765 java.lang.String s = bs.toStringUtf8(); 1766 parentDocumentId_ = s; 1767 return s; 1768 } 1769 } 1770 /** 1771 * 1772 * 1773 * <pre> 1774 * The identifier of the parent document. Currently supports at most two level 1775 * document hierarchy. 1776 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 1777 * standard with a length limit of 63 characters. 1778 * </pre> 1779 * 1780 * <code>string parent_document_id = 7;</code> 1781 * 1782 * @return The bytes for parentDocumentId. 1783 */ 1784 @java.lang.Override getParentDocumentIdBytes()1785 public com.google.protobuf.ByteString getParentDocumentIdBytes() { 1786 java.lang.Object ref = parentDocumentId_; 1787 if (ref instanceof java.lang.String) { 1788 com.google.protobuf.ByteString b = 1789 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1790 parentDocumentId_ = b; 1791 return b; 1792 } else { 1793 return (com.google.protobuf.ByteString) ref; 1794 } 1795 } 1796 1797 public static final int DERIVED_STRUCT_DATA_FIELD_NUMBER = 6; 1798 private com.google.protobuf.Struct derivedStructData_; 1799 /** 1800 * 1801 * 1802 * <pre> 1803 * Output only. This field is OUTPUT_ONLY. 1804 * It contains derived data that are not in the original input document. 1805 * </pre> 1806 * 1807 * <code> 1808 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1809 * </code> 1810 * 1811 * @return Whether the derivedStructData field is set. 1812 */ 1813 @java.lang.Override hasDerivedStructData()1814 public boolean hasDerivedStructData() { 1815 return derivedStructData_ != null; 1816 } 1817 /** 1818 * 1819 * 1820 * <pre> 1821 * Output only. This field is OUTPUT_ONLY. 1822 * It contains derived data that are not in the original input document. 1823 * </pre> 1824 * 1825 * <code> 1826 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1827 * </code> 1828 * 1829 * @return The derivedStructData. 1830 */ 1831 @java.lang.Override getDerivedStructData()1832 public com.google.protobuf.Struct getDerivedStructData() { 1833 return derivedStructData_ == null 1834 ? com.google.protobuf.Struct.getDefaultInstance() 1835 : derivedStructData_; 1836 } 1837 /** 1838 * 1839 * 1840 * <pre> 1841 * Output only. This field is OUTPUT_ONLY. 1842 * It contains derived data that are not in the original input document. 1843 * </pre> 1844 * 1845 * <code> 1846 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1847 * </code> 1848 */ 1849 @java.lang.Override getDerivedStructDataOrBuilder()1850 public com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder() { 1851 return derivedStructData_ == null 1852 ? com.google.protobuf.Struct.getDefaultInstance() 1853 : derivedStructData_; 1854 } 1855 1856 private byte memoizedIsInitialized = -1; 1857 1858 @java.lang.Override isInitialized()1859 public final boolean isInitialized() { 1860 byte isInitialized = memoizedIsInitialized; 1861 if (isInitialized == 1) return true; 1862 if (isInitialized == 0) return false; 1863 1864 memoizedIsInitialized = 1; 1865 return true; 1866 } 1867 1868 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1869 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1870 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1871 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 1872 } 1873 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { 1874 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); 1875 } 1876 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { 1877 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schemaId_); 1878 } 1879 if (dataCase_ == 4) { 1880 output.writeMessage(4, (com.google.protobuf.Struct) data_); 1881 } 1882 if (dataCase_ == 5) { 1883 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, data_); 1884 } 1885 if (derivedStructData_ != null) { 1886 output.writeMessage(6, getDerivedStructData()); 1887 } 1888 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentDocumentId_)) { 1889 com.google.protobuf.GeneratedMessageV3.writeString(output, 7, parentDocumentId_); 1890 } 1891 if (content_ != null) { 1892 output.writeMessage(10, getContent()); 1893 } 1894 getUnknownFields().writeTo(output); 1895 } 1896 1897 @java.lang.Override getSerializedSize()1898 public int getSerializedSize() { 1899 int size = memoizedSize; 1900 if (size != -1) return size; 1901 1902 size = 0; 1903 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1904 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 1905 } 1906 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { 1907 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); 1908 } 1909 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) { 1910 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schemaId_); 1911 } 1912 if (dataCase_ == 4) { 1913 size += 1914 com.google.protobuf.CodedOutputStream.computeMessageSize( 1915 4, (com.google.protobuf.Struct) data_); 1916 } 1917 if (dataCase_ == 5) { 1918 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, data_); 1919 } 1920 if (derivedStructData_ != null) { 1921 size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDerivedStructData()); 1922 } 1923 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parentDocumentId_)) { 1924 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, parentDocumentId_); 1925 } 1926 if (content_ != null) { 1927 size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getContent()); 1928 } 1929 size += getUnknownFields().getSerializedSize(); 1930 memoizedSize = size; 1931 return size; 1932 } 1933 1934 @java.lang.Override equals(final java.lang.Object obj)1935 public boolean equals(final java.lang.Object obj) { 1936 if (obj == this) { 1937 return true; 1938 } 1939 if (!(obj instanceof com.google.cloud.discoveryengine.v1beta.Document)) { 1940 return super.equals(obj); 1941 } 1942 com.google.cloud.discoveryengine.v1beta.Document other = 1943 (com.google.cloud.discoveryengine.v1beta.Document) obj; 1944 1945 if (!getName().equals(other.getName())) return false; 1946 if (!getId().equals(other.getId())) return false; 1947 if (!getSchemaId().equals(other.getSchemaId())) return false; 1948 if (hasContent() != other.hasContent()) return false; 1949 if (hasContent()) { 1950 if (!getContent().equals(other.getContent())) return false; 1951 } 1952 if (!getParentDocumentId().equals(other.getParentDocumentId())) return false; 1953 if (hasDerivedStructData() != other.hasDerivedStructData()) return false; 1954 if (hasDerivedStructData()) { 1955 if (!getDerivedStructData().equals(other.getDerivedStructData())) return false; 1956 } 1957 if (!getDataCase().equals(other.getDataCase())) return false; 1958 switch (dataCase_) { 1959 case 4: 1960 if (!getStructData().equals(other.getStructData())) return false; 1961 break; 1962 case 5: 1963 if (!getJsonData().equals(other.getJsonData())) return false; 1964 break; 1965 case 0: 1966 default: 1967 } 1968 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1969 return true; 1970 } 1971 1972 @java.lang.Override hashCode()1973 public int hashCode() { 1974 if (memoizedHashCode != 0) { 1975 return memoizedHashCode; 1976 } 1977 int hash = 41; 1978 hash = (19 * hash) + getDescriptor().hashCode(); 1979 hash = (37 * hash) + NAME_FIELD_NUMBER; 1980 hash = (53 * hash) + getName().hashCode(); 1981 hash = (37 * hash) + ID_FIELD_NUMBER; 1982 hash = (53 * hash) + getId().hashCode(); 1983 hash = (37 * hash) + SCHEMA_ID_FIELD_NUMBER; 1984 hash = (53 * hash) + getSchemaId().hashCode(); 1985 if (hasContent()) { 1986 hash = (37 * hash) + CONTENT_FIELD_NUMBER; 1987 hash = (53 * hash) + getContent().hashCode(); 1988 } 1989 hash = (37 * hash) + PARENT_DOCUMENT_ID_FIELD_NUMBER; 1990 hash = (53 * hash) + getParentDocumentId().hashCode(); 1991 if (hasDerivedStructData()) { 1992 hash = (37 * hash) + DERIVED_STRUCT_DATA_FIELD_NUMBER; 1993 hash = (53 * hash) + getDerivedStructData().hashCode(); 1994 } 1995 switch (dataCase_) { 1996 case 4: 1997 hash = (37 * hash) + STRUCT_DATA_FIELD_NUMBER; 1998 hash = (53 * hash) + getStructData().hashCode(); 1999 break; 2000 case 5: 2001 hash = (37 * hash) + JSON_DATA_FIELD_NUMBER; 2002 hash = (53 * hash) + getJsonData().hashCode(); 2003 break; 2004 case 0: 2005 default: 2006 } 2007 hash = (29 * hash) + getUnknownFields().hashCode(); 2008 memoizedHashCode = hash; 2009 return hash; 2010 } 2011 parseFrom(java.nio.ByteBuffer data)2012 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom(java.nio.ByteBuffer data) 2013 throws com.google.protobuf.InvalidProtocolBufferException { 2014 return PARSER.parseFrom(data); 2015 } 2016 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2017 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2018 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2019 throws com.google.protobuf.InvalidProtocolBufferException { 2020 return PARSER.parseFrom(data, extensionRegistry); 2021 } 2022 parseFrom( com.google.protobuf.ByteString data)2023 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2024 com.google.protobuf.ByteString data) 2025 throws com.google.protobuf.InvalidProtocolBufferException { 2026 return PARSER.parseFrom(data); 2027 } 2028 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2029 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2030 com.google.protobuf.ByteString data, 2031 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2032 throws com.google.protobuf.InvalidProtocolBufferException { 2033 return PARSER.parseFrom(data, extensionRegistry); 2034 } 2035 parseFrom(byte[] data)2036 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom(byte[] data) 2037 throws com.google.protobuf.InvalidProtocolBufferException { 2038 return PARSER.parseFrom(data); 2039 } 2040 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2041 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2042 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2043 throws com.google.protobuf.InvalidProtocolBufferException { 2044 return PARSER.parseFrom(data, extensionRegistry); 2045 } 2046 parseFrom( java.io.InputStream input)2047 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2048 java.io.InputStream input) throws java.io.IOException { 2049 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2050 } 2051 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2052 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2053 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2054 throws java.io.IOException { 2055 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2056 PARSER, input, extensionRegistry); 2057 } 2058 parseDelimitedFrom( java.io.InputStream input)2059 public static com.google.cloud.discoveryengine.v1beta.Document parseDelimitedFrom( 2060 java.io.InputStream input) throws java.io.IOException { 2061 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 2062 } 2063 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2064 public static com.google.cloud.discoveryengine.v1beta.Document parseDelimitedFrom( 2065 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2066 throws java.io.IOException { 2067 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 2068 PARSER, input, extensionRegistry); 2069 } 2070 parseFrom( com.google.protobuf.CodedInputStream input)2071 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2072 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 2073 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 2074 } 2075 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2076 public static com.google.cloud.discoveryengine.v1beta.Document parseFrom( 2077 com.google.protobuf.CodedInputStream input, 2078 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2079 throws java.io.IOException { 2080 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 2081 PARSER, input, extensionRegistry); 2082 } 2083 2084 @java.lang.Override newBuilderForType()2085 public Builder newBuilderForType() { 2086 return newBuilder(); 2087 } 2088 newBuilder()2089 public static Builder newBuilder() { 2090 return DEFAULT_INSTANCE.toBuilder(); 2091 } 2092 newBuilder(com.google.cloud.discoveryengine.v1beta.Document prototype)2093 public static Builder newBuilder(com.google.cloud.discoveryengine.v1beta.Document prototype) { 2094 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 2095 } 2096 2097 @java.lang.Override toBuilder()2098 public Builder toBuilder() { 2099 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 2100 } 2101 2102 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2103 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2104 Builder builder = new Builder(parent); 2105 return builder; 2106 } 2107 /** 2108 * 2109 * 2110 * <pre> 2111 * Document captures all raw metadata information of items to be recommended or 2112 * searched. 2113 * </pre> 2114 * 2115 * Protobuf type {@code google.cloud.discoveryengine.v1beta.Document} 2116 */ 2117 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 2118 implements 2119 // @@protoc_insertion_point(builder_implements:google.cloud.discoveryengine.v1beta.Document) 2120 com.google.cloud.discoveryengine.v1beta.DocumentOrBuilder { getDescriptor()2121 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 2122 return com.google.cloud.discoveryengine.v1beta.DocumentProto 2123 .internal_static_google_cloud_discoveryengine_v1beta_Document_descriptor; 2124 } 2125 2126 @java.lang.Override 2127 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()2128 internalGetFieldAccessorTable() { 2129 return com.google.cloud.discoveryengine.v1beta.DocumentProto 2130 .internal_static_google_cloud_discoveryengine_v1beta_Document_fieldAccessorTable 2131 .ensureFieldAccessorsInitialized( 2132 com.google.cloud.discoveryengine.v1beta.Document.class, 2133 com.google.cloud.discoveryengine.v1beta.Document.Builder.class); 2134 } 2135 2136 // Construct using com.google.cloud.discoveryengine.v1beta.Document.newBuilder() Builder()2137 private Builder() {} 2138 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2139 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 2140 super(parent); 2141 } 2142 2143 @java.lang.Override clear()2144 public Builder clear() { 2145 super.clear(); 2146 bitField0_ = 0; 2147 if (structDataBuilder_ != null) { 2148 structDataBuilder_.clear(); 2149 } 2150 name_ = ""; 2151 id_ = ""; 2152 schemaId_ = ""; 2153 content_ = null; 2154 if (contentBuilder_ != null) { 2155 contentBuilder_.dispose(); 2156 contentBuilder_ = null; 2157 } 2158 parentDocumentId_ = ""; 2159 derivedStructData_ = null; 2160 if (derivedStructDataBuilder_ != null) { 2161 derivedStructDataBuilder_.dispose(); 2162 derivedStructDataBuilder_ = null; 2163 } 2164 dataCase_ = 0; 2165 data_ = null; 2166 return this; 2167 } 2168 2169 @java.lang.Override getDescriptorForType()2170 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 2171 return com.google.cloud.discoveryengine.v1beta.DocumentProto 2172 .internal_static_google_cloud_discoveryengine_v1beta_Document_descriptor; 2173 } 2174 2175 @java.lang.Override getDefaultInstanceForType()2176 public com.google.cloud.discoveryengine.v1beta.Document getDefaultInstanceForType() { 2177 return com.google.cloud.discoveryengine.v1beta.Document.getDefaultInstance(); 2178 } 2179 2180 @java.lang.Override build()2181 public com.google.cloud.discoveryengine.v1beta.Document build() { 2182 com.google.cloud.discoveryengine.v1beta.Document result = buildPartial(); 2183 if (!result.isInitialized()) { 2184 throw newUninitializedMessageException(result); 2185 } 2186 return result; 2187 } 2188 2189 @java.lang.Override buildPartial()2190 public com.google.cloud.discoveryengine.v1beta.Document buildPartial() { 2191 com.google.cloud.discoveryengine.v1beta.Document result = 2192 new com.google.cloud.discoveryengine.v1beta.Document(this); 2193 if (bitField0_ != 0) { 2194 buildPartial0(result); 2195 } 2196 buildPartialOneofs(result); 2197 onBuilt(); 2198 return result; 2199 } 2200 buildPartial0(com.google.cloud.discoveryengine.v1beta.Document result)2201 private void buildPartial0(com.google.cloud.discoveryengine.v1beta.Document result) { 2202 int from_bitField0_ = bitField0_; 2203 if (((from_bitField0_ & 0x00000004) != 0)) { 2204 result.name_ = name_; 2205 } 2206 if (((from_bitField0_ & 0x00000008) != 0)) { 2207 result.id_ = id_; 2208 } 2209 if (((from_bitField0_ & 0x00000010) != 0)) { 2210 result.schemaId_ = schemaId_; 2211 } 2212 if (((from_bitField0_ & 0x00000020) != 0)) { 2213 result.content_ = contentBuilder_ == null ? content_ : contentBuilder_.build(); 2214 } 2215 if (((from_bitField0_ & 0x00000040) != 0)) { 2216 result.parentDocumentId_ = parentDocumentId_; 2217 } 2218 if (((from_bitField0_ & 0x00000080) != 0)) { 2219 result.derivedStructData_ = 2220 derivedStructDataBuilder_ == null 2221 ? derivedStructData_ 2222 : derivedStructDataBuilder_.build(); 2223 } 2224 } 2225 buildPartialOneofs(com.google.cloud.discoveryengine.v1beta.Document result)2226 private void buildPartialOneofs(com.google.cloud.discoveryengine.v1beta.Document result) { 2227 result.dataCase_ = dataCase_; 2228 result.data_ = this.data_; 2229 if (dataCase_ == 4 && structDataBuilder_ != null) { 2230 result.data_ = structDataBuilder_.build(); 2231 } 2232 } 2233 2234 @java.lang.Override clone()2235 public Builder clone() { 2236 return super.clone(); 2237 } 2238 2239 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2240 public Builder setField( 2241 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2242 return super.setField(field, value); 2243 } 2244 2245 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2246 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 2247 return super.clearField(field); 2248 } 2249 2250 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2251 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 2252 return super.clearOneof(oneof); 2253 } 2254 2255 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2256 public Builder setRepeatedField( 2257 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 2258 return super.setRepeatedField(field, index, value); 2259 } 2260 2261 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2262 public Builder addRepeatedField( 2263 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 2264 return super.addRepeatedField(field, value); 2265 } 2266 2267 @java.lang.Override mergeFrom(com.google.protobuf.Message other)2268 public Builder mergeFrom(com.google.protobuf.Message other) { 2269 if (other instanceof com.google.cloud.discoveryengine.v1beta.Document) { 2270 return mergeFrom((com.google.cloud.discoveryengine.v1beta.Document) other); 2271 } else { 2272 super.mergeFrom(other); 2273 return this; 2274 } 2275 } 2276 mergeFrom(com.google.cloud.discoveryengine.v1beta.Document other)2277 public Builder mergeFrom(com.google.cloud.discoveryengine.v1beta.Document other) { 2278 if (other == com.google.cloud.discoveryengine.v1beta.Document.getDefaultInstance()) 2279 return this; 2280 if (!other.getName().isEmpty()) { 2281 name_ = other.name_; 2282 bitField0_ |= 0x00000004; 2283 onChanged(); 2284 } 2285 if (!other.getId().isEmpty()) { 2286 id_ = other.id_; 2287 bitField0_ |= 0x00000008; 2288 onChanged(); 2289 } 2290 if (!other.getSchemaId().isEmpty()) { 2291 schemaId_ = other.schemaId_; 2292 bitField0_ |= 0x00000010; 2293 onChanged(); 2294 } 2295 if (other.hasContent()) { 2296 mergeContent(other.getContent()); 2297 } 2298 if (!other.getParentDocumentId().isEmpty()) { 2299 parentDocumentId_ = other.parentDocumentId_; 2300 bitField0_ |= 0x00000040; 2301 onChanged(); 2302 } 2303 if (other.hasDerivedStructData()) { 2304 mergeDerivedStructData(other.getDerivedStructData()); 2305 } 2306 switch (other.getDataCase()) { 2307 case STRUCT_DATA: 2308 { 2309 mergeStructData(other.getStructData()); 2310 break; 2311 } 2312 case JSON_DATA: 2313 { 2314 dataCase_ = 5; 2315 data_ = other.data_; 2316 onChanged(); 2317 break; 2318 } 2319 case DATA_NOT_SET: 2320 { 2321 break; 2322 } 2323 } 2324 this.mergeUnknownFields(other.getUnknownFields()); 2325 onChanged(); 2326 return this; 2327 } 2328 2329 @java.lang.Override isInitialized()2330 public final boolean isInitialized() { 2331 return true; 2332 } 2333 2334 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2335 public Builder mergeFrom( 2336 com.google.protobuf.CodedInputStream input, 2337 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2338 throws java.io.IOException { 2339 if (extensionRegistry == null) { 2340 throw new java.lang.NullPointerException(); 2341 } 2342 try { 2343 boolean done = false; 2344 while (!done) { 2345 int tag = input.readTag(); 2346 switch (tag) { 2347 case 0: 2348 done = true; 2349 break; 2350 case 10: 2351 { 2352 name_ = input.readStringRequireUtf8(); 2353 bitField0_ |= 0x00000004; 2354 break; 2355 } // case 10 2356 case 18: 2357 { 2358 id_ = input.readStringRequireUtf8(); 2359 bitField0_ |= 0x00000008; 2360 break; 2361 } // case 18 2362 case 26: 2363 { 2364 schemaId_ = input.readStringRequireUtf8(); 2365 bitField0_ |= 0x00000010; 2366 break; 2367 } // case 26 2368 case 34: 2369 { 2370 input.readMessage(getStructDataFieldBuilder().getBuilder(), extensionRegistry); 2371 dataCase_ = 4; 2372 break; 2373 } // case 34 2374 case 42: 2375 { 2376 java.lang.String s = input.readStringRequireUtf8(); 2377 dataCase_ = 5; 2378 data_ = s; 2379 break; 2380 } // case 42 2381 case 50: 2382 { 2383 input.readMessage( 2384 getDerivedStructDataFieldBuilder().getBuilder(), extensionRegistry); 2385 bitField0_ |= 0x00000080; 2386 break; 2387 } // case 50 2388 case 58: 2389 { 2390 parentDocumentId_ = input.readStringRequireUtf8(); 2391 bitField0_ |= 0x00000040; 2392 break; 2393 } // case 58 2394 case 82: 2395 { 2396 input.readMessage(getContentFieldBuilder().getBuilder(), extensionRegistry); 2397 bitField0_ |= 0x00000020; 2398 break; 2399 } // case 82 2400 default: 2401 { 2402 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 2403 done = true; // was an endgroup tag 2404 } 2405 break; 2406 } // default: 2407 } // switch (tag) 2408 } // while (!done) 2409 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2410 throw e.unwrapIOException(); 2411 } finally { 2412 onChanged(); 2413 } // finally 2414 return this; 2415 } 2416 2417 private int dataCase_ = 0; 2418 private java.lang.Object data_; 2419 getDataCase()2420 public DataCase getDataCase() { 2421 return DataCase.forNumber(dataCase_); 2422 } 2423 clearData()2424 public Builder clearData() { 2425 dataCase_ = 0; 2426 data_ = null; 2427 onChanged(); 2428 return this; 2429 } 2430 2431 private int bitField0_; 2432 2433 private com.google.protobuf.SingleFieldBuilderV3< 2434 com.google.protobuf.Struct, 2435 com.google.protobuf.Struct.Builder, 2436 com.google.protobuf.StructOrBuilder> 2437 structDataBuilder_; 2438 /** 2439 * 2440 * 2441 * <pre> 2442 * The structured JSON data for the document. It should conform to the 2443 * registered 2444 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2445 * `INVALID_ARGUMENT` error is thrown. 2446 * </pre> 2447 * 2448 * <code>.google.protobuf.Struct struct_data = 4;</code> 2449 * 2450 * @return Whether the structData field is set. 2451 */ 2452 @java.lang.Override hasStructData()2453 public boolean hasStructData() { 2454 return dataCase_ == 4; 2455 } 2456 /** 2457 * 2458 * 2459 * <pre> 2460 * The structured JSON data for the document. It should conform to the 2461 * registered 2462 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2463 * `INVALID_ARGUMENT` error is thrown. 2464 * </pre> 2465 * 2466 * <code>.google.protobuf.Struct struct_data = 4;</code> 2467 * 2468 * @return The structData. 2469 */ 2470 @java.lang.Override getStructData()2471 public com.google.protobuf.Struct getStructData() { 2472 if (structDataBuilder_ == null) { 2473 if (dataCase_ == 4) { 2474 return (com.google.protobuf.Struct) data_; 2475 } 2476 return com.google.protobuf.Struct.getDefaultInstance(); 2477 } else { 2478 if (dataCase_ == 4) { 2479 return structDataBuilder_.getMessage(); 2480 } 2481 return com.google.protobuf.Struct.getDefaultInstance(); 2482 } 2483 } 2484 /** 2485 * 2486 * 2487 * <pre> 2488 * The structured JSON data for the document. It should conform to the 2489 * registered 2490 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2491 * `INVALID_ARGUMENT` error is thrown. 2492 * </pre> 2493 * 2494 * <code>.google.protobuf.Struct struct_data = 4;</code> 2495 */ setStructData(com.google.protobuf.Struct value)2496 public Builder setStructData(com.google.protobuf.Struct value) { 2497 if (structDataBuilder_ == null) { 2498 if (value == null) { 2499 throw new NullPointerException(); 2500 } 2501 data_ = value; 2502 onChanged(); 2503 } else { 2504 structDataBuilder_.setMessage(value); 2505 } 2506 dataCase_ = 4; 2507 return this; 2508 } 2509 /** 2510 * 2511 * 2512 * <pre> 2513 * The structured JSON data for the document. It should conform to the 2514 * registered 2515 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2516 * `INVALID_ARGUMENT` error is thrown. 2517 * </pre> 2518 * 2519 * <code>.google.protobuf.Struct struct_data = 4;</code> 2520 */ setStructData(com.google.protobuf.Struct.Builder builderForValue)2521 public Builder setStructData(com.google.protobuf.Struct.Builder builderForValue) { 2522 if (structDataBuilder_ == null) { 2523 data_ = builderForValue.build(); 2524 onChanged(); 2525 } else { 2526 structDataBuilder_.setMessage(builderForValue.build()); 2527 } 2528 dataCase_ = 4; 2529 return this; 2530 } 2531 /** 2532 * 2533 * 2534 * <pre> 2535 * The structured JSON data for the document. It should conform to the 2536 * registered 2537 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2538 * `INVALID_ARGUMENT` error is thrown. 2539 * </pre> 2540 * 2541 * <code>.google.protobuf.Struct struct_data = 4;</code> 2542 */ mergeStructData(com.google.protobuf.Struct value)2543 public Builder mergeStructData(com.google.protobuf.Struct value) { 2544 if (structDataBuilder_ == null) { 2545 if (dataCase_ == 4 && data_ != com.google.protobuf.Struct.getDefaultInstance()) { 2546 data_ = 2547 com.google.protobuf.Struct.newBuilder((com.google.protobuf.Struct) data_) 2548 .mergeFrom(value) 2549 .buildPartial(); 2550 } else { 2551 data_ = value; 2552 } 2553 onChanged(); 2554 } else { 2555 if (dataCase_ == 4) { 2556 structDataBuilder_.mergeFrom(value); 2557 } else { 2558 structDataBuilder_.setMessage(value); 2559 } 2560 } 2561 dataCase_ = 4; 2562 return this; 2563 } 2564 /** 2565 * 2566 * 2567 * <pre> 2568 * The structured JSON data for the document. It should conform to the 2569 * registered 2570 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2571 * `INVALID_ARGUMENT` error is thrown. 2572 * </pre> 2573 * 2574 * <code>.google.protobuf.Struct struct_data = 4;</code> 2575 */ clearStructData()2576 public Builder clearStructData() { 2577 if (structDataBuilder_ == null) { 2578 if (dataCase_ == 4) { 2579 dataCase_ = 0; 2580 data_ = null; 2581 onChanged(); 2582 } 2583 } else { 2584 if (dataCase_ == 4) { 2585 dataCase_ = 0; 2586 data_ = null; 2587 } 2588 structDataBuilder_.clear(); 2589 } 2590 return this; 2591 } 2592 /** 2593 * 2594 * 2595 * <pre> 2596 * The structured JSON data for the document. It should conform to the 2597 * registered 2598 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2599 * `INVALID_ARGUMENT` error is thrown. 2600 * </pre> 2601 * 2602 * <code>.google.protobuf.Struct struct_data = 4;</code> 2603 */ getStructDataBuilder()2604 public com.google.protobuf.Struct.Builder getStructDataBuilder() { 2605 return getStructDataFieldBuilder().getBuilder(); 2606 } 2607 /** 2608 * 2609 * 2610 * <pre> 2611 * The structured JSON data for the document. It should conform to the 2612 * registered 2613 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2614 * `INVALID_ARGUMENT` error is thrown. 2615 * </pre> 2616 * 2617 * <code>.google.protobuf.Struct struct_data = 4;</code> 2618 */ 2619 @java.lang.Override getStructDataOrBuilder()2620 public com.google.protobuf.StructOrBuilder getStructDataOrBuilder() { 2621 if ((dataCase_ == 4) && (structDataBuilder_ != null)) { 2622 return structDataBuilder_.getMessageOrBuilder(); 2623 } else { 2624 if (dataCase_ == 4) { 2625 return (com.google.protobuf.Struct) data_; 2626 } 2627 return com.google.protobuf.Struct.getDefaultInstance(); 2628 } 2629 } 2630 /** 2631 * 2632 * 2633 * <pre> 2634 * The structured JSON data for the document. It should conform to the 2635 * registered 2636 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2637 * `INVALID_ARGUMENT` error is thrown. 2638 * </pre> 2639 * 2640 * <code>.google.protobuf.Struct struct_data = 4;</code> 2641 */ 2642 private com.google.protobuf.SingleFieldBuilderV3< 2643 com.google.protobuf.Struct, 2644 com.google.protobuf.Struct.Builder, 2645 com.google.protobuf.StructOrBuilder> getStructDataFieldBuilder()2646 getStructDataFieldBuilder() { 2647 if (structDataBuilder_ == null) { 2648 if (!(dataCase_ == 4)) { 2649 data_ = com.google.protobuf.Struct.getDefaultInstance(); 2650 } 2651 structDataBuilder_ = 2652 new com.google.protobuf.SingleFieldBuilderV3< 2653 com.google.protobuf.Struct, 2654 com.google.protobuf.Struct.Builder, 2655 com.google.protobuf.StructOrBuilder>( 2656 (com.google.protobuf.Struct) data_, getParentForChildren(), isClean()); 2657 data_ = null; 2658 } 2659 dataCase_ = 4; 2660 onChanged(); 2661 return structDataBuilder_; 2662 } 2663 2664 /** 2665 * 2666 * 2667 * <pre> 2668 * The JSON string representation of the document. It should conform to the 2669 * registered 2670 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2671 * `INVALID_ARGUMENT` error is thrown. 2672 * </pre> 2673 * 2674 * <code>string json_data = 5;</code> 2675 * 2676 * @return Whether the jsonData field is set. 2677 */ 2678 @java.lang.Override hasJsonData()2679 public boolean hasJsonData() { 2680 return dataCase_ == 5; 2681 } 2682 /** 2683 * 2684 * 2685 * <pre> 2686 * The JSON string representation of the document. It should conform to the 2687 * registered 2688 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2689 * `INVALID_ARGUMENT` error is thrown. 2690 * </pre> 2691 * 2692 * <code>string json_data = 5;</code> 2693 * 2694 * @return The jsonData. 2695 */ 2696 @java.lang.Override getJsonData()2697 public java.lang.String getJsonData() { 2698 java.lang.Object ref = ""; 2699 if (dataCase_ == 5) { 2700 ref = data_; 2701 } 2702 if (!(ref instanceof java.lang.String)) { 2703 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2704 java.lang.String s = bs.toStringUtf8(); 2705 if (dataCase_ == 5) { 2706 data_ = s; 2707 } 2708 return s; 2709 } else { 2710 return (java.lang.String) ref; 2711 } 2712 } 2713 /** 2714 * 2715 * 2716 * <pre> 2717 * The JSON string representation of the document. It should conform to the 2718 * registered 2719 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2720 * `INVALID_ARGUMENT` error is thrown. 2721 * </pre> 2722 * 2723 * <code>string json_data = 5;</code> 2724 * 2725 * @return The bytes for jsonData. 2726 */ 2727 @java.lang.Override getJsonDataBytes()2728 public com.google.protobuf.ByteString getJsonDataBytes() { 2729 java.lang.Object ref = ""; 2730 if (dataCase_ == 5) { 2731 ref = data_; 2732 } 2733 if (ref instanceof String) { 2734 com.google.protobuf.ByteString b = 2735 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2736 if (dataCase_ == 5) { 2737 data_ = b; 2738 } 2739 return b; 2740 } else { 2741 return (com.google.protobuf.ByteString) ref; 2742 } 2743 } 2744 /** 2745 * 2746 * 2747 * <pre> 2748 * The JSON string representation of the document. It should conform to the 2749 * registered 2750 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2751 * `INVALID_ARGUMENT` error is thrown. 2752 * </pre> 2753 * 2754 * <code>string json_data = 5;</code> 2755 * 2756 * @param value The jsonData to set. 2757 * @return This builder for chaining. 2758 */ setJsonData(java.lang.String value)2759 public Builder setJsonData(java.lang.String value) { 2760 if (value == null) { 2761 throw new NullPointerException(); 2762 } 2763 dataCase_ = 5; 2764 data_ = value; 2765 onChanged(); 2766 return this; 2767 } 2768 /** 2769 * 2770 * 2771 * <pre> 2772 * The JSON string representation of the document. It should conform to the 2773 * registered 2774 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2775 * `INVALID_ARGUMENT` error is thrown. 2776 * </pre> 2777 * 2778 * <code>string json_data = 5;</code> 2779 * 2780 * @return This builder for chaining. 2781 */ clearJsonData()2782 public Builder clearJsonData() { 2783 if (dataCase_ == 5) { 2784 dataCase_ = 0; 2785 data_ = null; 2786 onChanged(); 2787 } 2788 return this; 2789 } 2790 /** 2791 * 2792 * 2793 * <pre> 2794 * The JSON string representation of the document. It should conform to the 2795 * registered 2796 * [Schema.schema][google.cloud.discoveryengine.v1beta.Schema.schema] or an 2797 * `INVALID_ARGUMENT` error is thrown. 2798 * </pre> 2799 * 2800 * <code>string json_data = 5;</code> 2801 * 2802 * @param value The bytes for jsonData to set. 2803 * @return This builder for chaining. 2804 */ setJsonDataBytes(com.google.protobuf.ByteString value)2805 public Builder setJsonDataBytes(com.google.protobuf.ByteString value) { 2806 if (value == null) { 2807 throw new NullPointerException(); 2808 } 2809 checkByteStringIsUtf8(value); 2810 dataCase_ = 5; 2811 data_ = value; 2812 onChanged(); 2813 return this; 2814 } 2815 2816 private java.lang.Object name_ = ""; 2817 /** 2818 * 2819 * 2820 * <pre> 2821 * Immutable. The full resource name of the document. 2822 * Format: 2823 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 2824 * This field must be a UTF-8 encoded string with a length limit of 1024 2825 * characters. 2826 * </pre> 2827 * 2828 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2829 * 2830 * @return The name. 2831 */ getName()2832 public java.lang.String getName() { 2833 java.lang.Object ref = name_; 2834 if (!(ref instanceof java.lang.String)) { 2835 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2836 java.lang.String s = bs.toStringUtf8(); 2837 name_ = s; 2838 return s; 2839 } else { 2840 return (java.lang.String) ref; 2841 } 2842 } 2843 /** 2844 * 2845 * 2846 * <pre> 2847 * Immutable. The full resource name of the document. 2848 * Format: 2849 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 2850 * This field must be a UTF-8 encoded string with a length limit of 1024 2851 * characters. 2852 * </pre> 2853 * 2854 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2855 * 2856 * @return The bytes for name. 2857 */ getNameBytes()2858 public com.google.protobuf.ByteString getNameBytes() { 2859 java.lang.Object ref = name_; 2860 if (ref instanceof String) { 2861 com.google.protobuf.ByteString b = 2862 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2863 name_ = b; 2864 return b; 2865 } else { 2866 return (com.google.protobuf.ByteString) ref; 2867 } 2868 } 2869 /** 2870 * 2871 * 2872 * <pre> 2873 * Immutable. The full resource name of the document. 2874 * Format: 2875 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 2876 * This field must be a UTF-8 encoded string with a length limit of 1024 2877 * characters. 2878 * </pre> 2879 * 2880 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2881 * 2882 * @param value The name to set. 2883 * @return This builder for chaining. 2884 */ setName(java.lang.String value)2885 public Builder setName(java.lang.String value) { 2886 if (value == null) { 2887 throw new NullPointerException(); 2888 } 2889 name_ = value; 2890 bitField0_ |= 0x00000004; 2891 onChanged(); 2892 return this; 2893 } 2894 /** 2895 * 2896 * 2897 * <pre> 2898 * Immutable. The full resource name of the document. 2899 * Format: 2900 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 2901 * This field must be a UTF-8 encoded string with a length limit of 1024 2902 * characters. 2903 * </pre> 2904 * 2905 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2906 * 2907 * @return This builder for chaining. 2908 */ clearName()2909 public Builder clearName() { 2910 name_ = getDefaultInstance().getName(); 2911 bitField0_ = (bitField0_ & ~0x00000004); 2912 onChanged(); 2913 return this; 2914 } 2915 /** 2916 * 2917 * 2918 * <pre> 2919 * Immutable. The full resource name of the document. 2920 * Format: 2921 * `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. 2922 * This field must be a UTF-8 encoded string with a length limit of 1024 2923 * characters. 2924 * </pre> 2925 * 2926 * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code> 2927 * 2928 * @param value The bytes for name to set. 2929 * @return This builder for chaining. 2930 */ setNameBytes(com.google.protobuf.ByteString value)2931 public Builder setNameBytes(com.google.protobuf.ByteString value) { 2932 if (value == null) { 2933 throw new NullPointerException(); 2934 } 2935 checkByteStringIsUtf8(value); 2936 name_ = value; 2937 bitField0_ |= 0x00000004; 2938 onChanged(); 2939 return this; 2940 } 2941 2942 private java.lang.Object id_ = ""; 2943 /** 2944 * 2945 * 2946 * <pre> 2947 * Immutable. The identifier of the document. 2948 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 2949 * standard with a length limit of 63 characters. 2950 * </pre> 2951 * 2952 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 2953 * 2954 * @return The id. 2955 */ getId()2956 public java.lang.String getId() { 2957 java.lang.Object ref = id_; 2958 if (!(ref instanceof java.lang.String)) { 2959 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2960 java.lang.String s = bs.toStringUtf8(); 2961 id_ = s; 2962 return s; 2963 } else { 2964 return (java.lang.String) ref; 2965 } 2966 } 2967 /** 2968 * 2969 * 2970 * <pre> 2971 * Immutable. The identifier of the document. 2972 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 2973 * standard with a length limit of 63 characters. 2974 * </pre> 2975 * 2976 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 2977 * 2978 * @return The bytes for id. 2979 */ getIdBytes()2980 public com.google.protobuf.ByteString getIdBytes() { 2981 java.lang.Object ref = id_; 2982 if (ref instanceof String) { 2983 com.google.protobuf.ByteString b = 2984 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2985 id_ = b; 2986 return b; 2987 } else { 2988 return (com.google.protobuf.ByteString) ref; 2989 } 2990 } 2991 /** 2992 * 2993 * 2994 * <pre> 2995 * Immutable. The identifier of the document. 2996 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 2997 * standard with a length limit of 63 characters. 2998 * </pre> 2999 * 3000 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 3001 * 3002 * @param value The id to set. 3003 * @return This builder for chaining. 3004 */ setId(java.lang.String value)3005 public Builder setId(java.lang.String value) { 3006 if (value == null) { 3007 throw new NullPointerException(); 3008 } 3009 id_ = value; 3010 bitField0_ |= 0x00000008; 3011 onChanged(); 3012 return this; 3013 } 3014 /** 3015 * 3016 * 3017 * <pre> 3018 * Immutable. The identifier of the document. 3019 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3020 * standard with a length limit of 63 characters. 3021 * </pre> 3022 * 3023 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 3024 * 3025 * @return This builder for chaining. 3026 */ clearId()3027 public Builder clearId() { 3028 id_ = getDefaultInstance().getId(); 3029 bitField0_ = (bitField0_ & ~0x00000008); 3030 onChanged(); 3031 return this; 3032 } 3033 /** 3034 * 3035 * 3036 * <pre> 3037 * Immutable. The identifier of the document. 3038 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3039 * standard with a length limit of 63 characters. 3040 * </pre> 3041 * 3042 * <code>string id = 2 [(.google.api.field_behavior) = IMMUTABLE];</code> 3043 * 3044 * @param value The bytes for id to set. 3045 * @return This builder for chaining. 3046 */ setIdBytes(com.google.protobuf.ByteString value)3047 public Builder setIdBytes(com.google.protobuf.ByteString value) { 3048 if (value == null) { 3049 throw new NullPointerException(); 3050 } 3051 checkByteStringIsUtf8(value); 3052 id_ = value; 3053 bitField0_ |= 0x00000008; 3054 onChanged(); 3055 return this; 3056 } 3057 3058 private java.lang.Object schemaId_ = ""; 3059 /** 3060 * 3061 * 3062 * <pre> 3063 * The identifier of the schema located in the same data store. 3064 * </pre> 3065 * 3066 * <code>string schema_id = 3;</code> 3067 * 3068 * @return The schemaId. 3069 */ getSchemaId()3070 public java.lang.String getSchemaId() { 3071 java.lang.Object ref = schemaId_; 3072 if (!(ref instanceof java.lang.String)) { 3073 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3074 java.lang.String s = bs.toStringUtf8(); 3075 schemaId_ = s; 3076 return s; 3077 } else { 3078 return (java.lang.String) ref; 3079 } 3080 } 3081 /** 3082 * 3083 * 3084 * <pre> 3085 * The identifier of the schema located in the same data store. 3086 * </pre> 3087 * 3088 * <code>string schema_id = 3;</code> 3089 * 3090 * @return The bytes for schemaId. 3091 */ getSchemaIdBytes()3092 public com.google.protobuf.ByteString getSchemaIdBytes() { 3093 java.lang.Object ref = schemaId_; 3094 if (ref instanceof String) { 3095 com.google.protobuf.ByteString b = 3096 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3097 schemaId_ = b; 3098 return b; 3099 } else { 3100 return (com.google.protobuf.ByteString) ref; 3101 } 3102 } 3103 /** 3104 * 3105 * 3106 * <pre> 3107 * The identifier of the schema located in the same data store. 3108 * </pre> 3109 * 3110 * <code>string schema_id = 3;</code> 3111 * 3112 * @param value The schemaId to set. 3113 * @return This builder for chaining. 3114 */ setSchemaId(java.lang.String value)3115 public Builder setSchemaId(java.lang.String value) { 3116 if (value == null) { 3117 throw new NullPointerException(); 3118 } 3119 schemaId_ = value; 3120 bitField0_ |= 0x00000010; 3121 onChanged(); 3122 return this; 3123 } 3124 /** 3125 * 3126 * 3127 * <pre> 3128 * The identifier of the schema located in the same data store. 3129 * </pre> 3130 * 3131 * <code>string schema_id = 3;</code> 3132 * 3133 * @return This builder for chaining. 3134 */ clearSchemaId()3135 public Builder clearSchemaId() { 3136 schemaId_ = getDefaultInstance().getSchemaId(); 3137 bitField0_ = (bitField0_ & ~0x00000010); 3138 onChanged(); 3139 return this; 3140 } 3141 /** 3142 * 3143 * 3144 * <pre> 3145 * The identifier of the schema located in the same data store. 3146 * </pre> 3147 * 3148 * <code>string schema_id = 3;</code> 3149 * 3150 * @param value The bytes for schemaId to set. 3151 * @return This builder for chaining. 3152 */ setSchemaIdBytes(com.google.protobuf.ByteString value)3153 public Builder setSchemaIdBytes(com.google.protobuf.ByteString value) { 3154 if (value == null) { 3155 throw new NullPointerException(); 3156 } 3157 checkByteStringIsUtf8(value); 3158 schemaId_ = value; 3159 bitField0_ |= 0x00000010; 3160 onChanged(); 3161 return this; 3162 } 3163 3164 private com.google.cloud.discoveryengine.v1beta.Document.Content content_; 3165 private com.google.protobuf.SingleFieldBuilderV3< 3166 com.google.cloud.discoveryengine.v1beta.Document.Content, 3167 com.google.cloud.discoveryengine.v1beta.Document.Content.Builder, 3168 com.google.cloud.discoveryengine.v1beta.Document.ContentOrBuilder> 3169 contentBuilder_; 3170 /** 3171 * 3172 * 3173 * <pre> 3174 * The unstructured data linked to this document. Content must be set if this 3175 * document is under a 3176 * `CONTENT_REQUIRED` data store. 3177 * </pre> 3178 * 3179 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3180 * 3181 * @return Whether the content field is set. 3182 */ hasContent()3183 public boolean hasContent() { 3184 return ((bitField0_ & 0x00000020) != 0); 3185 } 3186 /** 3187 * 3188 * 3189 * <pre> 3190 * The unstructured data linked to this document. Content must be set if this 3191 * document is under a 3192 * `CONTENT_REQUIRED` data store. 3193 * </pre> 3194 * 3195 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3196 * 3197 * @return The content. 3198 */ getContent()3199 public com.google.cloud.discoveryengine.v1beta.Document.Content getContent() { 3200 if (contentBuilder_ == null) { 3201 return content_ == null 3202 ? com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance() 3203 : content_; 3204 } else { 3205 return contentBuilder_.getMessage(); 3206 } 3207 } 3208 /** 3209 * 3210 * 3211 * <pre> 3212 * The unstructured data linked to this document. Content must be set if this 3213 * document is under a 3214 * `CONTENT_REQUIRED` data store. 3215 * </pre> 3216 * 3217 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3218 */ setContent(com.google.cloud.discoveryengine.v1beta.Document.Content value)3219 public Builder setContent(com.google.cloud.discoveryengine.v1beta.Document.Content value) { 3220 if (contentBuilder_ == null) { 3221 if (value == null) { 3222 throw new NullPointerException(); 3223 } 3224 content_ = value; 3225 } else { 3226 contentBuilder_.setMessage(value); 3227 } 3228 bitField0_ |= 0x00000020; 3229 onChanged(); 3230 return this; 3231 } 3232 /** 3233 * 3234 * 3235 * <pre> 3236 * The unstructured data linked to this document. Content must be set if this 3237 * document is under a 3238 * `CONTENT_REQUIRED` data store. 3239 * </pre> 3240 * 3241 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3242 */ setContent( com.google.cloud.discoveryengine.v1beta.Document.Content.Builder builderForValue)3243 public Builder setContent( 3244 com.google.cloud.discoveryengine.v1beta.Document.Content.Builder builderForValue) { 3245 if (contentBuilder_ == null) { 3246 content_ = builderForValue.build(); 3247 } else { 3248 contentBuilder_.setMessage(builderForValue.build()); 3249 } 3250 bitField0_ |= 0x00000020; 3251 onChanged(); 3252 return this; 3253 } 3254 /** 3255 * 3256 * 3257 * <pre> 3258 * The unstructured data linked to this document. Content must be set if this 3259 * document is under a 3260 * `CONTENT_REQUIRED` data store. 3261 * </pre> 3262 * 3263 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3264 */ mergeContent(com.google.cloud.discoveryengine.v1beta.Document.Content value)3265 public Builder mergeContent(com.google.cloud.discoveryengine.v1beta.Document.Content value) { 3266 if (contentBuilder_ == null) { 3267 if (((bitField0_ & 0x00000020) != 0) 3268 && content_ != null 3269 && content_ 3270 != com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance()) { 3271 getContentBuilder().mergeFrom(value); 3272 } else { 3273 content_ = value; 3274 } 3275 } else { 3276 contentBuilder_.mergeFrom(value); 3277 } 3278 bitField0_ |= 0x00000020; 3279 onChanged(); 3280 return this; 3281 } 3282 /** 3283 * 3284 * 3285 * <pre> 3286 * The unstructured data linked to this document. Content must be set if this 3287 * document is under a 3288 * `CONTENT_REQUIRED` data store. 3289 * </pre> 3290 * 3291 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3292 */ clearContent()3293 public Builder clearContent() { 3294 bitField0_ = (bitField0_ & ~0x00000020); 3295 content_ = null; 3296 if (contentBuilder_ != null) { 3297 contentBuilder_.dispose(); 3298 contentBuilder_ = null; 3299 } 3300 onChanged(); 3301 return this; 3302 } 3303 /** 3304 * 3305 * 3306 * <pre> 3307 * The unstructured data linked to this document. Content must be set if this 3308 * document is under a 3309 * `CONTENT_REQUIRED` data store. 3310 * </pre> 3311 * 3312 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3313 */ getContentBuilder()3314 public com.google.cloud.discoveryengine.v1beta.Document.Content.Builder getContentBuilder() { 3315 bitField0_ |= 0x00000020; 3316 onChanged(); 3317 return getContentFieldBuilder().getBuilder(); 3318 } 3319 /** 3320 * 3321 * 3322 * <pre> 3323 * The unstructured data linked to this document. Content must be set if this 3324 * document is under a 3325 * `CONTENT_REQUIRED` data store. 3326 * </pre> 3327 * 3328 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3329 */ getContentOrBuilder()3330 public com.google.cloud.discoveryengine.v1beta.Document.ContentOrBuilder getContentOrBuilder() { 3331 if (contentBuilder_ != null) { 3332 return contentBuilder_.getMessageOrBuilder(); 3333 } else { 3334 return content_ == null 3335 ? com.google.cloud.discoveryengine.v1beta.Document.Content.getDefaultInstance() 3336 : content_; 3337 } 3338 } 3339 /** 3340 * 3341 * 3342 * <pre> 3343 * The unstructured data linked to this document. Content must be set if this 3344 * document is under a 3345 * `CONTENT_REQUIRED` data store. 3346 * </pre> 3347 * 3348 * <code>.google.cloud.discoveryengine.v1beta.Document.Content content = 10;</code> 3349 */ 3350 private com.google.protobuf.SingleFieldBuilderV3< 3351 com.google.cloud.discoveryengine.v1beta.Document.Content, 3352 com.google.cloud.discoveryengine.v1beta.Document.Content.Builder, 3353 com.google.cloud.discoveryengine.v1beta.Document.ContentOrBuilder> getContentFieldBuilder()3354 getContentFieldBuilder() { 3355 if (contentBuilder_ == null) { 3356 contentBuilder_ = 3357 new com.google.protobuf.SingleFieldBuilderV3< 3358 com.google.cloud.discoveryengine.v1beta.Document.Content, 3359 com.google.cloud.discoveryengine.v1beta.Document.Content.Builder, 3360 com.google.cloud.discoveryengine.v1beta.Document.ContentOrBuilder>( 3361 getContent(), getParentForChildren(), isClean()); 3362 content_ = null; 3363 } 3364 return contentBuilder_; 3365 } 3366 3367 private java.lang.Object parentDocumentId_ = ""; 3368 /** 3369 * 3370 * 3371 * <pre> 3372 * The identifier of the parent document. Currently supports at most two level 3373 * document hierarchy. 3374 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3375 * standard with a length limit of 63 characters. 3376 * </pre> 3377 * 3378 * <code>string parent_document_id = 7;</code> 3379 * 3380 * @return The parentDocumentId. 3381 */ getParentDocumentId()3382 public java.lang.String getParentDocumentId() { 3383 java.lang.Object ref = parentDocumentId_; 3384 if (!(ref instanceof java.lang.String)) { 3385 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3386 java.lang.String s = bs.toStringUtf8(); 3387 parentDocumentId_ = s; 3388 return s; 3389 } else { 3390 return (java.lang.String) ref; 3391 } 3392 } 3393 /** 3394 * 3395 * 3396 * <pre> 3397 * The identifier of the parent document. Currently supports at most two level 3398 * document hierarchy. 3399 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3400 * standard with a length limit of 63 characters. 3401 * </pre> 3402 * 3403 * <code>string parent_document_id = 7;</code> 3404 * 3405 * @return The bytes for parentDocumentId. 3406 */ getParentDocumentIdBytes()3407 public com.google.protobuf.ByteString getParentDocumentIdBytes() { 3408 java.lang.Object ref = parentDocumentId_; 3409 if (ref instanceof String) { 3410 com.google.protobuf.ByteString b = 3411 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3412 parentDocumentId_ = b; 3413 return b; 3414 } else { 3415 return (com.google.protobuf.ByteString) ref; 3416 } 3417 } 3418 /** 3419 * 3420 * 3421 * <pre> 3422 * The identifier of the parent document. Currently supports at most two level 3423 * document hierarchy. 3424 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3425 * standard with a length limit of 63 characters. 3426 * </pre> 3427 * 3428 * <code>string parent_document_id = 7;</code> 3429 * 3430 * @param value The parentDocumentId to set. 3431 * @return This builder for chaining. 3432 */ setParentDocumentId(java.lang.String value)3433 public Builder setParentDocumentId(java.lang.String value) { 3434 if (value == null) { 3435 throw new NullPointerException(); 3436 } 3437 parentDocumentId_ = value; 3438 bitField0_ |= 0x00000040; 3439 onChanged(); 3440 return this; 3441 } 3442 /** 3443 * 3444 * 3445 * <pre> 3446 * The identifier of the parent document. Currently supports at most two level 3447 * document hierarchy. 3448 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3449 * standard with a length limit of 63 characters. 3450 * </pre> 3451 * 3452 * <code>string parent_document_id = 7;</code> 3453 * 3454 * @return This builder for chaining. 3455 */ clearParentDocumentId()3456 public Builder clearParentDocumentId() { 3457 parentDocumentId_ = getDefaultInstance().getParentDocumentId(); 3458 bitField0_ = (bitField0_ & ~0x00000040); 3459 onChanged(); 3460 return this; 3461 } 3462 /** 3463 * 3464 * 3465 * <pre> 3466 * The identifier of the parent document. Currently supports at most two level 3467 * document hierarchy. 3468 * Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) 3469 * standard with a length limit of 63 characters. 3470 * </pre> 3471 * 3472 * <code>string parent_document_id = 7;</code> 3473 * 3474 * @param value The bytes for parentDocumentId to set. 3475 * @return This builder for chaining. 3476 */ setParentDocumentIdBytes(com.google.protobuf.ByteString value)3477 public Builder setParentDocumentIdBytes(com.google.protobuf.ByteString value) { 3478 if (value == null) { 3479 throw new NullPointerException(); 3480 } 3481 checkByteStringIsUtf8(value); 3482 parentDocumentId_ = value; 3483 bitField0_ |= 0x00000040; 3484 onChanged(); 3485 return this; 3486 } 3487 3488 private com.google.protobuf.Struct derivedStructData_; 3489 private com.google.protobuf.SingleFieldBuilderV3< 3490 com.google.protobuf.Struct, 3491 com.google.protobuf.Struct.Builder, 3492 com.google.protobuf.StructOrBuilder> 3493 derivedStructDataBuilder_; 3494 /** 3495 * 3496 * 3497 * <pre> 3498 * Output only. This field is OUTPUT_ONLY. 3499 * It contains derived data that are not in the original input document. 3500 * </pre> 3501 * 3502 * <code> 3503 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3504 * </code> 3505 * 3506 * @return Whether the derivedStructData field is set. 3507 */ hasDerivedStructData()3508 public boolean hasDerivedStructData() { 3509 return ((bitField0_ & 0x00000080) != 0); 3510 } 3511 /** 3512 * 3513 * 3514 * <pre> 3515 * Output only. This field is OUTPUT_ONLY. 3516 * It contains derived data that are not in the original input document. 3517 * </pre> 3518 * 3519 * <code> 3520 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3521 * </code> 3522 * 3523 * @return The derivedStructData. 3524 */ getDerivedStructData()3525 public com.google.protobuf.Struct getDerivedStructData() { 3526 if (derivedStructDataBuilder_ == null) { 3527 return derivedStructData_ == null 3528 ? com.google.protobuf.Struct.getDefaultInstance() 3529 : derivedStructData_; 3530 } else { 3531 return derivedStructDataBuilder_.getMessage(); 3532 } 3533 } 3534 /** 3535 * 3536 * 3537 * <pre> 3538 * Output only. This field is OUTPUT_ONLY. 3539 * It contains derived data that are not in the original input document. 3540 * </pre> 3541 * 3542 * <code> 3543 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3544 * </code> 3545 */ setDerivedStructData(com.google.protobuf.Struct value)3546 public Builder setDerivedStructData(com.google.protobuf.Struct value) { 3547 if (derivedStructDataBuilder_ == null) { 3548 if (value == null) { 3549 throw new NullPointerException(); 3550 } 3551 derivedStructData_ = value; 3552 } else { 3553 derivedStructDataBuilder_.setMessage(value); 3554 } 3555 bitField0_ |= 0x00000080; 3556 onChanged(); 3557 return this; 3558 } 3559 /** 3560 * 3561 * 3562 * <pre> 3563 * Output only. This field is OUTPUT_ONLY. 3564 * It contains derived data that are not in the original input document. 3565 * </pre> 3566 * 3567 * <code> 3568 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3569 * </code> 3570 */ setDerivedStructData(com.google.protobuf.Struct.Builder builderForValue)3571 public Builder setDerivedStructData(com.google.protobuf.Struct.Builder builderForValue) { 3572 if (derivedStructDataBuilder_ == null) { 3573 derivedStructData_ = builderForValue.build(); 3574 } else { 3575 derivedStructDataBuilder_.setMessage(builderForValue.build()); 3576 } 3577 bitField0_ |= 0x00000080; 3578 onChanged(); 3579 return this; 3580 } 3581 /** 3582 * 3583 * 3584 * <pre> 3585 * Output only. This field is OUTPUT_ONLY. 3586 * It contains derived data that are not in the original input document. 3587 * </pre> 3588 * 3589 * <code> 3590 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3591 * </code> 3592 */ mergeDerivedStructData(com.google.protobuf.Struct value)3593 public Builder mergeDerivedStructData(com.google.protobuf.Struct value) { 3594 if (derivedStructDataBuilder_ == null) { 3595 if (((bitField0_ & 0x00000080) != 0) 3596 && derivedStructData_ != null 3597 && derivedStructData_ != com.google.protobuf.Struct.getDefaultInstance()) { 3598 getDerivedStructDataBuilder().mergeFrom(value); 3599 } else { 3600 derivedStructData_ = value; 3601 } 3602 } else { 3603 derivedStructDataBuilder_.mergeFrom(value); 3604 } 3605 bitField0_ |= 0x00000080; 3606 onChanged(); 3607 return this; 3608 } 3609 /** 3610 * 3611 * 3612 * <pre> 3613 * Output only. This field is OUTPUT_ONLY. 3614 * It contains derived data that are not in the original input document. 3615 * </pre> 3616 * 3617 * <code> 3618 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3619 * </code> 3620 */ clearDerivedStructData()3621 public Builder clearDerivedStructData() { 3622 bitField0_ = (bitField0_ & ~0x00000080); 3623 derivedStructData_ = null; 3624 if (derivedStructDataBuilder_ != null) { 3625 derivedStructDataBuilder_.dispose(); 3626 derivedStructDataBuilder_ = null; 3627 } 3628 onChanged(); 3629 return this; 3630 } 3631 /** 3632 * 3633 * 3634 * <pre> 3635 * Output only. This field is OUTPUT_ONLY. 3636 * It contains derived data that are not in the original input document. 3637 * </pre> 3638 * 3639 * <code> 3640 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3641 * </code> 3642 */ getDerivedStructDataBuilder()3643 public com.google.protobuf.Struct.Builder getDerivedStructDataBuilder() { 3644 bitField0_ |= 0x00000080; 3645 onChanged(); 3646 return getDerivedStructDataFieldBuilder().getBuilder(); 3647 } 3648 /** 3649 * 3650 * 3651 * <pre> 3652 * Output only. This field is OUTPUT_ONLY. 3653 * It contains derived data that are not in the original input document. 3654 * </pre> 3655 * 3656 * <code> 3657 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3658 * </code> 3659 */ getDerivedStructDataOrBuilder()3660 public com.google.protobuf.StructOrBuilder getDerivedStructDataOrBuilder() { 3661 if (derivedStructDataBuilder_ != null) { 3662 return derivedStructDataBuilder_.getMessageOrBuilder(); 3663 } else { 3664 return derivedStructData_ == null 3665 ? com.google.protobuf.Struct.getDefaultInstance() 3666 : derivedStructData_; 3667 } 3668 } 3669 /** 3670 * 3671 * 3672 * <pre> 3673 * Output only. This field is OUTPUT_ONLY. 3674 * It contains derived data that are not in the original input document. 3675 * </pre> 3676 * 3677 * <code> 3678 * .google.protobuf.Struct derived_struct_data = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; 3679 * </code> 3680 */ 3681 private com.google.protobuf.SingleFieldBuilderV3< 3682 com.google.protobuf.Struct, 3683 com.google.protobuf.Struct.Builder, 3684 com.google.protobuf.StructOrBuilder> getDerivedStructDataFieldBuilder()3685 getDerivedStructDataFieldBuilder() { 3686 if (derivedStructDataBuilder_ == null) { 3687 derivedStructDataBuilder_ = 3688 new com.google.protobuf.SingleFieldBuilderV3< 3689 com.google.protobuf.Struct, 3690 com.google.protobuf.Struct.Builder, 3691 com.google.protobuf.StructOrBuilder>( 3692 getDerivedStructData(), getParentForChildren(), isClean()); 3693 derivedStructData_ = null; 3694 } 3695 return derivedStructDataBuilder_; 3696 } 3697 3698 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)3699 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 3700 return super.setUnknownFields(unknownFields); 3701 } 3702 3703 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)3704 public final Builder mergeUnknownFields( 3705 final com.google.protobuf.UnknownFieldSet unknownFields) { 3706 return super.mergeUnknownFields(unknownFields); 3707 } 3708 3709 // @@protoc_insertion_point(builder_scope:google.cloud.discoveryengine.v1beta.Document) 3710 } 3711 3712 // @@protoc_insertion_point(class_scope:google.cloud.discoveryengine.v1beta.Document) 3713 private static final com.google.cloud.discoveryengine.v1beta.Document DEFAULT_INSTANCE; 3714 3715 static { 3716 DEFAULT_INSTANCE = new com.google.cloud.discoveryengine.v1beta.Document(); 3717 } 3718 getDefaultInstance()3719 public static com.google.cloud.discoveryengine.v1beta.Document getDefaultInstance() { 3720 return DEFAULT_INSTANCE; 3721 } 3722 3723 private static final com.google.protobuf.Parser<Document> PARSER = 3724 new com.google.protobuf.AbstractParser<Document>() { 3725 @java.lang.Override 3726 public Document parsePartialFrom( 3727 com.google.protobuf.CodedInputStream input, 3728 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 3729 throws com.google.protobuf.InvalidProtocolBufferException { 3730 Builder builder = newBuilder(); 3731 try { 3732 builder.mergeFrom(input, extensionRegistry); 3733 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 3734 throw e.setUnfinishedMessage(builder.buildPartial()); 3735 } catch (com.google.protobuf.UninitializedMessageException e) { 3736 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 3737 } catch (java.io.IOException e) { 3738 throw new com.google.protobuf.InvalidProtocolBufferException(e) 3739 .setUnfinishedMessage(builder.buildPartial()); 3740 } 3741 return builder.buildPartial(); 3742 } 3743 }; 3744 parser()3745 public static com.google.protobuf.Parser<Document> parser() { 3746 return PARSER; 3747 } 3748 3749 @java.lang.Override getParserForType()3750 public com.google.protobuf.Parser<Document> getParserForType() { 3751 return PARSER; 3752 } 3753 3754 @java.lang.Override getDefaultInstanceForType()3755 public com.google.cloud.discoveryengine.v1beta.Document getDefaultInstanceForType() { 3756 return DEFAULT_INSTANCE; 3757 } 3758 } 3759