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/channel/v1/offers.proto 18 19 package com.google.cloud.channel.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Represents the price of the Offer. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.channel.v1.Price} 29 */ 30 public final class Price extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.channel.v1.Price) 33 PriceOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use Price.newBuilder() to construct. Price(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private Price(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 Price()40 private Price() { 41 externalPriceUri_ = ""; 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new Price(); 48 } 49 50 @java.lang.Override getUnknownFields()51 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 52 return this.unknownFields; 53 } 54 getDescriptor()55 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 56 return com.google.cloud.channel.v1.OffersProto 57 .internal_static_google_cloud_channel_v1_Price_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.channel.v1.OffersProto 64 .internal_static_google_cloud_channel_v1_Price_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.channel.v1.Price.class, 67 com.google.cloud.channel.v1.Price.Builder.class); 68 } 69 70 public static final int BASE_PRICE_FIELD_NUMBER = 1; 71 private com.google.type.Money basePrice_; 72 /** 73 * 74 * 75 * <pre> 76 * Base price. 77 * </pre> 78 * 79 * <code>.google.type.Money base_price = 1;</code> 80 * 81 * @return Whether the basePrice field is set. 82 */ 83 @java.lang.Override hasBasePrice()84 public boolean hasBasePrice() { 85 return basePrice_ != null; 86 } 87 /** 88 * 89 * 90 * <pre> 91 * Base price. 92 * </pre> 93 * 94 * <code>.google.type.Money base_price = 1;</code> 95 * 96 * @return The basePrice. 97 */ 98 @java.lang.Override getBasePrice()99 public com.google.type.Money getBasePrice() { 100 return basePrice_ == null ? com.google.type.Money.getDefaultInstance() : basePrice_; 101 } 102 /** 103 * 104 * 105 * <pre> 106 * Base price. 107 * </pre> 108 * 109 * <code>.google.type.Money base_price = 1;</code> 110 */ 111 @java.lang.Override getBasePriceOrBuilder()112 public com.google.type.MoneyOrBuilder getBasePriceOrBuilder() { 113 return basePrice_ == null ? com.google.type.Money.getDefaultInstance() : basePrice_; 114 } 115 116 public static final int DISCOUNT_FIELD_NUMBER = 2; 117 private double discount_ = 0D; 118 /** 119 * 120 * 121 * <pre> 122 * Discount percentage, represented as decimal. 123 * For example, a 20% discount will be represent as 0.2. 124 * </pre> 125 * 126 * <code>double discount = 2;</code> 127 * 128 * @return The discount. 129 */ 130 @java.lang.Override getDiscount()131 public double getDiscount() { 132 return discount_; 133 } 134 135 public static final int EFFECTIVE_PRICE_FIELD_NUMBER = 3; 136 private com.google.type.Money effectivePrice_; 137 /** 138 * 139 * 140 * <pre> 141 * Effective Price after applying the discounts. 142 * </pre> 143 * 144 * <code>.google.type.Money effective_price = 3;</code> 145 * 146 * @return Whether the effectivePrice field is set. 147 */ 148 @java.lang.Override hasEffectivePrice()149 public boolean hasEffectivePrice() { 150 return effectivePrice_ != null; 151 } 152 /** 153 * 154 * 155 * <pre> 156 * Effective Price after applying the discounts. 157 * </pre> 158 * 159 * <code>.google.type.Money effective_price = 3;</code> 160 * 161 * @return The effectivePrice. 162 */ 163 @java.lang.Override getEffectivePrice()164 public com.google.type.Money getEffectivePrice() { 165 return effectivePrice_ == null ? com.google.type.Money.getDefaultInstance() : effectivePrice_; 166 } 167 /** 168 * 169 * 170 * <pre> 171 * Effective Price after applying the discounts. 172 * </pre> 173 * 174 * <code>.google.type.Money effective_price = 3;</code> 175 */ 176 @java.lang.Override getEffectivePriceOrBuilder()177 public com.google.type.MoneyOrBuilder getEffectivePriceOrBuilder() { 178 return effectivePrice_ == null ? com.google.type.Money.getDefaultInstance() : effectivePrice_; 179 } 180 181 public static final int EXTERNAL_PRICE_URI_FIELD_NUMBER = 4; 182 183 @SuppressWarnings("serial") 184 private volatile java.lang.Object externalPriceUri_ = ""; 185 /** 186 * 187 * 188 * <pre> 189 * Link to external price list, such as link to Google Voice rate card. 190 * </pre> 191 * 192 * <code>string external_price_uri = 4;</code> 193 * 194 * @return The externalPriceUri. 195 */ 196 @java.lang.Override getExternalPriceUri()197 public java.lang.String getExternalPriceUri() { 198 java.lang.Object ref = externalPriceUri_; 199 if (ref instanceof java.lang.String) { 200 return (java.lang.String) ref; 201 } else { 202 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 203 java.lang.String s = bs.toStringUtf8(); 204 externalPriceUri_ = s; 205 return s; 206 } 207 } 208 /** 209 * 210 * 211 * <pre> 212 * Link to external price list, such as link to Google Voice rate card. 213 * </pre> 214 * 215 * <code>string external_price_uri = 4;</code> 216 * 217 * @return The bytes for externalPriceUri. 218 */ 219 @java.lang.Override getExternalPriceUriBytes()220 public com.google.protobuf.ByteString getExternalPriceUriBytes() { 221 java.lang.Object ref = externalPriceUri_; 222 if (ref instanceof java.lang.String) { 223 com.google.protobuf.ByteString b = 224 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 225 externalPriceUri_ = b; 226 return b; 227 } else { 228 return (com.google.protobuf.ByteString) ref; 229 } 230 } 231 232 private byte memoizedIsInitialized = -1; 233 234 @java.lang.Override isInitialized()235 public final boolean isInitialized() { 236 byte isInitialized = memoizedIsInitialized; 237 if (isInitialized == 1) return true; 238 if (isInitialized == 0) return false; 239 240 memoizedIsInitialized = 1; 241 return true; 242 } 243 244 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)245 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 246 if (basePrice_ != null) { 247 output.writeMessage(1, getBasePrice()); 248 } 249 if (java.lang.Double.doubleToRawLongBits(discount_) != 0) { 250 output.writeDouble(2, discount_); 251 } 252 if (effectivePrice_ != null) { 253 output.writeMessage(3, getEffectivePrice()); 254 } 255 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalPriceUri_)) { 256 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, externalPriceUri_); 257 } 258 getUnknownFields().writeTo(output); 259 } 260 261 @java.lang.Override getSerializedSize()262 public int getSerializedSize() { 263 int size = memoizedSize; 264 if (size != -1) return size; 265 266 size = 0; 267 if (basePrice_ != null) { 268 size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBasePrice()); 269 } 270 if (java.lang.Double.doubleToRawLongBits(discount_) != 0) { 271 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, discount_); 272 } 273 if (effectivePrice_ != null) { 274 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEffectivePrice()); 275 } 276 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalPriceUri_)) { 277 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, externalPriceUri_); 278 } 279 size += getUnknownFields().getSerializedSize(); 280 memoizedSize = size; 281 return size; 282 } 283 284 @java.lang.Override equals(final java.lang.Object obj)285 public boolean equals(final java.lang.Object obj) { 286 if (obj == this) { 287 return true; 288 } 289 if (!(obj instanceof com.google.cloud.channel.v1.Price)) { 290 return super.equals(obj); 291 } 292 com.google.cloud.channel.v1.Price other = (com.google.cloud.channel.v1.Price) obj; 293 294 if (hasBasePrice() != other.hasBasePrice()) return false; 295 if (hasBasePrice()) { 296 if (!getBasePrice().equals(other.getBasePrice())) return false; 297 } 298 if (java.lang.Double.doubleToLongBits(getDiscount()) 299 != java.lang.Double.doubleToLongBits(other.getDiscount())) return false; 300 if (hasEffectivePrice() != other.hasEffectivePrice()) return false; 301 if (hasEffectivePrice()) { 302 if (!getEffectivePrice().equals(other.getEffectivePrice())) return false; 303 } 304 if (!getExternalPriceUri().equals(other.getExternalPriceUri())) return false; 305 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 306 return true; 307 } 308 309 @java.lang.Override hashCode()310 public int hashCode() { 311 if (memoizedHashCode != 0) { 312 return memoizedHashCode; 313 } 314 int hash = 41; 315 hash = (19 * hash) + getDescriptor().hashCode(); 316 if (hasBasePrice()) { 317 hash = (37 * hash) + BASE_PRICE_FIELD_NUMBER; 318 hash = (53 * hash) + getBasePrice().hashCode(); 319 } 320 hash = (37 * hash) + DISCOUNT_FIELD_NUMBER; 321 hash = 322 (53 * hash) 323 + com.google.protobuf.Internal.hashLong( 324 java.lang.Double.doubleToLongBits(getDiscount())); 325 if (hasEffectivePrice()) { 326 hash = (37 * hash) + EFFECTIVE_PRICE_FIELD_NUMBER; 327 hash = (53 * hash) + getEffectivePrice().hashCode(); 328 } 329 hash = (37 * hash) + EXTERNAL_PRICE_URI_FIELD_NUMBER; 330 hash = (53 * hash) + getExternalPriceUri().hashCode(); 331 hash = (29 * hash) + getUnknownFields().hashCode(); 332 memoizedHashCode = hash; 333 return hash; 334 } 335 parseFrom(java.nio.ByteBuffer data)336 public static com.google.cloud.channel.v1.Price parseFrom(java.nio.ByteBuffer data) 337 throws com.google.protobuf.InvalidProtocolBufferException { 338 return PARSER.parseFrom(data); 339 } 340 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)341 public static com.google.cloud.channel.v1.Price parseFrom( 342 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 343 throws com.google.protobuf.InvalidProtocolBufferException { 344 return PARSER.parseFrom(data, extensionRegistry); 345 } 346 parseFrom(com.google.protobuf.ByteString data)347 public static com.google.cloud.channel.v1.Price parseFrom(com.google.protobuf.ByteString data) 348 throws com.google.protobuf.InvalidProtocolBufferException { 349 return PARSER.parseFrom(data); 350 } 351 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)352 public static com.google.cloud.channel.v1.Price parseFrom( 353 com.google.protobuf.ByteString data, 354 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 355 throws com.google.protobuf.InvalidProtocolBufferException { 356 return PARSER.parseFrom(data, extensionRegistry); 357 } 358 parseFrom(byte[] data)359 public static com.google.cloud.channel.v1.Price parseFrom(byte[] data) 360 throws com.google.protobuf.InvalidProtocolBufferException { 361 return PARSER.parseFrom(data); 362 } 363 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)364 public static com.google.cloud.channel.v1.Price parseFrom( 365 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 366 throws com.google.protobuf.InvalidProtocolBufferException { 367 return PARSER.parseFrom(data, extensionRegistry); 368 } 369 parseFrom(java.io.InputStream input)370 public static com.google.cloud.channel.v1.Price parseFrom(java.io.InputStream input) 371 throws java.io.IOException { 372 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 373 } 374 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)375 public static com.google.cloud.channel.v1.Price parseFrom( 376 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 377 throws java.io.IOException { 378 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 379 PARSER, input, extensionRegistry); 380 } 381 parseDelimitedFrom(java.io.InputStream input)382 public static com.google.cloud.channel.v1.Price parseDelimitedFrom(java.io.InputStream input) 383 throws java.io.IOException { 384 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 385 } 386 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)387 public static com.google.cloud.channel.v1.Price parseDelimitedFrom( 388 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 389 throws java.io.IOException { 390 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 391 PARSER, input, extensionRegistry); 392 } 393 parseFrom( com.google.protobuf.CodedInputStream input)394 public static com.google.cloud.channel.v1.Price parseFrom( 395 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 396 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 397 } 398 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)399 public static com.google.cloud.channel.v1.Price parseFrom( 400 com.google.protobuf.CodedInputStream input, 401 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 402 throws java.io.IOException { 403 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 404 PARSER, input, extensionRegistry); 405 } 406 407 @java.lang.Override newBuilderForType()408 public Builder newBuilderForType() { 409 return newBuilder(); 410 } 411 newBuilder()412 public static Builder newBuilder() { 413 return DEFAULT_INSTANCE.toBuilder(); 414 } 415 newBuilder(com.google.cloud.channel.v1.Price prototype)416 public static Builder newBuilder(com.google.cloud.channel.v1.Price prototype) { 417 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 418 } 419 420 @java.lang.Override toBuilder()421 public Builder toBuilder() { 422 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 423 } 424 425 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)426 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 427 Builder builder = new Builder(parent); 428 return builder; 429 } 430 /** 431 * 432 * 433 * <pre> 434 * Represents the price of the Offer. 435 * </pre> 436 * 437 * Protobuf type {@code google.cloud.channel.v1.Price} 438 */ 439 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 440 implements 441 // @@protoc_insertion_point(builder_implements:google.cloud.channel.v1.Price) 442 com.google.cloud.channel.v1.PriceOrBuilder { getDescriptor()443 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 444 return com.google.cloud.channel.v1.OffersProto 445 .internal_static_google_cloud_channel_v1_Price_descriptor; 446 } 447 448 @java.lang.Override 449 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()450 internalGetFieldAccessorTable() { 451 return com.google.cloud.channel.v1.OffersProto 452 .internal_static_google_cloud_channel_v1_Price_fieldAccessorTable 453 .ensureFieldAccessorsInitialized( 454 com.google.cloud.channel.v1.Price.class, 455 com.google.cloud.channel.v1.Price.Builder.class); 456 } 457 458 // Construct using com.google.cloud.channel.v1.Price.newBuilder() Builder()459 private Builder() {} 460 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)461 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 462 super(parent); 463 } 464 465 @java.lang.Override clear()466 public Builder clear() { 467 super.clear(); 468 bitField0_ = 0; 469 basePrice_ = null; 470 if (basePriceBuilder_ != null) { 471 basePriceBuilder_.dispose(); 472 basePriceBuilder_ = null; 473 } 474 discount_ = 0D; 475 effectivePrice_ = null; 476 if (effectivePriceBuilder_ != null) { 477 effectivePriceBuilder_.dispose(); 478 effectivePriceBuilder_ = null; 479 } 480 externalPriceUri_ = ""; 481 return this; 482 } 483 484 @java.lang.Override getDescriptorForType()485 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 486 return com.google.cloud.channel.v1.OffersProto 487 .internal_static_google_cloud_channel_v1_Price_descriptor; 488 } 489 490 @java.lang.Override getDefaultInstanceForType()491 public com.google.cloud.channel.v1.Price getDefaultInstanceForType() { 492 return com.google.cloud.channel.v1.Price.getDefaultInstance(); 493 } 494 495 @java.lang.Override build()496 public com.google.cloud.channel.v1.Price build() { 497 com.google.cloud.channel.v1.Price result = buildPartial(); 498 if (!result.isInitialized()) { 499 throw newUninitializedMessageException(result); 500 } 501 return result; 502 } 503 504 @java.lang.Override buildPartial()505 public com.google.cloud.channel.v1.Price buildPartial() { 506 com.google.cloud.channel.v1.Price result = new com.google.cloud.channel.v1.Price(this); 507 if (bitField0_ != 0) { 508 buildPartial0(result); 509 } 510 onBuilt(); 511 return result; 512 } 513 buildPartial0(com.google.cloud.channel.v1.Price result)514 private void buildPartial0(com.google.cloud.channel.v1.Price result) { 515 int from_bitField0_ = bitField0_; 516 if (((from_bitField0_ & 0x00000001) != 0)) { 517 result.basePrice_ = basePriceBuilder_ == null ? basePrice_ : basePriceBuilder_.build(); 518 } 519 if (((from_bitField0_ & 0x00000002) != 0)) { 520 result.discount_ = discount_; 521 } 522 if (((from_bitField0_ & 0x00000004) != 0)) { 523 result.effectivePrice_ = 524 effectivePriceBuilder_ == null ? effectivePrice_ : effectivePriceBuilder_.build(); 525 } 526 if (((from_bitField0_ & 0x00000008) != 0)) { 527 result.externalPriceUri_ = externalPriceUri_; 528 } 529 } 530 531 @java.lang.Override clone()532 public Builder clone() { 533 return super.clone(); 534 } 535 536 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)537 public Builder setField( 538 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 539 return super.setField(field, value); 540 } 541 542 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)543 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 544 return super.clearField(field); 545 } 546 547 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)548 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 549 return super.clearOneof(oneof); 550 } 551 552 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)553 public Builder setRepeatedField( 554 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 555 return super.setRepeatedField(field, index, value); 556 } 557 558 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)559 public Builder addRepeatedField( 560 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 561 return super.addRepeatedField(field, value); 562 } 563 564 @java.lang.Override mergeFrom(com.google.protobuf.Message other)565 public Builder mergeFrom(com.google.protobuf.Message other) { 566 if (other instanceof com.google.cloud.channel.v1.Price) { 567 return mergeFrom((com.google.cloud.channel.v1.Price) other); 568 } else { 569 super.mergeFrom(other); 570 return this; 571 } 572 } 573 mergeFrom(com.google.cloud.channel.v1.Price other)574 public Builder mergeFrom(com.google.cloud.channel.v1.Price other) { 575 if (other == com.google.cloud.channel.v1.Price.getDefaultInstance()) return this; 576 if (other.hasBasePrice()) { 577 mergeBasePrice(other.getBasePrice()); 578 } 579 if (other.getDiscount() != 0D) { 580 setDiscount(other.getDiscount()); 581 } 582 if (other.hasEffectivePrice()) { 583 mergeEffectivePrice(other.getEffectivePrice()); 584 } 585 if (!other.getExternalPriceUri().isEmpty()) { 586 externalPriceUri_ = other.externalPriceUri_; 587 bitField0_ |= 0x00000008; 588 onChanged(); 589 } 590 this.mergeUnknownFields(other.getUnknownFields()); 591 onChanged(); 592 return this; 593 } 594 595 @java.lang.Override isInitialized()596 public final boolean isInitialized() { 597 return true; 598 } 599 600 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)601 public Builder mergeFrom( 602 com.google.protobuf.CodedInputStream input, 603 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 604 throws java.io.IOException { 605 if (extensionRegistry == null) { 606 throw new java.lang.NullPointerException(); 607 } 608 try { 609 boolean done = false; 610 while (!done) { 611 int tag = input.readTag(); 612 switch (tag) { 613 case 0: 614 done = true; 615 break; 616 case 10: 617 { 618 input.readMessage(getBasePriceFieldBuilder().getBuilder(), extensionRegistry); 619 bitField0_ |= 0x00000001; 620 break; 621 } // case 10 622 case 17: 623 { 624 discount_ = input.readDouble(); 625 bitField0_ |= 0x00000002; 626 break; 627 } // case 17 628 case 26: 629 { 630 input.readMessage(getEffectivePriceFieldBuilder().getBuilder(), extensionRegistry); 631 bitField0_ |= 0x00000004; 632 break; 633 } // case 26 634 case 34: 635 { 636 externalPriceUri_ = input.readStringRequireUtf8(); 637 bitField0_ |= 0x00000008; 638 break; 639 } // case 34 640 default: 641 { 642 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 643 done = true; // was an endgroup tag 644 } 645 break; 646 } // default: 647 } // switch (tag) 648 } // while (!done) 649 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 650 throw e.unwrapIOException(); 651 } finally { 652 onChanged(); 653 } // finally 654 return this; 655 } 656 657 private int bitField0_; 658 659 private com.google.type.Money basePrice_; 660 private com.google.protobuf.SingleFieldBuilderV3< 661 com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> 662 basePriceBuilder_; 663 /** 664 * 665 * 666 * <pre> 667 * Base price. 668 * </pre> 669 * 670 * <code>.google.type.Money base_price = 1;</code> 671 * 672 * @return Whether the basePrice field is set. 673 */ hasBasePrice()674 public boolean hasBasePrice() { 675 return ((bitField0_ & 0x00000001) != 0); 676 } 677 /** 678 * 679 * 680 * <pre> 681 * Base price. 682 * </pre> 683 * 684 * <code>.google.type.Money base_price = 1;</code> 685 * 686 * @return The basePrice. 687 */ getBasePrice()688 public com.google.type.Money getBasePrice() { 689 if (basePriceBuilder_ == null) { 690 return basePrice_ == null ? com.google.type.Money.getDefaultInstance() : basePrice_; 691 } else { 692 return basePriceBuilder_.getMessage(); 693 } 694 } 695 /** 696 * 697 * 698 * <pre> 699 * Base price. 700 * </pre> 701 * 702 * <code>.google.type.Money base_price = 1;</code> 703 */ setBasePrice(com.google.type.Money value)704 public Builder setBasePrice(com.google.type.Money value) { 705 if (basePriceBuilder_ == null) { 706 if (value == null) { 707 throw new NullPointerException(); 708 } 709 basePrice_ = value; 710 } else { 711 basePriceBuilder_.setMessage(value); 712 } 713 bitField0_ |= 0x00000001; 714 onChanged(); 715 return this; 716 } 717 /** 718 * 719 * 720 * <pre> 721 * Base price. 722 * </pre> 723 * 724 * <code>.google.type.Money base_price = 1;</code> 725 */ setBasePrice(com.google.type.Money.Builder builderForValue)726 public Builder setBasePrice(com.google.type.Money.Builder builderForValue) { 727 if (basePriceBuilder_ == null) { 728 basePrice_ = builderForValue.build(); 729 } else { 730 basePriceBuilder_.setMessage(builderForValue.build()); 731 } 732 bitField0_ |= 0x00000001; 733 onChanged(); 734 return this; 735 } 736 /** 737 * 738 * 739 * <pre> 740 * Base price. 741 * </pre> 742 * 743 * <code>.google.type.Money base_price = 1;</code> 744 */ mergeBasePrice(com.google.type.Money value)745 public Builder mergeBasePrice(com.google.type.Money value) { 746 if (basePriceBuilder_ == null) { 747 if (((bitField0_ & 0x00000001) != 0) 748 && basePrice_ != null 749 && basePrice_ != com.google.type.Money.getDefaultInstance()) { 750 getBasePriceBuilder().mergeFrom(value); 751 } else { 752 basePrice_ = value; 753 } 754 } else { 755 basePriceBuilder_.mergeFrom(value); 756 } 757 bitField0_ |= 0x00000001; 758 onChanged(); 759 return this; 760 } 761 /** 762 * 763 * 764 * <pre> 765 * Base price. 766 * </pre> 767 * 768 * <code>.google.type.Money base_price = 1;</code> 769 */ clearBasePrice()770 public Builder clearBasePrice() { 771 bitField0_ = (bitField0_ & ~0x00000001); 772 basePrice_ = null; 773 if (basePriceBuilder_ != null) { 774 basePriceBuilder_.dispose(); 775 basePriceBuilder_ = null; 776 } 777 onChanged(); 778 return this; 779 } 780 /** 781 * 782 * 783 * <pre> 784 * Base price. 785 * </pre> 786 * 787 * <code>.google.type.Money base_price = 1;</code> 788 */ getBasePriceBuilder()789 public com.google.type.Money.Builder getBasePriceBuilder() { 790 bitField0_ |= 0x00000001; 791 onChanged(); 792 return getBasePriceFieldBuilder().getBuilder(); 793 } 794 /** 795 * 796 * 797 * <pre> 798 * Base price. 799 * </pre> 800 * 801 * <code>.google.type.Money base_price = 1;</code> 802 */ getBasePriceOrBuilder()803 public com.google.type.MoneyOrBuilder getBasePriceOrBuilder() { 804 if (basePriceBuilder_ != null) { 805 return basePriceBuilder_.getMessageOrBuilder(); 806 } else { 807 return basePrice_ == null ? com.google.type.Money.getDefaultInstance() : basePrice_; 808 } 809 } 810 /** 811 * 812 * 813 * <pre> 814 * Base price. 815 * </pre> 816 * 817 * <code>.google.type.Money base_price = 1;</code> 818 */ 819 private com.google.protobuf.SingleFieldBuilderV3< 820 com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> getBasePriceFieldBuilder()821 getBasePriceFieldBuilder() { 822 if (basePriceBuilder_ == null) { 823 basePriceBuilder_ = 824 new com.google.protobuf.SingleFieldBuilderV3< 825 com.google.type.Money, 826 com.google.type.Money.Builder, 827 com.google.type.MoneyOrBuilder>(getBasePrice(), getParentForChildren(), isClean()); 828 basePrice_ = null; 829 } 830 return basePriceBuilder_; 831 } 832 833 private double discount_; 834 /** 835 * 836 * 837 * <pre> 838 * Discount percentage, represented as decimal. 839 * For example, a 20% discount will be represent as 0.2. 840 * </pre> 841 * 842 * <code>double discount = 2;</code> 843 * 844 * @return The discount. 845 */ 846 @java.lang.Override getDiscount()847 public double getDiscount() { 848 return discount_; 849 } 850 /** 851 * 852 * 853 * <pre> 854 * Discount percentage, represented as decimal. 855 * For example, a 20% discount will be represent as 0.2. 856 * </pre> 857 * 858 * <code>double discount = 2;</code> 859 * 860 * @param value The discount to set. 861 * @return This builder for chaining. 862 */ setDiscount(double value)863 public Builder setDiscount(double value) { 864 865 discount_ = value; 866 bitField0_ |= 0x00000002; 867 onChanged(); 868 return this; 869 } 870 /** 871 * 872 * 873 * <pre> 874 * Discount percentage, represented as decimal. 875 * For example, a 20% discount will be represent as 0.2. 876 * </pre> 877 * 878 * <code>double discount = 2;</code> 879 * 880 * @return This builder for chaining. 881 */ clearDiscount()882 public Builder clearDiscount() { 883 bitField0_ = (bitField0_ & ~0x00000002); 884 discount_ = 0D; 885 onChanged(); 886 return this; 887 } 888 889 private com.google.type.Money effectivePrice_; 890 private com.google.protobuf.SingleFieldBuilderV3< 891 com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> 892 effectivePriceBuilder_; 893 /** 894 * 895 * 896 * <pre> 897 * Effective Price after applying the discounts. 898 * </pre> 899 * 900 * <code>.google.type.Money effective_price = 3;</code> 901 * 902 * @return Whether the effectivePrice field is set. 903 */ hasEffectivePrice()904 public boolean hasEffectivePrice() { 905 return ((bitField0_ & 0x00000004) != 0); 906 } 907 /** 908 * 909 * 910 * <pre> 911 * Effective Price after applying the discounts. 912 * </pre> 913 * 914 * <code>.google.type.Money effective_price = 3;</code> 915 * 916 * @return The effectivePrice. 917 */ getEffectivePrice()918 public com.google.type.Money getEffectivePrice() { 919 if (effectivePriceBuilder_ == null) { 920 return effectivePrice_ == null 921 ? com.google.type.Money.getDefaultInstance() 922 : effectivePrice_; 923 } else { 924 return effectivePriceBuilder_.getMessage(); 925 } 926 } 927 /** 928 * 929 * 930 * <pre> 931 * Effective Price after applying the discounts. 932 * </pre> 933 * 934 * <code>.google.type.Money effective_price = 3;</code> 935 */ setEffectivePrice(com.google.type.Money value)936 public Builder setEffectivePrice(com.google.type.Money value) { 937 if (effectivePriceBuilder_ == null) { 938 if (value == null) { 939 throw new NullPointerException(); 940 } 941 effectivePrice_ = value; 942 } else { 943 effectivePriceBuilder_.setMessage(value); 944 } 945 bitField0_ |= 0x00000004; 946 onChanged(); 947 return this; 948 } 949 /** 950 * 951 * 952 * <pre> 953 * Effective Price after applying the discounts. 954 * </pre> 955 * 956 * <code>.google.type.Money effective_price = 3;</code> 957 */ setEffectivePrice(com.google.type.Money.Builder builderForValue)958 public Builder setEffectivePrice(com.google.type.Money.Builder builderForValue) { 959 if (effectivePriceBuilder_ == null) { 960 effectivePrice_ = builderForValue.build(); 961 } else { 962 effectivePriceBuilder_.setMessage(builderForValue.build()); 963 } 964 bitField0_ |= 0x00000004; 965 onChanged(); 966 return this; 967 } 968 /** 969 * 970 * 971 * <pre> 972 * Effective Price after applying the discounts. 973 * </pre> 974 * 975 * <code>.google.type.Money effective_price = 3;</code> 976 */ mergeEffectivePrice(com.google.type.Money value)977 public Builder mergeEffectivePrice(com.google.type.Money value) { 978 if (effectivePriceBuilder_ == null) { 979 if (((bitField0_ & 0x00000004) != 0) 980 && effectivePrice_ != null 981 && effectivePrice_ != com.google.type.Money.getDefaultInstance()) { 982 getEffectivePriceBuilder().mergeFrom(value); 983 } else { 984 effectivePrice_ = value; 985 } 986 } else { 987 effectivePriceBuilder_.mergeFrom(value); 988 } 989 bitField0_ |= 0x00000004; 990 onChanged(); 991 return this; 992 } 993 /** 994 * 995 * 996 * <pre> 997 * Effective Price after applying the discounts. 998 * </pre> 999 * 1000 * <code>.google.type.Money effective_price = 3;</code> 1001 */ clearEffectivePrice()1002 public Builder clearEffectivePrice() { 1003 bitField0_ = (bitField0_ & ~0x00000004); 1004 effectivePrice_ = null; 1005 if (effectivePriceBuilder_ != null) { 1006 effectivePriceBuilder_.dispose(); 1007 effectivePriceBuilder_ = null; 1008 } 1009 onChanged(); 1010 return this; 1011 } 1012 /** 1013 * 1014 * 1015 * <pre> 1016 * Effective Price after applying the discounts. 1017 * </pre> 1018 * 1019 * <code>.google.type.Money effective_price = 3;</code> 1020 */ getEffectivePriceBuilder()1021 public com.google.type.Money.Builder getEffectivePriceBuilder() { 1022 bitField0_ |= 0x00000004; 1023 onChanged(); 1024 return getEffectivePriceFieldBuilder().getBuilder(); 1025 } 1026 /** 1027 * 1028 * 1029 * <pre> 1030 * Effective Price after applying the discounts. 1031 * </pre> 1032 * 1033 * <code>.google.type.Money effective_price = 3;</code> 1034 */ getEffectivePriceOrBuilder()1035 public com.google.type.MoneyOrBuilder getEffectivePriceOrBuilder() { 1036 if (effectivePriceBuilder_ != null) { 1037 return effectivePriceBuilder_.getMessageOrBuilder(); 1038 } else { 1039 return effectivePrice_ == null 1040 ? com.google.type.Money.getDefaultInstance() 1041 : effectivePrice_; 1042 } 1043 } 1044 /** 1045 * 1046 * 1047 * <pre> 1048 * Effective Price after applying the discounts. 1049 * </pre> 1050 * 1051 * <code>.google.type.Money effective_price = 3;</code> 1052 */ 1053 private com.google.protobuf.SingleFieldBuilderV3< 1054 com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> getEffectivePriceFieldBuilder()1055 getEffectivePriceFieldBuilder() { 1056 if (effectivePriceBuilder_ == null) { 1057 effectivePriceBuilder_ = 1058 new com.google.protobuf.SingleFieldBuilderV3< 1059 com.google.type.Money, 1060 com.google.type.Money.Builder, 1061 com.google.type.MoneyOrBuilder>( 1062 getEffectivePrice(), getParentForChildren(), isClean()); 1063 effectivePrice_ = null; 1064 } 1065 return effectivePriceBuilder_; 1066 } 1067 1068 private java.lang.Object externalPriceUri_ = ""; 1069 /** 1070 * 1071 * 1072 * <pre> 1073 * Link to external price list, such as link to Google Voice rate card. 1074 * </pre> 1075 * 1076 * <code>string external_price_uri = 4;</code> 1077 * 1078 * @return The externalPriceUri. 1079 */ getExternalPriceUri()1080 public java.lang.String getExternalPriceUri() { 1081 java.lang.Object ref = externalPriceUri_; 1082 if (!(ref instanceof java.lang.String)) { 1083 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1084 java.lang.String s = bs.toStringUtf8(); 1085 externalPriceUri_ = s; 1086 return s; 1087 } else { 1088 return (java.lang.String) ref; 1089 } 1090 } 1091 /** 1092 * 1093 * 1094 * <pre> 1095 * Link to external price list, such as link to Google Voice rate card. 1096 * </pre> 1097 * 1098 * <code>string external_price_uri = 4;</code> 1099 * 1100 * @return The bytes for externalPriceUri. 1101 */ getExternalPriceUriBytes()1102 public com.google.protobuf.ByteString getExternalPriceUriBytes() { 1103 java.lang.Object ref = externalPriceUri_; 1104 if (ref instanceof String) { 1105 com.google.protobuf.ByteString b = 1106 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1107 externalPriceUri_ = b; 1108 return b; 1109 } else { 1110 return (com.google.protobuf.ByteString) ref; 1111 } 1112 } 1113 /** 1114 * 1115 * 1116 * <pre> 1117 * Link to external price list, such as link to Google Voice rate card. 1118 * </pre> 1119 * 1120 * <code>string external_price_uri = 4;</code> 1121 * 1122 * @param value The externalPriceUri to set. 1123 * @return This builder for chaining. 1124 */ setExternalPriceUri(java.lang.String value)1125 public Builder setExternalPriceUri(java.lang.String value) { 1126 if (value == null) { 1127 throw new NullPointerException(); 1128 } 1129 externalPriceUri_ = value; 1130 bitField0_ |= 0x00000008; 1131 onChanged(); 1132 return this; 1133 } 1134 /** 1135 * 1136 * 1137 * <pre> 1138 * Link to external price list, such as link to Google Voice rate card. 1139 * </pre> 1140 * 1141 * <code>string external_price_uri = 4;</code> 1142 * 1143 * @return This builder for chaining. 1144 */ clearExternalPriceUri()1145 public Builder clearExternalPriceUri() { 1146 externalPriceUri_ = getDefaultInstance().getExternalPriceUri(); 1147 bitField0_ = (bitField0_ & ~0x00000008); 1148 onChanged(); 1149 return this; 1150 } 1151 /** 1152 * 1153 * 1154 * <pre> 1155 * Link to external price list, such as link to Google Voice rate card. 1156 * </pre> 1157 * 1158 * <code>string external_price_uri = 4;</code> 1159 * 1160 * @param value The bytes for externalPriceUri to set. 1161 * @return This builder for chaining. 1162 */ setExternalPriceUriBytes(com.google.protobuf.ByteString value)1163 public Builder setExternalPriceUriBytes(com.google.protobuf.ByteString value) { 1164 if (value == null) { 1165 throw new NullPointerException(); 1166 } 1167 checkByteStringIsUtf8(value); 1168 externalPriceUri_ = value; 1169 bitField0_ |= 0x00000008; 1170 onChanged(); 1171 return this; 1172 } 1173 1174 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1175 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1176 return super.setUnknownFields(unknownFields); 1177 } 1178 1179 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1180 public final Builder mergeUnknownFields( 1181 final com.google.protobuf.UnknownFieldSet unknownFields) { 1182 return super.mergeUnknownFields(unknownFields); 1183 } 1184 1185 // @@protoc_insertion_point(builder_scope:google.cloud.channel.v1.Price) 1186 } 1187 1188 // @@protoc_insertion_point(class_scope:google.cloud.channel.v1.Price) 1189 private static final com.google.cloud.channel.v1.Price DEFAULT_INSTANCE; 1190 1191 static { 1192 DEFAULT_INSTANCE = new com.google.cloud.channel.v1.Price(); 1193 } 1194 getDefaultInstance()1195 public static com.google.cloud.channel.v1.Price getDefaultInstance() { 1196 return DEFAULT_INSTANCE; 1197 } 1198 1199 private static final com.google.protobuf.Parser<Price> PARSER = 1200 new com.google.protobuf.AbstractParser<Price>() { 1201 @java.lang.Override 1202 public Price parsePartialFrom( 1203 com.google.protobuf.CodedInputStream input, 1204 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1205 throws com.google.protobuf.InvalidProtocolBufferException { 1206 Builder builder = newBuilder(); 1207 try { 1208 builder.mergeFrom(input, extensionRegistry); 1209 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1210 throw e.setUnfinishedMessage(builder.buildPartial()); 1211 } catch (com.google.protobuf.UninitializedMessageException e) { 1212 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1213 } catch (java.io.IOException e) { 1214 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1215 .setUnfinishedMessage(builder.buildPartial()); 1216 } 1217 return builder.buildPartial(); 1218 } 1219 }; 1220 parser()1221 public static com.google.protobuf.Parser<Price> parser() { 1222 return PARSER; 1223 } 1224 1225 @java.lang.Override getParserForType()1226 public com.google.protobuf.Parser<Price> getParserForType() { 1227 return PARSER; 1228 } 1229 1230 @java.lang.Override getDefaultInstanceForType()1231 public com.google.cloud.channel.v1.Price getDefaultInstanceForType() { 1232 return DEFAULT_INSTANCE; 1233 } 1234 } 1235