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/vision/v1/image_annotator.proto 18 19 package com.google.cloud.vision.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * The desired input location and metadata. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.vision.v1.InputConfig} 29 */ 30 public final class InputConfig extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.InputConfig) 33 InputConfigOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use InputConfig.newBuilder() to construct. InputConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private InputConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 InputConfig()40 private InputConfig() { 41 content_ = com.google.protobuf.ByteString.EMPTY; 42 mimeType_ = ""; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new InputConfig(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.cloud.vision.v1.ImageAnnotatorProto 58 .internal_static_google_cloud_vision_v1_InputConfig_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.cloud.vision.v1.ImageAnnotatorProto 65 .internal_static_google_cloud_vision_v1_InputConfig_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.cloud.vision.v1.InputConfig.class, 68 com.google.cloud.vision.v1.InputConfig.Builder.class); 69 } 70 71 public static final int GCS_SOURCE_FIELD_NUMBER = 1; 72 private com.google.cloud.vision.v1.GcsSource gcsSource_; 73 /** 74 * 75 * 76 * <pre> 77 * The Google Cloud Storage location to read the input from. 78 * </pre> 79 * 80 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 81 * 82 * @return Whether the gcsSource field is set. 83 */ 84 @java.lang.Override hasGcsSource()85 public boolean hasGcsSource() { 86 return gcsSource_ != null; 87 } 88 /** 89 * 90 * 91 * <pre> 92 * The Google Cloud Storage location to read the input from. 93 * </pre> 94 * 95 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 96 * 97 * @return The gcsSource. 98 */ 99 @java.lang.Override getGcsSource()100 public com.google.cloud.vision.v1.GcsSource getGcsSource() { 101 return gcsSource_ == null 102 ? com.google.cloud.vision.v1.GcsSource.getDefaultInstance() 103 : gcsSource_; 104 } 105 /** 106 * 107 * 108 * <pre> 109 * The Google Cloud Storage location to read the input from. 110 * </pre> 111 * 112 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 113 */ 114 @java.lang.Override getGcsSourceOrBuilder()115 public com.google.cloud.vision.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { 116 return gcsSource_ == null 117 ? com.google.cloud.vision.v1.GcsSource.getDefaultInstance() 118 : gcsSource_; 119 } 120 121 public static final int CONTENT_FIELD_NUMBER = 3; 122 private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; 123 /** 124 * 125 * 126 * <pre> 127 * File content, represented as a stream of bytes. 128 * Note: As with all `bytes` fields, protobuffers use a pure binary 129 * representation, whereas JSON representations use base64. 130 * Currently, this field only works for BatchAnnotateFiles requests. It does 131 * not work for AsyncBatchAnnotateFiles requests. 132 * </pre> 133 * 134 * <code>bytes content = 3;</code> 135 * 136 * @return The content. 137 */ 138 @java.lang.Override getContent()139 public com.google.protobuf.ByteString getContent() { 140 return content_; 141 } 142 143 public static final int MIME_TYPE_FIELD_NUMBER = 2; 144 145 @SuppressWarnings("serial") 146 private volatile java.lang.Object mimeType_ = ""; 147 /** 148 * 149 * 150 * <pre> 151 * The type of the file. Currently only "application/pdf", "image/tiff" and 152 * "image/gif" are supported. Wildcards are not supported. 153 * </pre> 154 * 155 * <code>string mime_type = 2;</code> 156 * 157 * @return The mimeType. 158 */ 159 @java.lang.Override getMimeType()160 public java.lang.String getMimeType() { 161 java.lang.Object ref = mimeType_; 162 if (ref instanceof java.lang.String) { 163 return (java.lang.String) ref; 164 } else { 165 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 166 java.lang.String s = bs.toStringUtf8(); 167 mimeType_ = s; 168 return s; 169 } 170 } 171 /** 172 * 173 * 174 * <pre> 175 * The type of the file. Currently only "application/pdf", "image/tiff" and 176 * "image/gif" are supported. Wildcards are not supported. 177 * </pre> 178 * 179 * <code>string mime_type = 2;</code> 180 * 181 * @return The bytes for mimeType. 182 */ 183 @java.lang.Override getMimeTypeBytes()184 public com.google.protobuf.ByteString getMimeTypeBytes() { 185 java.lang.Object ref = mimeType_; 186 if (ref instanceof java.lang.String) { 187 com.google.protobuf.ByteString b = 188 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 189 mimeType_ = b; 190 return b; 191 } else { 192 return (com.google.protobuf.ByteString) ref; 193 } 194 } 195 196 private byte memoizedIsInitialized = -1; 197 198 @java.lang.Override isInitialized()199 public final boolean isInitialized() { 200 byte isInitialized = memoizedIsInitialized; 201 if (isInitialized == 1) return true; 202 if (isInitialized == 0) return false; 203 204 memoizedIsInitialized = 1; 205 return true; 206 } 207 208 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)209 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 210 if (gcsSource_ != null) { 211 output.writeMessage(1, getGcsSource()); 212 } 213 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { 214 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_); 215 } 216 if (!content_.isEmpty()) { 217 output.writeBytes(3, content_); 218 } 219 getUnknownFields().writeTo(output); 220 } 221 222 @java.lang.Override getSerializedSize()223 public int getSerializedSize() { 224 int size = memoizedSize; 225 if (size != -1) return size; 226 227 size = 0; 228 if (gcsSource_ != null) { 229 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcsSource()); 230 } 231 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) { 232 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_); 233 } 234 if (!content_.isEmpty()) { 235 size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, content_); 236 } 237 size += getUnknownFields().getSerializedSize(); 238 memoizedSize = size; 239 return size; 240 } 241 242 @java.lang.Override equals(final java.lang.Object obj)243 public boolean equals(final java.lang.Object obj) { 244 if (obj == this) { 245 return true; 246 } 247 if (!(obj instanceof com.google.cloud.vision.v1.InputConfig)) { 248 return super.equals(obj); 249 } 250 com.google.cloud.vision.v1.InputConfig other = (com.google.cloud.vision.v1.InputConfig) obj; 251 252 if (hasGcsSource() != other.hasGcsSource()) return false; 253 if (hasGcsSource()) { 254 if (!getGcsSource().equals(other.getGcsSource())) return false; 255 } 256 if (!getContent().equals(other.getContent())) return false; 257 if (!getMimeType().equals(other.getMimeType())) return false; 258 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 259 return true; 260 } 261 262 @java.lang.Override hashCode()263 public int hashCode() { 264 if (memoizedHashCode != 0) { 265 return memoizedHashCode; 266 } 267 int hash = 41; 268 hash = (19 * hash) + getDescriptor().hashCode(); 269 if (hasGcsSource()) { 270 hash = (37 * hash) + GCS_SOURCE_FIELD_NUMBER; 271 hash = (53 * hash) + getGcsSource().hashCode(); 272 } 273 hash = (37 * hash) + CONTENT_FIELD_NUMBER; 274 hash = (53 * hash) + getContent().hashCode(); 275 hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER; 276 hash = (53 * hash) + getMimeType().hashCode(); 277 hash = (29 * hash) + getUnknownFields().hashCode(); 278 memoizedHashCode = hash; 279 return hash; 280 } 281 parseFrom(java.nio.ByteBuffer data)282 public static com.google.cloud.vision.v1.InputConfig parseFrom(java.nio.ByteBuffer data) 283 throws com.google.protobuf.InvalidProtocolBufferException { 284 return PARSER.parseFrom(data); 285 } 286 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)287 public static com.google.cloud.vision.v1.InputConfig parseFrom( 288 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 289 throws com.google.protobuf.InvalidProtocolBufferException { 290 return PARSER.parseFrom(data, extensionRegistry); 291 } 292 parseFrom( com.google.protobuf.ByteString data)293 public static com.google.cloud.vision.v1.InputConfig parseFrom( 294 com.google.protobuf.ByteString data) 295 throws com.google.protobuf.InvalidProtocolBufferException { 296 return PARSER.parseFrom(data); 297 } 298 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)299 public static com.google.cloud.vision.v1.InputConfig parseFrom( 300 com.google.protobuf.ByteString data, 301 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 302 throws com.google.protobuf.InvalidProtocolBufferException { 303 return PARSER.parseFrom(data, extensionRegistry); 304 } 305 parseFrom(byte[] data)306 public static com.google.cloud.vision.v1.InputConfig parseFrom(byte[] data) 307 throws com.google.protobuf.InvalidProtocolBufferException { 308 return PARSER.parseFrom(data); 309 } 310 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)311 public static com.google.cloud.vision.v1.InputConfig parseFrom( 312 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 313 throws com.google.protobuf.InvalidProtocolBufferException { 314 return PARSER.parseFrom(data, extensionRegistry); 315 } 316 parseFrom(java.io.InputStream input)317 public static com.google.cloud.vision.v1.InputConfig parseFrom(java.io.InputStream input) 318 throws java.io.IOException { 319 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 320 } 321 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)322 public static com.google.cloud.vision.v1.InputConfig parseFrom( 323 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 324 throws java.io.IOException { 325 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 326 PARSER, input, extensionRegistry); 327 } 328 parseDelimitedFrom(java.io.InputStream input)329 public static com.google.cloud.vision.v1.InputConfig parseDelimitedFrom(java.io.InputStream input) 330 throws java.io.IOException { 331 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 332 } 333 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)334 public static com.google.cloud.vision.v1.InputConfig parseDelimitedFrom( 335 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 336 throws java.io.IOException { 337 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 338 PARSER, input, extensionRegistry); 339 } 340 parseFrom( com.google.protobuf.CodedInputStream input)341 public static com.google.cloud.vision.v1.InputConfig parseFrom( 342 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 343 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 344 } 345 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)346 public static com.google.cloud.vision.v1.InputConfig parseFrom( 347 com.google.protobuf.CodedInputStream input, 348 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 349 throws java.io.IOException { 350 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 351 PARSER, input, extensionRegistry); 352 } 353 354 @java.lang.Override newBuilderForType()355 public Builder newBuilderForType() { 356 return newBuilder(); 357 } 358 newBuilder()359 public static Builder newBuilder() { 360 return DEFAULT_INSTANCE.toBuilder(); 361 } 362 newBuilder(com.google.cloud.vision.v1.InputConfig prototype)363 public static Builder newBuilder(com.google.cloud.vision.v1.InputConfig prototype) { 364 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 365 } 366 367 @java.lang.Override toBuilder()368 public Builder toBuilder() { 369 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 370 } 371 372 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)373 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 374 Builder builder = new Builder(parent); 375 return builder; 376 } 377 /** 378 * 379 * 380 * <pre> 381 * The desired input location and metadata. 382 * </pre> 383 * 384 * Protobuf type {@code google.cloud.vision.v1.InputConfig} 385 */ 386 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 387 implements 388 // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.InputConfig) 389 com.google.cloud.vision.v1.InputConfigOrBuilder { getDescriptor()390 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 391 return com.google.cloud.vision.v1.ImageAnnotatorProto 392 .internal_static_google_cloud_vision_v1_InputConfig_descriptor; 393 } 394 395 @java.lang.Override 396 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()397 internalGetFieldAccessorTable() { 398 return com.google.cloud.vision.v1.ImageAnnotatorProto 399 .internal_static_google_cloud_vision_v1_InputConfig_fieldAccessorTable 400 .ensureFieldAccessorsInitialized( 401 com.google.cloud.vision.v1.InputConfig.class, 402 com.google.cloud.vision.v1.InputConfig.Builder.class); 403 } 404 405 // Construct using com.google.cloud.vision.v1.InputConfig.newBuilder() Builder()406 private Builder() {} 407 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)408 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 409 super(parent); 410 } 411 412 @java.lang.Override clear()413 public Builder clear() { 414 super.clear(); 415 bitField0_ = 0; 416 gcsSource_ = null; 417 if (gcsSourceBuilder_ != null) { 418 gcsSourceBuilder_.dispose(); 419 gcsSourceBuilder_ = null; 420 } 421 content_ = com.google.protobuf.ByteString.EMPTY; 422 mimeType_ = ""; 423 return this; 424 } 425 426 @java.lang.Override getDescriptorForType()427 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 428 return com.google.cloud.vision.v1.ImageAnnotatorProto 429 .internal_static_google_cloud_vision_v1_InputConfig_descriptor; 430 } 431 432 @java.lang.Override getDefaultInstanceForType()433 public com.google.cloud.vision.v1.InputConfig getDefaultInstanceForType() { 434 return com.google.cloud.vision.v1.InputConfig.getDefaultInstance(); 435 } 436 437 @java.lang.Override build()438 public com.google.cloud.vision.v1.InputConfig build() { 439 com.google.cloud.vision.v1.InputConfig result = buildPartial(); 440 if (!result.isInitialized()) { 441 throw newUninitializedMessageException(result); 442 } 443 return result; 444 } 445 446 @java.lang.Override buildPartial()447 public com.google.cloud.vision.v1.InputConfig buildPartial() { 448 com.google.cloud.vision.v1.InputConfig result = 449 new com.google.cloud.vision.v1.InputConfig(this); 450 if (bitField0_ != 0) { 451 buildPartial0(result); 452 } 453 onBuilt(); 454 return result; 455 } 456 buildPartial0(com.google.cloud.vision.v1.InputConfig result)457 private void buildPartial0(com.google.cloud.vision.v1.InputConfig result) { 458 int from_bitField0_ = bitField0_; 459 if (((from_bitField0_ & 0x00000001) != 0)) { 460 result.gcsSource_ = gcsSourceBuilder_ == null ? gcsSource_ : gcsSourceBuilder_.build(); 461 } 462 if (((from_bitField0_ & 0x00000002) != 0)) { 463 result.content_ = content_; 464 } 465 if (((from_bitField0_ & 0x00000004) != 0)) { 466 result.mimeType_ = mimeType_; 467 } 468 } 469 470 @java.lang.Override clone()471 public Builder clone() { 472 return super.clone(); 473 } 474 475 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)476 public Builder setField( 477 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 478 return super.setField(field, value); 479 } 480 481 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)482 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 483 return super.clearField(field); 484 } 485 486 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)487 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 488 return super.clearOneof(oneof); 489 } 490 491 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)492 public Builder setRepeatedField( 493 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 494 return super.setRepeatedField(field, index, value); 495 } 496 497 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)498 public Builder addRepeatedField( 499 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 500 return super.addRepeatedField(field, value); 501 } 502 503 @java.lang.Override mergeFrom(com.google.protobuf.Message other)504 public Builder mergeFrom(com.google.protobuf.Message other) { 505 if (other instanceof com.google.cloud.vision.v1.InputConfig) { 506 return mergeFrom((com.google.cloud.vision.v1.InputConfig) other); 507 } else { 508 super.mergeFrom(other); 509 return this; 510 } 511 } 512 mergeFrom(com.google.cloud.vision.v1.InputConfig other)513 public Builder mergeFrom(com.google.cloud.vision.v1.InputConfig other) { 514 if (other == com.google.cloud.vision.v1.InputConfig.getDefaultInstance()) return this; 515 if (other.hasGcsSource()) { 516 mergeGcsSource(other.getGcsSource()); 517 } 518 if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { 519 setContent(other.getContent()); 520 } 521 if (!other.getMimeType().isEmpty()) { 522 mimeType_ = other.mimeType_; 523 bitField0_ |= 0x00000004; 524 onChanged(); 525 } 526 this.mergeUnknownFields(other.getUnknownFields()); 527 onChanged(); 528 return this; 529 } 530 531 @java.lang.Override isInitialized()532 public final boolean isInitialized() { 533 return true; 534 } 535 536 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)537 public Builder mergeFrom( 538 com.google.protobuf.CodedInputStream input, 539 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 540 throws java.io.IOException { 541 if (extensionRegistry == null) { 542 throw new java.lang.NullPointerException(); 543 } 544 try { 545 boolean done = false; 546 while (!done) { 547 int tag = input.readTag(); 548 switch (tag) { 549 case 0: 550 done = true; 551 break; 552 case 10: 553 { 554 input.readMessage(getGcsSourceFieldBuilder().getBuilder(), extensionRegistry); 555 bitField0_ |= 0x00000001; 556 break; 557 } // case 10 558 case 18: 559 { 560 mimeType_ = input.readStringRequireUtf8(); 561 bitField0_ |= 0x00000004; 562 break; 563 } // case 18 564 case 26: 565 { 566 content_ = input.readBytes(); 567 bitField0_ |= 0x00000002; 568 break; 569 } // case 26 570 default: 571 { 572 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 573 done = true; // was an endgroup tag 574 } 575 break; 576 } // default: 577 } // switch (tag) 578 } // while (!done) 579 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 580 throw e.unwrapIOException(); 581 } finally { 582 onChanged(); 583 } // finally 584 return this; 585 } 586 587 private int bitField0_; 588 589 private com.google.cloud.vision.v1.GcsSource gcsSource_; 590 private com.google.protobuf.SingleFieldBuilderV3< 591 com.google.cloud.vision.v1.GcsSource, 592 com.google.cloud.vision.v1.GcsSource.Builder, 593 com.google.cloud.vision.v1.GcsSourceOrBuilder> 594 gcsSourceBuilder_; 595 /** 596 * 597 * 598 * <pre> 599 * The Google Cloud Storage location to read the input from. 600 * </pre> 601 * 602 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 603 * 604 * @return Whether the gcsSource field is set. 605 */ hasGcsSource()606 public boolean hasGcsSource() { 607 return ((bitField0_ & 0x00000001) != 0); 608 } 609 /** 610 * 611 * 612 * <pre> 613 * The Google Cloud Storage location to read the input from. 614 * </pre> 615 * 616 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 617 * 618 * @return The gcsSource. 619 */ getGcsSource()620 public com.google.cloud.vision.v1.GcsSource getGcsSource() { 621 if (gcsSourceBuilder_ == null) { 622 return gcsSource_ == null 623 ? com.google.cloud.vision.v1.GcsSource.getDefaultInstance() 624 : gcsSource_; 625 } else { 626 return gcsSourceBuilder_.getMessage(); 627 } 628 } 629 /** 630 * 631 * 632 * <pre> 633 * The Google Cloud Storage location to read the input from. 634 * </pre> 635 * 636 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 637 */ setGcsSource(com.google.cloud.vision.v1.GcsSource value)638 public Builder setGcsSource(com.google.cloud.vision.v1.GcsSource value) { 639 if (gcsSourceBuilder_ == null) { 640 if (value == null) { 641 throw new NullPointerException(); 642 } 643 gcsSource_ = value; 644 } else { 645 gcsSourceBuilder_.setMessage(value); 646 } 647 bitField0_ |= 0x00000001; 648 onChanged(); 649 return this; 650 } 651 /** 652 * 653 * 654 * <pre> 655 * The Google Cloud Storage location to read the input from. 656 * </pre> 657 * 658 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 659 */ setGcsSource(com.google.cloud.vision.v1.GcsSource.Builder builderForValue)660 public Builder setGcsSource(com.google.cloud.vision.v1.GcsSource.Builder builderForValue) { 661 if (gcsSourceBuilder_ == null) { 662 gcsSource_ = builderForValue.build(); 663 } else { 664 gcsSourceBuilder_.setMessage(builderForValue.build()); 665 } 666 bitField0_ |= 0x00000001; 667 onChanged(); 668 return this; 669 } 670 /** 671 * 672 * 673 * <pre> 674 * The Google Cloud Storage location to read the input from. 675 * </pre> 676 * 677 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 678 */ mergeGcsSource(com.google.cloud.vision.v1.GcsSource value)679 public Builder mergeGcsSource(com.google.cloud.vision.v1.GcsSource value) { 680 if (gcsSourceBuilder_ == null) { 681 if (((bitField0_ & 0x00000001) != 0) 682 && gcsSource_ != null 683 && gcsSource_ != com.google.cloud.vision.v1.GcsSource.getDefaultInstance()) { 684 getGcsSourceBuilder().mergeFrom(value); 685 } else { 686 gcsSource_ = value; 687 } 688 } else { 689 gcsSourceBuilder_.mergeFrom(value); 690 } 691 bitField0_ |= 0x00000001; 692 onChanged(); 693 return this; 694 } 695 /** 696 * 697 * 698 * <pre> 699 * The Google Cloud Storage location to read the input from. 700 * </pre> 701 * 702 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 703 */ clearGcsSource()704 public Builder clearGcsSource() { 705 bitField0_ = (bitField0_ & ~0x00000001); 706 gcsSource_ = null; 707 if (gcsSourceBuilder_ != null) { 708 gcsSourceBuilder_.dispose(); 709 gcsSourceBuilder_ = null; 710 } 711 onChanged(); 712 return this; 713 } 714 /** 715 * 716 * 717 * <pre> 718 * The Google Cloud Storage location to read the input from. 719 * </pre> 720 * 721 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 722 */ getGcsSourceBuilder()723 public com.google.cloud.vision.v1.GcsSource.Builder getGcsSourceBuilder() { 724 bitField0_ |= 0x00000001; 725 onChanged(); 726 return getGcsSourceFieldBuilder().getBuilder(); 727 } 728 /** 729 * 730 * 731 * <pre> 732 * The Google Cloud Storage location to read the input from. 733 * </pre> 734 * 735 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 736 */ getGcsSourceOrBuilder()737 public com.google.cloud.vision.v1.GcsSourceOrBuilder getGcsSourceOrBuilder() { 738 if (gcsSourceBuilder_ != null) { 739 return gcsSourceBuilder_.getMessageOrBuilder(); 740 } else { 741 return gcsSource_ == null 742 ? com.google.cloud.vision.v1.GcsSource.getDefaultInstance() 743 : gcsSource_; 744 } 745 } 746 /** 747 * 748 * 749 * <pre> 750 * The Google Cloud Storage location to read the input from. 751 * </pre> 752 * 753 * <code>.google.cloud.vision.v1.GcsSource gcs_source = 1;</code> 754 */ 755 private com.google.protobuf.SingleFieldBuilderV3< 756 com.google.cloud.vision.v1.GcsSource, 757 com.google.cloud.vision.v1.GcsSource.Builder, 758 com.google.cloud.vision.v1.GcsSourceOrBuilder> getGcsSourceFieldBuilder()759 getGcsSourceFieldBuilder() { 760 if (gcsSourceBuilder_ == null) { 761 gcsSourceBuilder_ = 762 new com.google.protobuf.SingleFieldBuilderV3< 763 com.google.cloud.vision.v1.GcsSource, 764 com.google.cloud.vision.v1.GcsSource.Builder, 765 com.google.cloud.vision.v1.GcsSourceOrBuilder>( 766 getGcsSource(), getParentForChildren(), isClean()); 767 gcsSource_ = null; 768 } 769 return gcsSourceBuilder_; 770 } 771 772 private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; 773 /** 774 * 775 * 776 * <pre> 777 * File content, represented as a stream of bytes. 778 * Note: As with all `bytes` fields, protobuffers use a pure binary 779 * representation, whereas JSON representations use base64. 780 * Currently, this field only works for BatchAnnotateFiles requests. It does 781 * not work for AsyncBatchAnnotateFiles requests. 782 * </pre> 783 * 784 * <code>bytes content = 3;</code> 785 * 786 * @return The content. 787 */ 788 @java.lang.Override getContent()789 public com.google.protobuf.ByteString getContent() { 790 return content_; 791 } 792 /** 793 * 794 * 795 * <pre> 796 * File content, represented as a stream of bytes. 797 * Note: As with all `bytes` fields, protobuffers use a pure binary 798 * representation, whereas JSON representations use base64. 799 * Currently, this field only works for BatchAnnotateFiles requests. It does 800 * not work for AsyncBatchAnnotateFiles requests. 801 * </pre> 802 * 803 * <code>bytes content = 3;</code> 804 * 805 * @param value The content to set. 806 * @return This builder for chaining. 807 */ setContent(com.google.protobuf.ByteString value)808 public Builder setContent(com.google.protobuf.ByteString value) { 809 if (value == null) { 810 throw new NullPointerException(); 811 } 812 content_ = value; 813 bitField0_ |= 0x00000002; 814 onChanged(); 815 return this; 816 } 817 /** 818 * 819 * 820 * <pre> 821 * File content, represented as a stream of bytes. 822 * Note: As with all `bytes` fields, protobuffers use a pure binary 823 * representation, whereas JSON representations use base64. 824 * Currently, this field only works for BatchAnnotateFiles requests. It does 825 * not work for AsyncBatchAnnotateFiles requests. 826 * </pre> 827 * 828 * <code>bytes content = 3;</code> 829 * 830 * @return This builder for chaining. 831 */ clearContent()832 public Builder clearContent() { 833 bitField0_ = (bitField0_ & ~0x00000002); 834 content_ = getDefaultInstance().getContent(); 835 onChanged(); 836 return this; 837 } 838 839 private java.lang.Object mimeType_ = ""; 840 /** 841 * 842 * 843 * <pre> 844 * The type of the file. Currently only "application/pdf", "image/tiff" and 845 * "image/gif" are supported. Wildcards are not supported. 846 * </pre> 847 * 848 * <code>string mime_type = 2;</code> 849 * 850 * @return The mimeType. 851 */ getMimeType()852 public java.lang.String getMimeType() { 853 java.lang.Object ref = mimeType_; 854 if (!(ref instanceof java.lang.String)) { 855 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 856 java.lang.String s = bs.toStringUtf8(); 857 mimeType_ = s; 858 return s; 859 } else { 860 return (java.lang.String) ref; 861 } 862 } 863 /** 864 * 865 * 866 * <pre> 867 * The type of the file. Currently only "application/pdf", "image/tiff" and 868 * "image/gif" are supported. Wildcards are not supported. 869 * </pre> 870 * 871 * <code>string mime_type = 2;</code> 872 * 873 * @return The bytes for mimeType. 874 */ getMimeTypeBytes()875 public com.google.protobuf.ByteString getMimeTypeBytes() { 876 java.lang.Object ref = mimeType_; 877 if (ref instanceof String) { 878 com.google.protobuf.ByteString b = 879 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 880 mimeType_ = b; 881 return b; 882 } else { 883 return (com.google.protobuf.ByteString) ref; 884 } 885 } 886 /** 887 * 888 * 889 * <pre> 890 * The type of the file. Currently only "application/pdf", "image/tiff" and 891 * "image/gif" are supported. Wildcards are not supported. 892 * </pre> 893 * 894 * <code>string mime_type = 2;</code> 895 * 896 * @param value The mimeType to set. 897 * @return This builder for chaining. 898 */ setMimeType(java.lang.String value)899 public Builder setMimeType(java.lang.String value) { 900 if (value == null) { 901 throw new NullPointerException(); 902 } 903 mimeType_ = value; 904 bitField0_ |= 0x00000004; 905 onChanged(); 906 return this; 907 } 908 /** 909 * 910 * 911 * <pre> 912 * The type of the file. Currently only "application/pdf", "image/tiff" and 913 * "image/gif" are supported. Wildcards are not supported. 914 * </pre> 915 * 916 * <code>string mime_type = 2;</code> 917 * 918 * @return This builder for chaining. 919 */ clearMimeType()920 public Builder clearMimeType() { 921 mimeType_ = getDefaultInstance().getMimeType(); 922 bitField0_ = (bitField0_ & ~0x00000004); 923 onChanged(); 924 return this; 925 } 926 /** 927 * 928 * 929 * <pre> 930 * The type of the file. Currently only "application/pdf", "image/tiff" and 931 * "image/gif" are supported. Wildcards are not supported. 932 * </pre> 933 * 934 * <code>string mime_type = 2;</code> 935 * 936 * @param value The bytes for mimeType to set. 937 * @return This builder for chaining. 938 */ setMimeTypeBytes(com.google.protobuf.ByteString value)939 public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) { 940 if (value == null) { 941 throw new NullPointerException(); 942 } 943 checkByteStringIsUtf8(value); 944 mimeType_ = value; 945 bitField0_ |= 0x00000004; 946 onChanged(); 947 return this; 948 } 949 950 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)951 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 952 return super.setUnknownFields(unknownFields); 953 } 954 955 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)956 public final Builder mergeUnknownFields( 957 final com.google.protobuf.UnknownFieldSet unknownFields) { 958 return super.mergeUnknownFields(unknownFields); 959 } 960 961 // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.InputConfig) 962 } 963 964 // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.InputConfig) 965 private static final com.google.cloud.vision.v1.InputConfig DEFAULT_INSTANCE; 966 967 static { 968 DEFAULT_INSTANCE = new com.google.cloud.vision.v1.InputConfig(); 969 } 970 getDefaultInstance()971 public static com.google.cloud.vision.v1.InputConfig getDefaultInstance() { 972 return DEFAULT_INSTANCE; 973 } 974 975 private static final com.google.protobuf.Parser<InputConfig> PARSER = 976 new com.google.protobuf.AbstractParser<InputConfig>() { 977 @java.lang.Override 978 public InputConfig parsePartialFrom( 979 com.google.protobuf.CodedInputStream input, 980 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 981 throws com.google.protobuf.InvalidProtocolBufferException { 982 Builder builder = newBuilder(); 983 try { 984 builder.mergeFrom(input, extensionRegistry); 985 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 986 throw e.setUnfinishedMessage(builder.buildPartial()); 987 } catch (com.google.protobuf.UninitializedMessageException e) { 988 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 989 } catch (java.io.IOException e) { 990 throw new com.google.protobuf.InvalidProtocolBufferException(e) 991 .setUnfinishedMessage(builder.buildPartial()); 992 } 993 return builder.buildPartial(); 994 } 995 }; 996 parser()997 public static com.google.protobuf.Parser<InputConfig> parser() { 998 return PARSER; 999 } 1000 1001 @java.lang.Override getParserForType()1002 public com.google.protobuf.Parser<InputConfig> getParserForType() { 1003 return PARSER; 1004 } 1005 1006 @java.lang.Override getDefaultInstanceForType()1007 public com.google.cloud.vision.v1.InputConfig getDefaultInstanceForType() { 1008 return DEFAULT_INSTANCE; 1009 } 1010 } 1011