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/longrunning/operations.proto 18 19 package com.google.longrunning; 20 21 /** 22 * 23 * 24 * <pre> 25 * This resource represents a long-running operation that is the result of a 26 * network API call. 27 * </pre> 28 * 29 * Protobuf type {@code google.longrunning.Operation} 30 */ 31 public final class Operation extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.longrunning.Operation) 34 OperationOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use Operation.newBuilder() to construct. Operation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private Operation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 Operation()41 private Operation() { 42 name_ = ""; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new Operation(); 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.longrunning.OperationsProto 58 .internal_static_google_longrunning_Operation_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.longrunning.OperationsProto 65 .internal_static_google_longrunning_Operation_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.longrunning.Operation.class, com.google.longrunning.Operation.Builder.class); 68 } 69 70 private int resultCase_ = 0; 71 private java.lang.Object result_; 72 73 public enum ResultCase 74 implements 75 com.google.protobuf.Internal.EnumLite, 76 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 77 ERROR(4), 78 RESPONSE(5), 79 RESULT_NOT_SET(0); 80 private final int value; 81 ResultCase(int value)82 private ResultCase(int value) { 83 this.value = value; 84 } 85 /** 86 * @param value The number of the enum to look for. 87 * @return The enum associated with the given number. 88 * @deprecated Use {@link #forNumber(int)} instead. 89 */ 90 @java.lang.Deprecated valueOf(int value)91 public static ResultCase valueOf(int value) { 92 return forNumber(value); 93 } 94 forNumber(int value)95 public static ResultCase forNumber(int value) { 96 switch (value) { 97 case 4: 98 return ERROR; 99 case 5: 100 return RESPONSE; 101 case 0: 102 return RESULT_NOT_SET; 103 default: 104 return null; 105 } 106 } 107 getNumber()108 public int getNumber() { 109 return this.value; 110 } 111 }; 112 getResultCase()113 public ResultCase getResultCase() { 114 return ResultCase.forNumber(resultCase_); 115 } 116 117 public static final int NAME_FIELD_NUMBER = 1; 118 119 @SuppressWarnings("serial") 120 private volatile java.lang.Object name_ = ""; 121 /** 122 * 123 * 124 * <pre> 125 * The server-assigned name, which is only unique within the same service that 126 * originally returns it. If you use the default HTTP mapping, the 127 * `name` should be a resource name ending with `operations/{unique_id}`. 128 * </pre> 129 * 130 * <code>string name = 1;</code> 131 * 132 * @return The name. 133 */ 134 @java.lang.Override getName()135 public java.lang.String getName() { 136 java.lang.Object ref = name_; 137 if (ref instanceof java.lang.String) { 138 return (java.lang.String) ref; 139 } else { 140 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 141 java.lang.String s = bs.toStringUtf8(); 142 name_ = s; 143 return s; 144 } 145 } 146 /** 147 * 148 * 149 * <pre> 150 * The server-assigned name, which is only unique within the same service that 151 * originally returns it. If you use the default HTTP mapping, the 152 * `name` should be a resource name ending with `operations/{unique_id}`. 153 * </pre> 154 * 155 * <code>string name = 1;</code> 156 * 157 * @return The bytes for name. 158 */ 159 @java.lang.Override getNameBytes()160 public com.google.protobuf.ByteString getNameBytes() { 161 java.lang.Object ref = name_; 162 if (ref instanceof java.lang.String) { 163 com.google.protobuf.ByteString b = 164 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 165 name_ = b; 166 return b; 167 } else { 168 return (com.google.protobuf.ByteString) ref; 169 } 170 } 171 172 public static final int METADATA_FIELD_NUMBER = 2; 173 private com.google.protobuf.Any metadata_; 174 /** 175 * 176 * 177 * <pre> 178 * Service-specific metadata associated with the operation. It typically 179 * contains progress information and common metadata such as create time. 180 * Some services might not provide such metadata. Any method that returns a 181 * long-running operation should document the metadata type, if any. 182 * </pre> 183 * 184 * <code>.google.protobuf.Any metadata = 2;</code> 185 * 186 * @return Whether the metadata field is set. 187 */ 188 @java.lang.Override hasMetadata()189 public boolean hasMetadata() { 190 return metadata_ != null; 191 } 192 /** 193 * 194 * 195 * <pre> 196 * Service-specific metadata associated with the operation. It typically 197 * contains progress information and common metadata such as create time. 198 * Some services might not provide such metadata. Any method that returns a 199 * long-running operation should document the metadata type, if any. 200 * </pre> 201 * 202 * <code>.google.protobuf.Any metadata = 2;</code> 203 * 204 * @return The metadata. 205 */ 206 @java.lang.Override getMetadata()207 public com.google.protobuf.Any getMetadata() { 208 return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; 209 } 210 /** 211 * 212 * 213 * <pre> 214 * Service-specific metadata associated with the operation. It typically 215 * contains progress information and common metadata such as create time. 216 * Some services might not provide such metadata. Any method that returns a 217 * long-running operation should document the metadata type, if any. 218 * </pre> 219 * 220 * <code>.google.protobuf.Any metadata = 2;</code> 221 */ 222 @java.lang.Override getMetadataOrBuilder()223 public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { 224 return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; 225 } 226 227 public static final int DONE_FIELD_NUMBER = 3; 228 private boolean done_ = false; 229 /** 230 * 231 * 232 * <pre> 233 * If the value is `false`, it means the operation is still in progress. 234 * If `true`, the operation is completed, and either `error` or `response` is 235 * available. 236 * </pre> 237 * 238 * <code>bool done = 3;</code> 239 * 240 * @return The done. 241 */ 242 @java.lang.Override getDone()243 public boolean getDone() { 244 return done_; 245 } 246 247 public static final int ERROR_FIELD_NUMBER = 4; 248 /** 249 * 250 * 251 * <pre> 252 * The error result of the operation in case of failure or cancellation. 253 * </pre> 254 * 255 * <code>.google.rpc.Status error = 4;</code> 256 * 257 * @return Whether the error field is set. 258 */ 259 @java.lang.Override hasError()260 public boolean hasError() { 261 return resultCase_ == 4; 262 } 263 /** 264 * 265 * 266 * <pre> 267 * The error result of the operation in case of failure or cancellation. 268 * </pre> 269 * 270 * <code>.google.rpc.Status error = 4;</code> 271 * 272 * @return The error. 273 */ 274 @java.lang.Override getError()275 public com.google.rpc.Status getError() { 276 if (resultCase_ == 4) { 277 return (com.google.rpc.Status) result_; 278 } 279 return com.google.rpc.Status.getDefaultInstance(); 280 } 281 /** 282 * 283 * 284 * <pre> 285 * The error result of the operation in case of failure or cancellation. 286 * </pre> 287 * 288 * <code>.google.rpc.Status error = 4;</code> 289 */ 290 @java.lang.Override getErrorOrBuilder()291 public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { 292 if (resultCase_ == 4) { 293 return (com.google.rpc.Status) result_; 294 } 295 return com.google.rpc.Status.getDefaultInstance(); 296 } 297 298 public static final int RESPONSE_FIELD_NUMBER = 5; 299 /** 300 * 301 * 302 * <pre> 303 * The normal response of the operation in case of success. If the original 304 * method returns no data on success, such as `Delete`, the response is 305 * `google.protobuf.Empty`. If the original method is standard 306 * `Get`/`Create`/`Update`, the response should be the resource. For other 307 * methods, the response should have the type `XxxResponse`, where `Xxx` 308 * is the original method name. For example, if the original method name 309 * is `TakeSnapshot()`, the inferred response type is 310 * `TakeSnapshotResponse`. 311 * </pre> 312 * 313 * <code>.google.protobuf.Any response = 5;</code> 314 * 315 * @return Whether the response field is set. 316 */ 317 @java.lang.Override hasResponse()318 public boolean hasResponse() { 319 return resultCase_ == 5; 320 } 321 /** 322 * 323 * 324 * <pre> 325 * The normal response of the operation in case of success. If the original 326 * method returns no data on success, such as `Delete`, the response is 327 * `google.protobuf.Empty`. If the original method is standard 328 * `Get`/`Create`/`Update`, the response should be the resource. For other 329 * methods, the response should have the type `XxxResponse`, where `Xxx` 330 * is the original method name. For example, if the original method name 331 * is `TakeSnapshot()`, the inferred response type is 332 * `TakeSnapshotResponse`. 333 * </pre> 334 * 335 * <code>.google.protobuf.Any response = 5;</code> 336 * 337 * @return The response. 338 */ 339 @java.lang.Override getResponse()340 public com.google.protobuf.Any getResponse() { 341 if (resultCase_ == 5) { 342 return (com.google.protobuf.Any) result_; 343 } 344 return com.google.protobuf.Any.getDefaultInstance(); 345 } 346 /** 347 * 348 * 349 * <pre> 350 * The normal response of the operation in case of success. If the original 351 * method returns no data on success, such as `Delete`, the response is 352 * `google.protobuf.Empty`. If the original method is standard 353 * `Get`/`Create`/`Update`, the response should be the resource. For other 354 * methods, the response should have the type `XxxResponse`, where `Xxx` 355 * is the original method name. For example, if the original method name 356 * is `TakeSnapshot()`, the inferred response type is 357 * `TakeSnapshotResponse`. 358 * </pre> 359 * 360 * <code>.google.protobuf.Any response = 5;</code> 361 */ 362 @java.lang.Override getResponseOrBuilder()363 public com.google.protobuf.AnyOrBuilder getResponseOrBuilder() { 364 if (resultCase_ == 5) { 365 return (com.google.protobuf.Any) result_; 366 } 367 return com.google.protobuf.Any.getDefaultInstance(); 368 } 369 370 private byte memoizedIsInitialized = -1; 371 372 @java.lang.Override isInitialized()373 public final boolean isInitialized() { 374 byte isInitialized = memoizedIsInitialized; 375 if (isInitialized == 1) return true; 376 if (isInitialized == 0) return false; 377 378 memoizedIsInitialized = 1; 379 return true; 380 } 381 382 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)383 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 384 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 385 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 386 } 387 if (metadata_ != null) { 388 output.writeMessage(2, getMetadata()); 389 } 390 if (done_ != false) { 391 output.writeBool(3, done_); 392 } 393 if (resultCase_ == 4) { 394 output.writeMessage(4, (com.google.rpc.Status) result_); 395 } 396 if (resultCase_ == 5) { 397 output.writeMessage(5, (com.google.protobuf.Any) result_); 398 } 399 getUnknownFields().writeTo(output); 400 } 401 402 @java.lang.Override getSerializedSize()403 public int getSerializedSize() { 404 int size = memoizedSize; 405 if (size != -1) return size; 406 407 size = 0; 408 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 409 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 410 } 411 if (metadata_ != null) { 412 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata()); 413 } 414 if (done_ != false) { 415 size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, done_); 416 } 417 if (resultCase_ == 4) { 418 size += 419 com.google.protobuf.CodedOutputStream.computeMessageSize( 420 4, (com.google.rpc.Status) result_); 421 } 422 if (resultCase_ == 5) { 423 size += 424 com.google.protobuf.CodedOutputStream.computeMessageSize( 425 5, (com.google.protobuf.Any) result_); 426 } 427 size += getUnknownFields().getSerializedSize(); 428 memoizedSize = size; 429 return size; 430 } 431 432 @java.lang.Override equals(final java.lang.Object obj)433 public boolean equals(final java.lang.Object obj) { 434 if (obj == this) { 435 return true; 436 } 437 if (!(obj instanceof com.google.longrunning.Operation)) { 438 return super.equals(obj); 439 } 440 com.google.longrunning.Operation other = (com.google.longrunning.Operation) obj; 441 442 if (!getName().equals(other.getName())) return false; 443 if (hasMetadata() != other.hasMetadata()) return false; 444 if (hasMetadata()) { 445 if (!getMetadata().equals(other.getMetadata())) return false; 446 } 447 if (getDone() != other.getDone()) return false; 448 if (!getResultCase().equals(other.getResultCase())) return false; 449 switch (resultCase_) { 450 case 4: 451 if (!getError().equals(other.getError())) return false; 452 break; 453 case 5: 454 if (!getResponse().equals(other.getResponse())) return false; 455 break; 456 case 0: 457 default: 458 } 459 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 460 return true; 461 } 462 463 @java.lang.Override hashCode()464 public int hashCode() { 465 if (memoizedHashCode != 0) { 466 return memoizedHashCode; 467 } 468 int hash = 41; 469 hash = (19 * hash) + getDescriptor().hashCode(); 470 hash = (37 * hash) + NAME_FIELD_NUMBER; 471 hash = (53 * hash) + getName().hashCode(); 472 if (hasMetadata()) { 473 hash = (37 * hash) + METADATA_FIELD_NUMBER; 474 hash = (53 * hash) + getMetadata().hashCode(); 475 } 476 hash = (37 * hash) + DONE_FIELD_NUMBER; 477 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDone()); 478 switch (resultCase_) { 479 case 4: 480 hash = (37 * hash) + ERROR_FIELD_NUMBER; 481 hash = (53 * hash) + getError().hashCode(); 482 break; 483 case 5: 484 hash = (37 * hash) + RESPONSE_FIELD_NUMBER; 485 hash = (53 * hash) + getResponse().hashCode(); 486 break; 487 case 0: 488 default: 489 } 490 hash = (29 * hash) + getUnknownFields().hashCode(); 491 memoizedHashCode = hash; 492 return hash; 493 } 494 parseFrom(java.nio.ByteBuffer data)495 public static com.google.longrunning.Operation parseFrom(java.nio.ByteBuffer data) 496 throws com.google.protobuf.InvalidProtocolBufferException { 497 return PARSER.parseFrom(data); 498 } 499 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)500 public static com.google.longrunning.Operation parseFrom( 501 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 502 throws com.google.protobuf.InvalidProtocolBufferException { 503 return PARSER.parseFrom(data, extensionRegistry); 504 } 505 parseFrom(com.google.protobuf.ByteString data)506 public static com.google.longrunning.Operation parseFrom(com.google.protobuf.ByteString data) 507 throws com.google.protobuf.InvalidProtocolBufferException { 508 return PARSER.parseFrom(data); 509 } 510 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)511 public static com.google.longrunning.Operation parseFrom( 512 com.google.protobuf.ByteString data, 513 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 514 throws com.google.protobuf.InvalidProtocolBufferException { 515 return PARSER.parseFrom(data, extensionRegistry); 516 } 517 parseFrom(byte[] data)518 public static com.google.longrunning.Operation parseFrom(byte[] data) 519 throws com.google.protobuf.InvalidProtocolBufferException { 520 return PARSER.parseFrom(data); 521 } 522 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)523 public static com.google.longrunning.Operation parseFrom( 524 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 525 throws com.google.protobuf.InvalidProtocolBufferException { 526 return PARSER.parseFrom(data, extensionRegistry); 527 } 528 parseFrom(java.io.InputStream input)529 public static com.google.longrunning.Operation parseFrom(java.io.InputStream input) 530 throws java.io.IOException { 531 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 532 } 533 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)534 public static com.google.longrunning.Operation parseFrom( 535 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 536 throws java.io.IOException { 537 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 538 PARSER, input, extensionRegistry); 539 } 540 parseDelimitedFrom(java.io.InputStream input)541 public static com.google.longrunning.Operation parseDelimitedFrom(java.io.InputStream input) 542 throws java.io.IOException { 543 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 544 } 545 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)546 public static com.google.longrunning.Operation parseDelimitedFrom( 547 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 548 throws java.io.IOException { 549 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 550 PARSER, input, extensionRegistry); 551 } 552 parseFrom( com.google.protobuf.CodedInputStream input)553 public static com.google.longrunning.Operation parseFrom( 554 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 555 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 556 } 557 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)558 public static com.google.longrunning.Operation parseFrom( 559 com.google.protobuf.CodedInputStream input, 560 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 561 throws java.io.IOException { 562 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 563 PARSER, input, extensionRegistry); 564 } 565 566 @java.lang.Override newBuilderForType()567 public Builder newBuilderForType() { 568 return newBuilder(); 569 } 570 newBuilder()571 public static Builder newBuilder() { 572 return DEFAULT_INSTANCE.toBuilder(); 573 } 574 newBuilder(com.google.longrunning.Operation prototype)575 public static Builder newBuilder(com.google.longrunning.Operation prototype) { 576 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 577 } 578 579 @java.lang.Override toBuilder()580 public Builder toBuilder() { 581 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 582 } 583 584 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)585 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 586 Builder builder = new Builder(parent); 587 return builder; 588 } 589 /** 590 * 591 * 592 * <pre> 593 * This resource represents a long-running operation that is the result of a 594 * network API call. 595 * </pre> 596 * 597 * Protobuf type {@code google.longrunning.Operation} 598 */ 599 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 600 implements 601 // @@protoc_insertion_point(builder_implements:google.longrunning.Operation) 602 com.google.longrunning.OperationOrBuilder { getDescriptor()603 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 604 return com.google.longrunning.OperationsProto 605 .internal_static_google_longrunning_Operation_descriptor; 606 } 607 608 @java.lang.Override 609 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()610 internalGetFieldAccessorTable() { 611 return com.google.longrunning.OperationsProto 612 .internal_static_google_longrunning_Operation_fieldAccessorTable 613 .ensureFieldAccessorsInitialized( 614 com.google.longrunning.Operation.class, 615 com.google.longrunning.Operation.Builder.class); 616 } 617 618 // Construct using com.google.longrunning.Operation.newBuilder() Builder()619 private Builder() {} 620 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)621 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 622 super(parent); 623 } 624 625 @java.lang.Override clear()626 public Builder clear() { 627 super.clear(); 628 bitField0_ = 0; 629 name_ = ""; 630 metadata_ = null; 631 if (metadataBuilder_ != null) { 632 metadataBuilder_.dispose(); 633 metadataBuilder_ = null; 634 } 635 done_ = false; 636 if (errorBuilder_ != null) { 637 errorBuilder_.clear(); 638 } 639 if (responseBuilder_ != null) { 640 responseBuilder_.clear(); 641 } 642 resultCase_ = 0; 643 result_ = null; 644 return this; 645 } 646 647 @java.lang.Override getDescriptorForType()648 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 649 return com.google.longrunning.OperationsProto 650 .internal_static_google_longrunning_Operation_descriptor; 651 } 652 653 @java.lang.Override getDefaultInstanceForType()654 public com.google.longrunning.Operation getDefaultInstanceForType() { 655 return com.google.longrunning.Operation.getDefaultInstance(); 656 } 657 658 @java.lang.Override build()659 public com.google.longrunning.Operation build() { 660 com.google.longrunning.Operation result = buildPartial(); 661 if (!result.isInitialized()) { 662 throw newUninitializedMessageException(result); 663 } 664 return result; 665 } 666 667 @java.lang.Override buildPartial()668 public com.google.longrunning.Operation buildPartial() { 669 com.google.longrunning.Operation result = new com.google.longrunning.Operation(this); 670 if (bitField0_ != 0) { 671 buildPartial0(result); 672 } 673 buildPartialOneofs(result); 674 onBuilt(); 675 return result; 676 } 677 buildPartial0(com.google.longrunning.Operation result)678 private void buildPartial0(com.google.longrunning.Operation result) { 679 int from_bitField0_ = bitField0_; 680 if (((from_bitField0_ & 0x00000001) != 0)) { 681 result.name_ = name_; 682 } 683 if (((from_bitField0_ & 0x00000002) != 0)) { 684 result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); 685 } 686 if (((from_bitField0_ & 0x00000004) != 0)) { 687 result.done_ = done_; 688 } 689 } 690 buildPartialOneofs(com.google.longrunning.Operation result)691 private void buildPartialOneofs(com.google.longrunning.Operation result) { 692 result.resultCase_ = resultCase_; 693 result.result_ = this.result_; 694 if (resultCase_ == 4 && errorBuilder_ != null) { 695 result.result_ = errorBuilder_.build(); 696 } 697 if (resultCase_ == 5 && responseBuilder_ != null) { 698 result.result_ = responseBuilder_.build(); 699 } 700 } 701 702 @java.lang.Override clone()703 public Builder clone() { 704 return super.clone(); 705 } 706 707 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)708 public Builder setField( 709 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 710 return super.setField(field, value); 711 } 712 713 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)714 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 715 return super.clearField(field); 716 } 717 718 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)719 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 720 return super.clearOneof(oneof); 721 } 722 723 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)724 public Builder setRepeatedField( 725 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 726 return super.setRepeatedField(field, index, value); 727 } 728 729 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)730 public Builder addRepeatedField( 731 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 732 return super.addRepeatedField(field, value); 733 } 734 735 @java.lang.Override mergeFrom(com.google.protobuf.Message other)736 public Builder mergeFrom(com.google.protobuf.Message other) { 737 if (other instanceof com.google.longrunning.Operation) { 738 return mergeFrom((com.google.longrunning.Operation) other); 739 } else { 740 super.mergeFrom(other); 741 return this; 742 } 743 } 744 mergeFrom(com.google.longrunning.Operation other)745 public Builder mergeFrom(com.google.longrunning.Operation other) { 746 if (other == com.google.longrunning.Operation.getDefaultInstance()) return this; 747 if (!other.getName().isEmpty()) { 748 name_ = other.name_; 749 bitField0_ |= 0x00000001; 750 onChanged(); 751 } 752 if (other.hasMetadata()) { 753 mergeMetadata(other.getMetadata()); 754 } 755 if (other.getDone() != false) { 756 setDone(other.getDone()); 757 } 758 switch (other.getResultCase()) { 759 case ERROR: 760 { 761 mergeError(other.getError()); 762 break; 763 } 764 case RESPONSE: 765 { 766 mergeResponse(other.getResponse()); 767 break; 768 } 769 case RESULT_NOT_SET: 770 { 771 break; 772 } 773 } 774 this.mergeUnknownFields(other.getUnknownFields()); 775 onChanged(); 776 return this; 777 } 778 779 @java.lang.Override isInitialized()780 public final boolean isInitialized() { 781 return true; 782 } 783 784 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)785 public Builder mergeFrom( 786 com.google.protobuf.CodedInputStream input, 787 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 788 throws java.io.IOException { 789 if (extensionRegistry == null) { 790 throw new java.lang.NullPointerException(); 791 } 792 try { 793 boolean done = false; 794 while (!done) { 795 int tag = input.readTag(); 796 switch (tag) { 797 case 0: 798 done = true; 799 break; 800 case 10: 801 { 802 name_ = input.readStringRequireUtf8(); 803 bitField0_ |= 0x00000001; 804 break; 805 } // case 10 806 case 18: 807 { 808 input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); 809 bitField0_ |= 0x00000002; 810 break; 811 } // case 18 812 case 24: 813 { 814 done_ = input.readBool(); 815 bitField0_ |= 0x00000004; 816 break; 817 } // case 24 818 case 34: 819 { 820 input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); 821 resultCase_ = 4; 822 break; 823 } // case 34 824 case 42: 825 { 826 input.readMessage(getResponseFieldBuilder().getBuilder(), extensionRegistry); 827 resultCase_ = 5; 828 break; 829 } // case 42 830 default: 831 { 832 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 833 done = true; // was an endgroup tag 834 } 835 break; 836 } // default: 837 } // switch (tag) 838 } // while (!done) 839 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 840 throw e.unwrapIOException(); 841 } finally { 842 onChanged(); 843 } // finally 844 return this; 845 } 846 847 private int resultCase_ = 0; 848 private java.lang.Object result_; 849 getResultCase()850 public ResultCase getResultCase() { 851 return ResultCase.forNumber(resultCase_); 852 } 853 clearResult()854 public Builder clearResult() { 855 resultCase_ = 0; 856 result_ = null; 857 onChanged(); 858 return this; 859 } 860 861 private int bitField0_; 862 863 private java.lang.Object name_ = ""; 864 /** 865 * 866 * 867 * <pre> 868 * The server-assigned name, which is only unique within the same service that 869 * originally returns it. If you use the default HTTP mapping, the 870 * `name` should be a resource name ending with `operations/{unique_id}`. 871 * </pre> 872 * 873 * <code>string name = 1;</code> 874 * 875 * @return The name. 876 */ getName()877 public java.lang.String getName() { 878 java.lang.Object ref = name_; 879 if (!(ref instanceof java.lang.String)) { 880 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 881 java.lang.String s = bs.toStringUtf8(); 882 name_ = s; 883 return s; 884 } else { 885 return (java.lang.String) ref; 886 } 887 } 888 /** 889 * 890 * 891 * <pre> 892 * The server-assigned name, which is only unique within the same service that 893 * originally returns it. If you use the default HTTP mapping, the 894 * `name` should be a resource name ending with `operations/{unique_id}`. 895 * </pre> 896 * 897 * <code>string name = 1;</code> 898 * 899 * @return The bytes for name. 900 */ getNameBytes()901 public com.google.protobuf.ByteString getNameBytes() { 902 java.lang.Object ref = name_; 903 if (ref instanceof String) { 904 com.google.protobuf.ByteString b = 905 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 906 name_ = b; 907 return b; 908 } else { 909 return (com.google.protobuf.ByteString) ref; 910 } 911 } 912 /** 913 * 914 * 915 * <pre> 916 * The server-assigned name, which is only unique within the same service that 917 * originally returns it. If you use the default HTTP mapping, the 918 * `name` should be a resource name ending with `operations/{unique_id}`. 919 * </pre> 920 * 921 * <code>string name = 1;</code> 922 * 923 * @param value The name to set. 924 * @return This builder for chaining. 925 */ setName(java.lang.String value)926 public Builder setName(java.lang.String value) { 927 if (value == null) { 928 throw new NullPointerException(); 929 } 930 name_ = value; 931 bitField0_ |= 0x00000001; 932 onChanged(); 933 return this; 934 } 935 /** 936 * 937 * 938 * <pre> 939 * The server-assigned name, which is only unique within the same service that 940 * originally returns it. If you use the default HTTP mapping, the 941 * `name` should be a resource name ending with `operations/{unique_id}`. 942 * </pre> 943 * 944 * <code>string name = 1;</code> 945 * 946 * @return This builder for chaining. 947 */ clearName()948 public Builder clearName() { 949 name_ = getDefaultInstance().getName(); 950 bitField0_ = (bitField0_ & ~0x00000001); 951 onChanged(); 952 return this; 953 } 954 /** 955 * 956 * 957 * <pre> 958 * The server-assigned name, which is only unique within the same service that 959 * originally returns it. If you use the default HTTP mapping, the 960 * `name` should be a resource name ending with `operations/{unique_id}`. 961 * </pre> 962 * 963 * <code>string name = 1;</code> 964 * 965 * @param value The bytes for name to set. 966 * @return This builder for chaining. 967 */ setNameBytes(com.google.protobuf.ByteString value)968 public Builder setNameBytes(com.google.protobuf.ByteString value) { 969 if (value == null) { 970 throw new NullPointerException(); 971 } 972 checkByteStringIsUtf8(value); 973 name_ = value; 974 bitField0_ |= 0x00000001; 975 onChanged(); 976 return this; 977 } 978 979 private com.google.protobuf.Any metadata_; 980 private com.google.protobuf.SingleFieldBuilderV3< 981 com.google.protobuf.Any, 982 com.google.protobuf.Any.Builder, 983 com.google.protobuf.AnyOrBuilder> 984 metadataBuilder_; 985 /** 986 * 987 * 988 * <pre> 989 * Service-specific metadata associated with the operation. It typically 990 * contains progress information and common metadata such as create time. 991 * Some services might not provide such metadata. Any method that returns a 992 * long-running operation should document the metadata type, if any. 993 * </pre> 994 * 995 * <code>.google.protobuf.Any metadata = 2;</code> 996 * 997 * @return Whether the metadata field is set. 998 */ hasMetadata()999 public boolean hasMetadata() { 1000 return ((bitField0_ & 0x00000002) != 0); 1001 } 1002 /** 1003 * 1004 * 1005 * <pre> 1006 * Service-specific metadata associated with the operation. It typically 1007 * contains progress information and common metadata such as create time. 1008 * Some services might not provide such metadata. Any method that returns a 1009 * long-running operation should document the metadata type, if any. 1010 * </pre> 1011 * 1012 * <code>.google.protobuf.Any metadata = 2;</code> 1013 * 1014 * @return The metadata. 1015 */ getMetadata()1016 public com.google.protobuf.Any getMetadata() { 1017 if (metadataBuilder_ == null) { 1018 return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; 1019 } else { 1020 return metadataBuilder_.getMessage(); 1021 } 1022 } 1023 /** 1024 * 1025 * 1026 * <pre> 1027 * Service-specific metadata associated with the operation. It typically 1028 * contains progress information and common metadata such as create time. 1029 * Some services might not provide such metadata. Any method that returns a 1030 * long-running operation should document the metadata type, if any. 1031 * </pre> 1032 * 1033 * <code>.google.protobuf.Any metadata = 2;</code> 1034 */ setMetadata(com.google.protobuf.Any value)1035 public Builder setMetadata(com.google.protobuf.Any value) { 1036 if (metadataBuilder_ == null) { 1037 if (value == null) { 1038 throw new NullPointerException(); 1039 } 1040 metadata_ = value; 1041 } else { 1042 metadataBuilder_.setMessage(value); 1043 } 1044 bitField0_ |= 0x00000002; 1045 onChanged(); 1046 return this; 1047 } 1048 /** 1049 * 1050 * 1051 * <pre> 1052 * Service-specific metadata associated with the operation. It typically 1053 * contains progress information and common metadata such as create time. 1054 * Some services might not provide such metadata. Any method that returns a 1055 * long-running operation should document the metadata type, if any. 1056 * </pre> 1057 * 1058 * <code>.google.protobuf.Any metadata = 2;</code> 1059 */ setMetadata(com.google.protobuf.Any.Builder builderForValue)1060 public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) { 1061 if (metadataBuilder_ == null) { 1062 metadata_ = builderForValue.build(); 1063 } else { 1064 metadataBuilder_.setMessage(builderForValue.build()); 1065 } 1066 bitField0_ |= 0x00000002; 1067 onChanged(); 1068 return this; 1069 } 1070 /** 1071 * 1072 * 1073 * <pre> 1074 * Service-specific metadata associated with the operation. It typically 1075 * contains progress information and common metadata such as create time. 1076 * Some services might not provide such metadata. Any method that returns a 1077 * long-running operation should document the metadata type, if any. 1078 * </pre> 1079 * 1080 * <code>.google.protobuf.Any metadata = 2;</code> 1081 */ mergeMetadata(com.google.protobuf.Any value)1082 public Builder mergeMetadata(com.google.protobuf.Any value) { 1083 if (metadataBuilder_ == null) { 1084 if (((bitField0_ & 0x00000002) != 0) 1085 && metadata_ != null 1086 && metadata_ != com.google.protobuf.Any.getDefaultInstance()) { 1087 getMetadataBuilder().mergeFrom(value); 1088 } else { 1089 metadata_ = value; 1090 } 1091 } else { 1092 metadataBuilder_.mergeFrom(value); 1093 } 1094 bitField0_ |= 0x00000002; 1095 onChanged(); 1096 return this; 1097 } 1098 /** 1099 * 1100 * 1101 * <pre> 1102 * Service-specific metadata associated with the operation. It typically 1103 * contains progress information and common metadata such as create time. 1104 * Some services might not provide such metadata. Any method that returns a 1105 * long-running operation should document the metadata type, if any. 1106 * </pre> 1107 * 1108 * <code>.google.protobuf.Any metadata = 2;</code> 1109 */ clearMetadata()1110 public Builder clearMetadata() { 1111 bitField0_ = (bitField0_ & ~0x00000002); 1112 metadata_ = null; 1113 if (metadataBuilder_ != null) { 1114 metadataBuilder_.dispose(); 1115 metadataBuilder_ = null; 1116 } 1117 onChanged(); 1118 return this; 1119 } 1120 /** 1121 * 1122 * 1123 * <pre> 1124 * Service-specific metadata associated with the operation. It typically 1125 * contains progress information and common metadata such as create time. 1126 * Some services might not provide such metadata. Any method that returns a 1127 * long-running operation should document the metadata type, if any. 1128 * </pre> 1129 * 1130 * <code>.google.protobuf.Any metadata = 2;</code> 1131 */ getMetadataBuilder()1132 public com.google.protobuf.Any.Builder getMetadataBuilder() { 1133 bitField0_ |= 0x00000002; 1134 onChanged(); 1135 return getMetadataFieldBuilder().getBuilder(); 1136 } 1137 /** 1138 * 1139 * 1140 * <pre> 1141 * Service-specific metadata associated with the operation. It typically 1142 * contains progress information and common metadata such as create time. 1143 * Some services might not provide such metadata. Any method that returns a 1144 * long-running operation should document the metadata type, if any. 1145 * </pre> 1146 * 1147 * <code>.google.protobuf.Any metadata = 2;</code> 1148 */ getMetadataOrBuilder()1149 public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { 1150 if (metadataBuilder_ != null) { 1151 return metadataBuilder_.getMessageOrBuilder(); 1152 } else { 1153 return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; 1154 } 1155 } 1156 /** 1157 * 1158 * 1159 * <pre> 1160 * Service-specific metadata associated with the operation. It typically 1161 * contains progress information and common metadata such as create time. 1162 * Some services might not provide such metadata. Any method that returns a 1163 * long-running operation should document the metadata type, if any. 1164 * </pre> 1165 * 1166 * <code>.google.protobuf.Any metadata = 2;</code> 1167 */ 1168 private com.google.protobuf.SingleFieldBuilderV3< 1169 com.google.protobuf.Any, 1170 com.google.protobuf.Any.Builder, 1171 com.google.protobuf.AnyOrBuilder> getMetadataFieldBuilder()1172 getMetadataFieldBuilder() { 1173 if (metadataBuilder_ == null) { 1174 metadataBuilder_ = 1175 new com.google.protobuf.SingleFieldBuilderV3< 1176 com.google.protobuf.Any, 1177 com.google.protobuf.Any.Builder, 1178 com.google.protobuf.AnyOrBuilder>(getMetadata(), getParentForChildren(), isClean()); 1179 metadata_ = null; 1180 } 1181 return metadataBuilder_; 1182 } 1183 1184 private boolean done_; 1185 /** 1186 * 1187 * 1188 * <pre> 1189 * If the value is `false`, it means the operation is still in progress. 1190 * If `true`, the operation is completed, and either `error` or `response` is 1191 * available. 1192 * </pre> 1193 * 1194 * <code>bool done = 3;</code> 1195 * 1196 * @return The done. 1197 */ 1198 @java.lang.Override getDone()1199 public boolean getDone() { 1200 return done_; 1201 } 1202 /** 1203 * 1204 * 1205 * <pre> 1206 * If the value is `false`, it means the operation is still in progress. 1207 * If `true`, the operation is completed, and either `error` or `response` is 1208 * available. 1209 * </pre> 1210 * 1211 * <code>bool done = 3;</code> 1212 * 1213 * @param value The done to set. 1214 * @return This builder for chaining. 1215 */ setDone(boolean value)1216 public Builder setDone(boolean value) { 1217 1218 done_ = value; 1219 bitField0_ |= 0x00000004; 1220 onChanged(); 1221 return this; 1222 } 1223 /** 1224 * 1225 * 1226 * <pre> 1227 * If the value is `false`, it means the operation is still in progress. 1228 * If `true`, the operation is completed, and either `error` or `response` is 1229 * available. 1230 * </pre> 1231 * 1232 * <code>bool done = 3;</code> 1233 * 1234 * @return This builder for chaining. 1235 */ clearDone()1236 public Builder clearDone() { 1237 bitField0_ = (bitField0_ & ~0x00000004); 1238 done_ = false; 1239 onChanged(); 1240 return this; 1241 } 1242 1243 private com.google.protobuf.SingleFieldBuilderV3< 1244 com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> 1245 errorBuilder_; 1246 /** 1247 * 1248 * 1249 * <pre> 1250 * The error result of the operation in case of failure or cancellation. 1251 * </pre> 1252 * 1253 * <code>.google.rpc.Status error = 4;</code> 1254 * 1255 * @return Whether the error field is set. 1256 */ 1257 @java.lang.Override hasError()1258 public boolean hasError() { 1259 return resultCase_ == 4; 1260 } 1261 /** 1262 * 1263 * 1264 * <pre> 1265 * The error result of the operation in case of failure or cancellation. 1266 * </pre> 1267 * 1268 * <code>.google.rpc.Status error = 4;</code> 1269 * 1270 * @return The error. 1271 */ 1272 @java.lang.Override getError()1273 public com.google.rpc.Status getError() { 1274 if (errorBuilder_ == null) { 1275 if (resultCase_ == 4) { 1276 return (com.google.rpc.Status) result_; 1277 } 1278 return com.google.rpc.Status.getDefaultInstance(); 1279 } else { 1280 if (resultCase_ == 4) { 1281 return errorBuilder_.getMessage(); 1282 } 1283 return com.google.rpc.Status.getDefaultInstance(); 1284 } 1285 } 1286 /** 1287 * 1288 * 1289 * <pre> 1290 * The error result of the operation in case of failure or cancellation. 1291 * </pre> 1292 * 1293 * <code>.google.rpc.Status error = 4;</code> 1294 */ setError(com.google.rpc.Status value)1295 public Builder setError(com.google.rpc.Status value) { 1296 if (errorBuilder_ == null) { 1297 if (value == null) { 1298 throw new NullPointerException(); 1299 } 1300 result_ = value; 1301 onChanged(); 1302 } else { 1303 errorBuilder_.setMessage(value); 1304 } 1305 resultCase_ = 4; 1306 return this; 1307 } 1308 /** 1309 * 1310 * 1311 * <pre> 1312 * The error result of the operation in case of failure or cancellation. 1313 * </pre> 1314 * 1315 * <code>.google.rpc.Status error = 4;</code> 1316 */ setError(com.google.rpc.Status.Builder builderForValue)1317 public Builder setError(com.google.rpc.Status.Builder builderForValue) { 1318 if (errorBuilder_ == null) { 1319 result_ = builderForValue.build(); 1320 onChanged(); 1321 } else { 1322 errorBuilder_.setMessage(builderForValue.build()); 1323 } 1324 resultCase_ = 4; 1325 return this; 1326 } 1327 /** 1328 * 1329 * 1330 * <pre> 1331 * The error result of the operation in case of failure or cancellation. 1332 * </pre> 1333 * 1334 * <code>.google.rpc.Status error = 4;</code> 1335 */ mergeError(com.google.rpc.Status value)1336 public Builder mergeError(com.google.rpc.Status value) { 1337 if (errorBuilder_ == null) { 1338 if (resultCase_ == 4 && result_ != com.google.rpc.Status.getDefaultInstance()) { 1339 result_ = 1340 com.google.rpc.Status.newBuilder((com.google.rpc.Status) result_) 1341 .mergeFrom(value) 1342 .buildPartial(); 1343 } else { 1344 result_ = value; 1345 } 1346 onChanged(); 1347 } else { 1348 if (resultCase_ == 4) { 1349 errorBuilder_.mergeFrom(value); 1350 } else { 1351 errorBuilder_.setMessage(value); 1352 } 1353 } 1354 resultCase_ = 4; 1355 return this; 1356 } 1357 /** 1358 * 1359 * 1360 * <pre> 1361 * The error result of the operation in case of failure or cancellation. 1362 * </pre> 1363 * 1364 * <code>.google.rpc.Status error = 4;</code> 1365 */ clearError()1366 public Builder clearError() { 1367 if (errorBuilder_ == null) { 1368 if (resultCase_ == 4) { 1369 resultCase_ = 0; 1370 result_ = null; 1371 onChanged(); 1372 } 1373 } else { 1374 if (resultCase_ == 4) { 1375 resultCase_ = 0; 1376 result_ = null; 1377 } 1378 errorBuilder_.clear(); 1379 } 1380 return this; 1381 } 1382 /** 1383 * 1384 * 1385 * <pre> 1386 * The error result of the operation in case of failure or cancellation. 1387 * </pre> 1388 * 1389 * <code>.google.rpc.Status error = 4;</code> 1390 */ getErrorBuilder()1391 public com.google.rpc.Status.Builder getErrorBuilder() { 1392 return getErrorFieldBuilder().getBuilder(); 1393 } 1394 /** 1395 * 1396 * 1397 * <pre> 1398 * The error result of the operation in case of failure or cancellation. 1399 * </pre> 1400 * 1401 * <code>.google.rpc.Status error = 4;</code> 1402 */ 1403 @java.lang.Override getErrorOrBuilder()1404 public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { 1405 if ((resultCase_ == 4) && (errorBuilder_ != null)) { 1406 return errorBuilder_.getMessageOrBuilder(); 1407 } else { 1408 if (resultCase_ == 4) { 1409 return (com.google.rpc.Status) result_; 1410 } 1411 return com.google.rpc.Status.getDefaultInstance(); 1412 } 1413 } 1414 /** 1415 * 1416 * 1417 * <pre> 1418 * The error result of the operation in case of failure or cancellation. 1419 * </pre> 1420 * 1421 * <code>.google.rpc.Status error = 4;</code> 1422 */ 1423 private com.google.protobuf.SingleFieldBuilderV3< 1424 com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> getErrorFieldBuilder()1425 getErrorFieldBuilder() { 1426 if (errorBuilder_ == null) { 1427 if (!(resultCase_ == 4)) { 1428 result_ = com.google.rpc.Status.getDefaultInstance(); 1429 } 1430 errorBuilder_ = 1431 new com.google.protobuf.SingleFieldBuilderV3< 1432 com.google.rpc.Status, 1433 com.google.rpc.Status.Builder, 1434 com.google.rpc.StatusOrBuilder>( 1435 (com.google.rpc.Status) result_, getParentForChildren(), isClean()); 1436 result_ = null; 1437 } 1438 resultCase_ = 4; 1439 onChanged(); 1440 return errorBuilder_; 1441 } 1442 1443 private com.google.protobuf.SingleFieldBuilderV3< 1444 com.google.protobuf.Any, 1445 com.google.protobuf.Any.Builder, 1446 com.google.protobuf.AnyOrBuilder> 1447 responseBuilder_; 1448 /** 1449 * 1450 * 1451 * <pre> 1452 * The normal response of the operation in case of success. If the original 1453 * method returns no data on success, such as `Delete`, the response is 1454 * `google.protobuf.Empty`. If the original method is standard 1455 * `Get`/`Create`/`Update`, the response should be the resource. For other 1456 * methods, the response should have the type `XxxResponse`, where `Xxx` 1457 * is the original method name. For example, if the original method name 1458 * is `TakeSnapshot()`, the inferred response type is 1459 * `TakeSnapshotResponse`. 1460 * </pre> 1461 * 1462 * <code>.google.protobuf.Any response = 5;</code> 1463 * 1464 * @return Whether the response field is set. 1465 */ 1466 @java.lang.Override hasResponse()1467 public boolean hasResponse() { 1468 return resultCase_ == 5; 1469 } 1470 /** 1471 * 1472 * 1473 * <pre> 1474 * The normal response of the operation in case of success. If the original 1475 * method returns no data on success, such as `Delete`, the response is 1476 * `google.protobuf.Empty`. If the original method is standard 1477 * `Get`/`Create`/`Update`, the response should be the resource. For other 1478 * methods, the response should have the type `XxxResponse`, where `Xxx` 1479 * is the original method name. For example, if the original method name 1480 * is `TakeSnapshot()`, the inferred response type is 1481 * `TakeSnapshotResponse`. 1482 * </pre> 1483 * 1484 * <code>.google.protobuf.Any response = 5;</code> 1485 * 1486 * @return The response. 1487 */ 1488 @java.lang.Override getResponse()1489 public com.google.protobuf.Any getResponse() { 1490 if (responseBuilder_ == null) { 1491 if (resultCase_ == 5) { 1492 return (com.google.protobuf.Any) result_; 1493 } 1494 return com.google.protobuf.Any.getDefaultInstance(); 1495 } else { 1496 if (resultCase_ == 5) { 1497 return responseBuilder_.getMessage(); 1498 } 1499 return com.google.protobuf.Any.getDefaultInstance(); 1500 } 1501 } 1502 /** 1503 * 1504 * 1505 * <pre> 1506 * The normal response of the operation in case of success. If the original 1507 * method returns no data on success, such as `Delete`, the response is 1508 * `google.protobuf.Empty`. If the original method is standard 1509 * `Get`/`Create`/`Update`, the response should be the resource. For other 1510 * methods, the response should have the type `XxxResponse`, where `Xxx` 1511 * is the original method name. For example, if the original method name 1512 * is `TakeSnapshot()`, the inferred response type is 1513 * `TakeSnapshotResponse`. 1514 * </pre> 1515 * 1516 * <code>.google.protobuf.Any response = 5;</code> 1517 */ setResponse(com.google.protobuf.Any value)1518 public Builder setResponse(com.google.protobuf.Any value) { 1519 if (responseBuilder_ == null) { 1520 if (value == null) { 1521 throw new NullPointerException(); 1522 } 1523 result_ = value; 1524 onChanged(); 1525 } else { 1526 responseBuilder_.setMessage(value); 1527 } 1528 resultCase_ = 5; 1529 return this; 1530 } 1531 /** 1532 * 1533 * 1534 * <pre> 1535 * The normal response of the operation in case of success. If the original 1536 * method returns no data on success, such as `Delete`, the response is 1537 * `google.protobuf.Empty`. If the original method is standard 1538 * `Get`/`Create`/`Update`, the response should be the resource. For other 1539 * methods, the response should have the type `XxxResponse`, where `Xxx` 1540 * is the original method name. For example, if the original method name 1541 * is `TakeSnapshot()`, the inferred response type is 1542 * `TakeSnapshotResponse`. 1543 * </pre> 1544 * 1545 * <code>.google.protobuf.Any response = 5;</code> 1546 */ setResponse(com.google.protobuf.Any.Builder builderForValue)1547 public Builder setResponse(com.google.protobuf.Any.Builder builderForValue) { 1548 if (responseBuilder_ == null) { 1549 result_ = builderForValue.build(); 1550 onChanged(); 1551 } else { 1552 responseBuilder_.setMessage(builderForValue.build()); 1553 } 1554 resultCase_ = 5; 1555 return this; 1556 } 1557 /** 1558 * 1559 * 1560 * <pre> 1561 * The normal response of the operation in case of success. If the original 1562 * method returns no data on success, such as `Delete`, the response is 1563 * `google.protobuf.Empty`. If the original method is standard 1564 * `Get`/`Create`/`Update`, the response should be the resource. For other 1565 * methods, the response should have the type `XxxResponse`, where `Xxx` 1566 * is the original method name. For example, if the original method name 1567 * is `TakeSnapshot()`, the inferred response type is 1568 * `TakeSnapshotResponse`. 1569 * </pre> 1570 * 1571 * <code>.google.protobuf.Any response = 5;</code> 1572 */ mergeResponse(com.google.protobuf.Any value)1573 public Builder mergeResponse(com.google.protobuf.Any value) { 1574 if (responseBuilder_ == null) { 1575 if (resultCase_ == 5 && result_ != com.google.protobuf.Any.getDefaultInstance()) { 1576 result_ = 1577 com.google.protobuf.Any.newBuilder((com.google.protobuf.Any) result_) 1578 .mergeFrom(value) 1579 .buildPartial(); 1580 } else { 1581 result_ = value; 1582 } 1583 onChanged(); 1584 } else { 1585 if (resultCase_ == 5) { 1586 responseBuilder_.mergeFrom(value); 1587 } else { 1588 responseBuilder_.setMessage(value); 1589 } 1590 } 1591 resultCase_ = 5; 1592 return this; 1593 } 1594 /** 1595 * 1596 * 1597 * <pre> 1598 * The normal response of the operation in case of success. If the original 1599 * method returns no data on success, such as `Delete`, the response is 1600 * `google.protobuf.Empty`. If the original method is standard 1601 * `Get`/`Create`/`Update`, the response should be the resource. For other 1602 * methods, the response should have the type `XxxResponse`, where `Xxx` 1603 * is the original method name. For example, if the original method name 1604 * is `TakeSnapshot()`, the inferred response type is 1605 * `TakeSnapshotResponse`. 1606 * </pre> 1607 * 1608 * <code>.google.protobuf.Any response = 5;</code> 1609 */ clearResponse()1610 public Builder clearResponse() { 1611 if (responseBuilder_ == null) { 1612 if (resultCase_ == 5) { 1613 resultCase_ = 0; 1614 result_ = null; 1615 onChanged(); 1616 } 1617 } else { 1618 if (resultCase_ == 5) { 1619 resultCase_ = 0; 1620 result_ = null; 1621 } 1622 responseBuilder_.clear(); 1623 } 1624 return this; 1625 } 1626 /** 1627 * 1628 * 1629 * <pre> 1630 * The normal response of the operation in case of success. If the original 1631 * method returns no data on success, such as `Delete`, the response is 1632 * `google.protobuf.Empty`. If the original method is standard 1633 * `Get`/`Create`/`Update`, the response should be the resource. For other 1634 * methods, the response should have the type `XxxResponse`, where `Xxx` 1635 * is the original method name. For example, if the original method name 1636 * is `TakeSnapshot()`, the inferred response type is 1637 * `TakeSnapshotResponse`. 1638 * </pre> 1639 * 1640 * <code>.google.protobuf.Any response = 5;</code> 1641 */ getResponseBuilder()1642 public com.google.protobuf.Any.Builder getResponseBuilder() { 1643 return getResponseFieldBuilder().getBuilder(); 1644 } 1645 /** 1646 * 1647 * 1648 * <pre> 1649 * The normal response of the operation in case of success. If the original 1650 * method returns no data on success, such as `Delete`, the response is 1651 * `google.protobuf.Empty`. If the original method is standard 1652 * `Get`/`Create`/`Update`, the response should be the resource. For other 1653 * methods, the response should have the type `XxxResponse`, where `Xxx` 1654 * is the original method name. For example, if the original method name 1655 * is `TakeSnapshot()`, the inferred response type is 1656 * `TakeSnapshotResponse`. 1657 * </pre> 1658 * 1659 * <code>.google.protobuf.Any response = 5;</code> 1660 */ 1661 @java.lang.Override getResponseOrBuilder()1662 public com.google.protobuf.AnyOrBuilder getResponseOrBuilder() { 1663 if ((resultCase_ == 5) && (responseBuilder_ != null)) { 1664 return responseBuilder_.getMessageOrBuilder(); 1665 } else { 1666 if (resultCase_ == 5) { 1667 return (com.google.protobuf.Any) result_; 1668 } 1669 return com.google.protobuf.Any.getDefaultInstance(); 1670 } 1671 } 1672 /** 1673 * 1674 * 1675 * <pre> 1676 * The normal response of the operation in case of success. If the original 1677 * method returns no data on success, such as `Delete`, the response is 1678 * `google.protobuf.Empty`. If the original method is standard 1679 * `Get`/`Create`/`Update`, the response should be the resource. For other 1680 * methods, the response should have the type `XxxResponse`, where `Xxx` 1681 * is the original method name. For example, if the original method name 1682 * is `TakeSnapshot()`, the inferred response type is 1683 * `TakeSnapshotResponse`. 1684 * </pre> 1685 * 1686 * <code>.google.protobuf.Any response = 5;</code> 1687 */ 1688 private com.google.protobuf.SingleFieldBuilderV3< 1689 com.google.protobuf.Any, 1690 com.google.protobuf.Any.Builder, 1691 com.google.protobuf.AnyOrBuilder> getResponseFieldBuilder()1692 getResponseFieldBuilder() { 1693 if (responseBuilder_ == null) { 1694 if (!(resultCase_ == 5)) { 1695 result_ = com.google.protobuf.Any.getDefaultInstance(); 1696 } 1697 responseBuilder_ = 1698 new com.google.protobuf.SingleFieldBuilderV3< 1699 com.google.protobuf.Any, 1700 com.google.protobuf.Any.Builder, 1701 com.google.protobuf.AnyOrBuilder>( 1702 (com.google.protobuf.Any) result_, getParentForChildren(), isClean()); 1703 result_ = null; 1704 } 1705 resultCase_ = 5; 1706 onChanged(); 1707 return responseBuilder_; 1708 } 1709 1710 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1711 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1712 return super.setUnknownFields(unknownFields); 1713 } 1714 1715 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1716 public final Builder mergeUnknownFields( 1717 final com.google.protobuf.UnknownFieldSet unknownFields) { 1718 return super.mergeUnknownFields(unknownFields); 1719 } 1720 1721 // @@protoc_insertion_point(builder_scope:google.longrunning.Operation) 1722 } 1723 1724 // @@protoc_insertion_point(class_scope:google.longrunning.Operation) 1725 private static final com.google.longrunning.Operation DEFAULT_INSTANCE; 1726 1727 static { 1728 DEFAULT_INSTANCE = new com.google.longrunning.Operation(); 1729 } 1730 getDefaultInstance()1731 public static com.google.longrunning.Operation getDefaultInstance() { 1732 return DEFAULT_INSTANCE; 1733 } 1734 1735 private static final com.google.protobuf.Parser<Operation> PARSER = 1736 new com.google.protobuf.AbstractParser<Operation>() { 1737 @java.lang.Override 1738 public Operation parsePartialFrom( 1739 com.google.protobuf.CodedInputStream input, 1740 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1741 throws com.google.protobuf.InvalidProtocolBufferException { 1742 Builder builder = newBuilder(); 1743 try { 1744 builder.mergeFrom(input, extensionRegistry); 1745 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1746 throw e.setUnfinishedMessage(builder.buildPartial()); 1747 } catch (com.google.protobuf.UninitializedMessageException e) { 1748 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1749 } catch (java.io.IOException e) { 1750 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1751 .setUnfinishedMessage(builder.buildPartial()); 1752 } 1753 return builder.buildPartial(); 1754 } 1755 }; 1756 parser()1757 public static com.google.protobuf.Parser<Operation> parser() { 1758 return PARSER; 1759 } 1760 1761 @java.lang.Override getParserForType()1762 public com.google.protobuf.Parser<Operation> getParserForType() { 1763 return PARSER; 1764 } 1765 1766 @java.lang.Override getDefaultInstanceForType()1767 public com.google.longrunning.Operation getDefaultInstanceForType() { 1768 return DEFAULT_INSTANCE; 1769 } 1770 } 1771