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/billing/v1/cloud_catalog.proto 18 19 package com.google.cloud.billing.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Expresses a mathematical pricing formula. For Example:- 26 * `usage_unit: GBy` 27 * `tiered_rates:` 28 * `[start_usage_amount: 20, unit_price: $10]` 29 * `[start_usage_amount: 100, unit_price: $5]` 30 * The above expresses a pricing formula where the first 20GB is free, the 31 * next 80GB is priced at $10 per GB followed by $5 per GB for additional 32 * usage. 33 * </pre> 34 * 35 * Protobuf type {@code google.cloud.billing.v1.PricingExpression} 36 */ 37 public final class PricingExpression extends com.google.protobuf.GeneratedMessageV3 38 implements 39 // @@protoc_insertion_point(message_implements:google.cloud.billing.v1.PricingExpression) 40 PricingExpressionOrBuilder { 41 private static final long serialVersionUID = 0L; 42 // Use PricingExpression.newBuilder() to construct. PricingExpression(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)43 private PricingExpression(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 44 super(builder); 45 } 46 PricingExpression()47 private PricingExpression() { 48 usageUnit_ = ""; 49 tieredRates_ = java.util.Collections.emptyList(); 50 usageUnitDescription_ = ""; 51 baseUnit_ = ""; 52 baseUnitDescription_ = ""; 53 } 54 55 @java.lang.Override 56 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)57 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 58 return new PricingExpression(); 59 } 60 61 @java.lang.Override getUnknownFields()62 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 63 return this.unknownFields; 64 } 65 getDescriptor()66 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 67 return com.google.cloud.billing.v1.CloudCatalogProto 68 .internal_static_google_cloud_billing_v1_PricingExpression_descriptor; 69 } 70 71 @java.lang.Override 72 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()73 internalGetFieldAccessorTable() { 74 return com.google.cloud.billing.v1.CloudCatalogProto 75 .internal_static_google_cloud_billing_v1_PricingExpression_fieldAccessorTable 76 .ensureFieldAccessorsInitialized( 77 com.google.cloud.billing.v1.PricingExpression.class, 78 com.google.cloud.billing.v1.PricingExpression.Builder.class); 79 } 80 81 public interface TierRateOrBuilder 82 extends 83 // @@protoc_insertion_point(interface_extends:google.cloud.billing.v1.PricingExpression.TierRate) 84 com.google.protobuf.MessageOrBuilder { 85 86 /** 87 * 88 * 89 * <pre> 90 * Usage is priced at this rate only after this amount. 91 * Example: start_usage_amount of 10 indicates that the usage will be priced 92 * at the unit_price after the first 10 usage_units. 93 * </pre> 94 * 95 * <code>double start_usage_amount = 1;</code> 96 * 97 * @return The startUsageAmount. 98 */ getStartUsageAmount()99 double getStartUsageAmount(); 100 101 /** 102 * 103 * 104 * <pre> 105 * The price per unit of usage. 106 * Example: unit_price of amount $10 indicates that each unit will cost $10. 107 * </pre> 108 * 109 * <code>.google.type.Money unit_price = 2;</code> 110 * 111 * @return Whether the unitPrice field is set. 112 */ hasUnitPrice()113 boolean hasUnitPrice(); 114 /** 115 * 116 * 117 * <pre> 118 * The price per unit of usage. 119 * Example: unit_price of amount $10 indicates that each unit will cost $10. 120 * </pre> 121 * 122 * <code>.google.type.Money unit_price = 2;</code> 123 * 124 * @return The unitPrice. 125 */ getUnitPrice()126 com.google.type.Money getUnitPrice(); 127 /** 128 * 129 * 130 * <pre> 131 * The price per unit of usage. 132 * Example: unit_price of amount $10 indicates that each unit will cost $10. 133 * </pre> 134 * 135 * <code>.google.type.Money unit_price = 2;</code> 136 */ getUnitPriceOrBuilder()137 com.google.type.MoneyOrBuilder getUnitPriceOrBuilder(); 138 } 139 /** 140 * 141 * 142 * <pre> 143 * The price rate indicating starting usage and its corresponding price. 144 * </pre> 145 * 146 * Protobuf type {@code google.cloud.billing.v1.PricingExpression.TierRate} 147 */ 148 public static final class TierRate extends com.google.protobuf.GeneratedMessageV3 149 implements 150 // @@protoc_insertion_point(message_implements:google.cloud.billing.v1.PricingExpression.TierRate) 151 TierRateOrBuilder { 152 private static final long serialVersionUID = 0L; 153 // Use TierRate.newBuilder() to construct. TierRate(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)154 private TierRate(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 155 super(builder); 156 } 157 TierRate()158 private TierRate() {} 159 160 @java.lang.Override 161 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)162 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 163 return new TierRate(); 164 } 165 166 @java.lang.Override getUnknownFields()167 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 168 return this.unknownFields; 169 } 170 getDescriptor()171 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 172 return com.google.cloud.billing.v1.CloudCatalogProto 173 .internal_static_google_cloud_billing_v1_PricingExpression_TierRate_descriptor; 174 } 175 176 @java.lang.Override 177 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()178 internalGetFieldAccessorTable() { 179 return com.google.cloud.billing.v1.CloudCatalogProto 180 .internal_static_google_cloud_billing_v1_PricingExpression_TierRate_fieldAccessorTable 181 .ensureFieldAccessorsInitialized( 182 com.google.cloud.billing.v1.PricingExpression.TierRate.class, 183 com.google.cloud.billing.v1.PricingExpression.TierRate.Builder.class); 184 } 185 186 public static final int START_USAGE_AMOUNT_FIELD_NUMBER = 1; 187 private double startUsageAmount_ = 0D; 188 /** 189 * 190 * 191 * <pre> 192 * Usage is priced at this rate only after this amount. 193 * Example: start_usage_amount of 10 indicates that the usage will be priced 194 * at the unit_price after the first 10 usage_units. 195 * </pre> 196 * 197 * <code>double start_usage_amount = 1;</code> 198 * 199 * @return The startUsageAmount. 200 */ 201 @java.lang.Override getStartUsageAmount()202 public double getStartUsageAmount() { 203 return startUsageAmount_; 204 } 205 206 public static final int UNIT_PRICE_FIELD_NUMBER = 2; 207 private com.google.type.Money unitPrice_; 208 /** 209 * 210 * 211 * <pre> 212 * The price per unit of usage. 213 * Example: unit_price of amount $10 indicates that each unit will cost $10. 214 * </pre> 215 * 216 * <code>.google.type.Money unit_price = 2;</code> 217 * 218 * @return Whether the unitPrice field is set. 219 */ 220 @java.lang.Override hasUnitPrice()221 public boolean hasUnitPrice() { 222 return unitPrice_ != null; 223 } 224 /** 225 * 226 * 227 * <pre> 228 * The price per unit of usage. 229 * Example: unit_price of amount $10 indicates that each unit will cost $10. 230 * </pre> 231 * 232 * <code>.google.type.Money unit_price = 2;</code> 233 * 234 * @return The unitPrice. 235 */ 236 @java.lang.Override getUnitPrice()237 public com.google.type.Money getUnitPrice() { 238 return unitPrice_ == null ? com.google.type.Money.getDefaultInstance() : unitPrice_; 239 } 240 /** 241 * 242 * 243 * <pre> 244 * The price per unit of usage. 245 * Example: unit_price of amount $10 indicates that each unit will cost $10. 246 * </pre> 247 * 248 * <code>.google.type.Money unit_price = 2;</code> 249 */ 250 @java.lang.Override getUnitPriceOrBuilder()251 public com.google.type.MoneyOrBuilder getUnitPriceOrBuilder() { 252 return unitPrice_ == null ? com.google.type.Money.getDefaultInstance() : unitPrice_; 253 } 254 255 private byte memoizedIsInitialized = -1; 256 257 @java.lang.Override isInitialized()258 public final boolean isInitialized() { 259 byte isInitialized = memoizedIsInitialized; 260 if (isInitialized == 1) return true; 261 if (isInitialized == 0) return false; 262 263 memoizedIsInitialized = 1; 264 return true; 265 } 266 267 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)268 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 269 if (java.lang.Double.doubleToRawLongBits(startUsageAmount_) != 0) { 270 output.writeDouble(1, startUsageAmount_); 271 } 272 if (unitPrice_ != null) { 273 output.writeMessage(2, getUnitPrice()); 274 } 275 getUnknownFields().writeTo(output); 276 } 277 278 @java.lang.Override getSerializedSize()279 public int getSerializedSize() { 280 int size = memoizedSize; 281 if (size != -1) return size; 282 283 size = 0; 284 if (java.lang.Double.doubleToRawLongBits(startUsageAmount_) != 0) { 285 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, startUsageAmount_); 286 } 287 if (unitPrice_ != null) { 288 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUnitPrice()); 289 } 290 size += getUnknownFields().getSerializedSize(); 291 memoizedSize = size; 292 return size; 293 } 294 295 @java.lang.Override equals(final java.lang.Object obj)296 public boolean equals(final java.lang.Object obj) { 297 if (obj == this) { 298 return true; 299 } 300 if (!(obj instanceof com.google.cloud.billing.v1.PricingExpression.TierRate)) { 301 return super.equals(obj); 302 } 303 com.google.cloud.billing.v1.PricingExpression.TierRate other = 304 (com.google.cloud.billing.v1.PricingExpression.TierRate) obj; 305 306 if (java.lang.Double.doubleToLongBits(getStartUsageAmount()) 307 != java.lang.Double.doubleToLongBits(other.getStartUsageAmount())) return false; 308 if (hasUnitPrice() != other.hasUnitPrice()) return false; 309 if (hasUnitPrice()) { 310 if (!getUnitPrice().equals(other.getUnitPrice())) return false; 311 } 312 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 313 return true; 314 } 315 316 @java.lang.Override hashCode()317 public int hashCode() { 318 if (memoizedHashCode != 0) { 319 return memoizedHashCode; 320 } 321 int hash = 41; 322 hash = (19 * hash) + getDescriptor().hashCode(); 323 hash = (37 * hash) + START_USAGE_AMOUNT_FIELD_NUMBER; 324 hash = 325 (53 * hash) 326 + com.google.protobuf.Internal.hashLong( 327 java.lang.Double.doubleToLongBits(getStartUsageAmount())); 328 if (hasUnitPrice()) { 329 hash = (37 * hash) + UNIT_PRICE_FIELD_NUMBER; 330 hash = (53 * hash) + getUnitPrice().hashCode(); 331 } 332 hash = (29 * hash) + getUnknownFields().hashCode(); 333 memoizedHashCode = hash; 334 return hash; 335 } 336 parseFrom( java.nio.ByteBuffer data)337 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 338 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 339 return PARSER.parseFrom(data); 340 } 341 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)342 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 343 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 344 throws com.google.protobuf.InvalidProtocolBufferException { 345 return PARSER.parseFrom(data, extensionRegistry); 346 } 347 parseFrom( com.google.protobuf.ByteString data)348 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 349 com.google.protobuf.ByteString data) 350 throws com.google.protobuf.InvalidProtocolBufferException { 351 return PARSER.parseFrom(data); 352 } 353 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)354 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 355 com.google.protobuf.ByteString data, 356 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 357 throws com.google.protobuf.InvalidProtocolBufferException { 358 return PARSER.parseFrom(data, extensionRegistry); 359 } 360 parseFrom(byte[] data)361 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom(byte[] data) 362 throws com.google.protobuf.InvalidProtocolBufferException { 363 return PARSER.parseFrom(data); 364 } 365 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)366 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 367 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 368 throws com.google.protobuf.InvalidProtocolBufferException { 369 return PARSER.parseFrom(data, extensionRegistry); 370 } 371 parseFrom( java.io.InputStream input)372 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 373 java.io.InputStream input) throws java.io.IOException { 374 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 375 } 376 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)377 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 378 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 379 throws java.io.IOException { 380 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 381 PARSER, input, extensionRegistry); 382 } 383 parseDelimitedFrom( java.io.InputStream input)384 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseDelimitedFrom( 385 java.io.InputStream input) throws java.io.IOException { 386 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 387 } 388 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)389 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseDelimitedFrom( 390 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 391 throws java.io.IOException { 392 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 393 PARSER, input, extensionRegistry); 394 } 395 parseFrom( com.google.protobuf.CodedInputStream input)396 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 397 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 398 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 399 } 400 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)401 public static com.google.cloud.billing.v1.PricingExpression.TierRate parseFrom( 402 com.google.protobuf.CodedInputStream input, 403 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 404 throws java.io.IOException { 405 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 406 PARSER, input, extensionRegistry); 407 } 408 409 @java.lang.Override newBuilderForType()410 public Builder newBuilderForType() { 411 return newBuilder(); 412 } 413 newBuilder()414 public static Builder newBuilder() { 415 return DEFAULT_INSTANCE.toBuilder(); 416 } 417 newBuilder( com.google.cloud.billing.v1.PricingExpression.TierRate prototype)418 public static Builder newBuilder( 419 com.google.cloud.billing.v1.PricingExpression.TierRate prototype) { 420 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 421 } 422 423 @java.lang.Override toBuilder()424 public Builder toBuilder() { 425 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 426 } 427 428 @java.lang.Override newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)429 protected Builder newBuilderForType( 430 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 431 Builder builder = new Builder(parent); 432 return builder; 433 } 434 /** 435 * 436 * 437 * <pre> 438 * The price rate indicating starting usage and its corresponding price. 439 * </pre> 440 * 441 * Protobuf type {@code google.cloud.billing.v1.PricingExpression.TierRate} 442 */ 443 public static final class Builder 444 extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 445 implements 446 // @@protoc_insertion_point(builder_implements:google.cloud.billing.v1.PricingExpression.TierRate) 447 com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder { getDescriptor()448 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 449 return com.google.cloud.billing.v1.CloudCatalogProto 450 .internal_static_google_cloud_billing_v1_PricingExpression_TierRate_descriptor; 451 } 452 453 @java.lang.Override 454 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()455 internalGetFieldAccessorTable() { 456 return com.google.cloud.billing.v1.CloudCatalogProto 457 .internal_static_google_cloud_billing_v1_PricingExpression_TierRate_fieldAccessorTable 458 .ensureFieldAccessorsInitialized( 459 com.google.cloud.billing.v1.PricingExpression.TierRate.class, 460 com.google.cloud.billing.v1.PricingExpression.TierRate.Builder.class); 461 } 462 463 // Construct using com.google.cloud.billing.v1.PricingExpression.TierRate.newBuilder() Builder()464 private Builder() {} 465 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)466 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 467 super(parent); 468 } 469 470 @java.lang.Override clear()471 public Builder clear() { 472 super.clear(); 473 bitField0_ = 0; 474 startUsageAmount_ = 0D; 475 unitPrice_ = null; 476 if (unitPriceBuilder_ != null) { 477 unitPriceBuilder_.dispose(); 478 unitPriceBuilder_ = null; 479 } 480 return this; 481 } 482 483 @java.lang.Override getDescriptorForType()484 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 485 return com.google.cloud.billing.v1.CloudCatalogProto 486 .internal_static_google_cloud_billing_v1_PricingExpression_TierRate_descriptor; 487 } 488 489 @java.lang.Override getDefaultInstanceForType()490 public com.google.cloud.billing.v1.PricingExpression.TierRate getDefaultInstanceForType() { 491 return com.google.cloud.billing.v1.PricingExpression.TierRate.getDefaultInstance(); 492 } 493 494 @java.lang.Override build()495 public com.google.cloud.billing.v1.PricingExpression.TierRate build() { 496 com.google.cloud.billing.v1.PricingExpression.TierRate result = buildPartial(); 497 if (!result.isInitialized()) { 498 throw newUninitializedMessageException(result); 499 } 500 return result; 501 } 502 503 @java.lang.Override buildPartial()504 public com.google.cloud.billing.v1.PricingExpression.TierRate buildPartial() { 505 com.google.cloud.billing.v1.PricingExpression.TierRate result = 506 new com.google.cloud.billing.v1.PricingExpression.TierRate(this); 507 if (bitField0_ != 0) { 508 buildPartial0(result); 509 } 510 onBuilt(); 511 return result; 512 } 513 buildPartial0(com.google.cloud.billing.v1.PricingExpression.TierRate result)514 private void buildPartial0(com.google.cloud.billing.v1.PricingExpression.TierRate result) { 515 int from_bitField0_ = bitField0_; 516 if (((from_bitField0_ & 0x00000001) != 0)) { 517 result.startUsageAmount_ = startUsageAmount_; 518 } 519 if (((from_bitField0_ & 0x00000002) != 0)) { 520 result.unitPrice_ = unitPriceBuilder_ == null ? unitPrice_ : unitPriceBuilder_.build(); 521 } 522 } 523 524 @java.lang.Override clone()525 public Builder clone() { 526 return super.clone(); 527 } 528 529 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)530 public Builder setField( 531 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 532 return super.setField(field, value); 533 } 534 535 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)536 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 537 return super.clearField(field); 538 } 539 540 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)541 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 542 return super.clearOneof(oneof); 543 } 544 545 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)546 public Builder setRepeatedField( 547 com.google.protobuf.Descriptors.FieldDescriptor field, 548 int index, 549 java.lang.Object value) { 550 return super.setRepeatedField(field, index, value); 551 } 552 553 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)554 public Builder addRepeatedField( 555 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 556 return super.addRepeatedField(field, value); 557 } 558 559 @java.lang.Override mergeFrom(com.google.protobuf.Message other)560 public Builder mergeFrom(com.google.protobuf.Message other) { 561 if (other instanceof com.google.cloud.billing.v1.PricingExpression.TierRate) { 562 return mergeFrom((com.google.cloud.billing.v1.PricingExpression.TierRate) other); 563 } else { 564 super.mergeFrom(other); 565 return this; 566 } 567 } 568 mergeFrom(com.google.cloud.billing.v1.PricingExpression.TierRate other)569 public Builder mergeFrom(com.google.cloud.billing.v1.PricingExpression.TierRate other) { 570 if (other == com.google.cloud.billing.v1.PricingExpression.TierRate.getDefaultInstance()) 571 return this; 572 if (other.getStartUsageAmount() != 0D) { 573 setStartUsageAmount(other.getStartUsageAmount()); 574 } 575 if (other.hasUnitPrice()) { 576 mergeUnitPrice(other.getUnitPrice()); 577 } 578 this.mergeUnknownFields(other.getUnknownFields()); 579 onChanged(); 580 return this; 581 } 582 583 @java.lang.Override isInitialized()584 public final boolean isInitialized() { 585 return true; 586 } 587 588 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)589 public Builder mergeFrom( 590 com.google.protobuf.CodedInputStream input, 591 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 592 throws java.io.IOException { 593 if (extensionRegistry == null) { 594 throw new java.lang.NullPointerException(); 595 } 596 try { 597 boolean done = false; 598 while (!done) { 599 int tag = input.readTag(); 600 switch (tag) { 601 case 0: 602 done = true; 603 break; 604 case 9: 605 { 606 startUsageAmount_ = input.readDouble(); 607 bitField0_ |= 0x00000001; 608 break; 609 } // case 9 610 case 18: 611 { 612 input.readMessage(getUnitPriceFieldBuilder().getBuilder(), extensionRegistry); 613 bitField0_ |= 0x00000002; 614 break; 615 } // case 18 616 default: 617 { 618 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 619 done = true; // was an endgroup tag 620 } 621 break; 622 } // default: 623 } // switch (tag) 624 } // while (!done) 625 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 626 throw e.unwrapIOException(); 627 } finally { 628 onChanged(); 629 } // finally 630 return this; 631 } 632 633 private int bitField0_; 634 635 private double startUsageAmount_; 636 /** 637 * 638 * 639 * <pre> 640 * Usage is priced at this rate only after this amount. 641 * Example: start_usage_amount of 10 indicates that the usage will be priced 642 * at the unit_price after the first 10 usage_units. 643 * </pre> 644 * 645 * <code>double start_usage_amount = 1;</code> 646 * 647 * @return The startUsageAmount. 648 */ 649 @java.lang.Override getStartUsageAmount()650 public double getStartUsageAmount() { 651 return startUsageAmount_; 652 } 653 /** 654 * 655 * 656 * <pre> 657 * Usage is priced at this rate only after this amount. 658 * Example: start_usage_amount of 10 indicates that the usage will be priced 659 * at the unit_price after the first 10 usage_units. 660 * </pre> 661 * 662 * <code>double start_usage_amount = 1;</code> 663 * 664 * @param value The startUsageAmount to set. 665 * @return This builder for chaining. 666 */ setStartUsageAmount(double value)667 public Builder setStartUsageAmount(double value) { 668 669 startUsageAmount_ = value; 670 bitField0_ |= 0x00000001; 671 onChanged(); 672 return this; 673 } 674 /** 675 * 676 * 677 * <pre> 678 * Usage is priced at this rate only after this amount. 679 * Example: start_usage_amount of 10 indicates that the usage will be priced 680 * at the unit_price after the first 10 usage_units. 681 * </pre> 682 * 683 * <code>double start_usage_amount = 1;</code> 684 * 685 * @return This builder for chaining. 686 */ clearStartUsageAmount()687 public Builder clearStartUsageAmount() { 688 bitField0_ = (bitField0_ & ~0x00000001); 689 startUsageAmount_ = 0D; 690 onChanged(); 691 return this; 692 } 693 694 private com.google.type.Money unitPrice_; 695 private com.google.protobuf.SingleFieldBuilderV3< 696 com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> 697 unitPriceBuilder_; 698 /** 699 * 700 * 701 * <pre> 702 * The price per unit of usage. 703 * Example: unit_price of amount $10 indicates that each unit will cost $10. 704 * </pre> 705 * 706 * <code>.google.type.Money unit_price = 2;</code> 707 * 708 * @return Whether the unitPrice field is set. 709 */ hasUnitPrice()710 public boolean hasUnitPrice() { 711 return ((bitField0_ & 0x00000002) != 0); 712 } 713 /** 714 * 715 * 716 * <pre> 717 * The price per unit of usage. 718 * Example: unit_price of amount $10 indicates that each unit will cost $10. 719 * </pre> 720 * 721 * <code>.google.type.Money unit_price = 2;</code> 722 * 723 * @return The unitPrice. 724 */ getUnitPrice()725 public com.google.type.Money getUnitPrice() { 726 if (unitPriceBuilder_ == null) { 727 return unitPrice_ == null ? com.google.type.Money.getDefaultInstance() : unitPrice_; 728 } else { 729 return unitPriceBuilder_.getMessage(); 730 } 731 } 732 /** 733 * 734 * 735 * <pre> 736 * The price per unit of usage. 737 * Example: unit_price of amount $10 indicates that each unit will cost $10. 738 * </pre> 739 * 740 * <code>.google.type.Money unit_price = 2;</code> 741 */ setUnitPrice(com.google.type.Money value)742 public Builder setUnitPrice(com.google.type.Money value) { 743 if (unitPriceBuilder_ == null) { 744 if (value == null) { 745 throw new NullPointerException(); 746 } 747 unitPrice_ = value; 748 } else { 749 unitPriceBuilder_.setMessage(value); 750 } 751 bitField0_ |= 0x00000002; 752 onChanged(); 753 return this; 754 } 755 /** 756 * 757 * 758 * <pre> 759 * The price per unit of usage. 760 * Example: unit_price of amount $10 indicates that each unit will cost $10. 761 * </pre> 762 * 763 * <code>.google.type.Money unit_price = 2;</code> 764 */ setUnitPrice(com.google.type.Money.Builder builderForValue)765 public Builder setUnitPrice(com.google.type.Money.Builder builderForValue) { 766 if (unitPriceBuilder_ == null) { 767 unitPrice_ = builderForValue.build(); 768 } else { 769 unitPriceBuilder_.setMessage(builderForValue.build()); 770 } 771 bitField0_ |= 0x00000002; 772 onChanged(); 773 return this; 774 } 775 /** 776 * 777 * 778 * <pre> 779 * The price per unit of usage. 780 * Example: unit_price of amount $10 indicates that each unit will cost $10. 781 * </pre> 782 * 783 * <code>.google.type.Money unit_price = 2;</code> 784 */ mergeUnitPrice(com.google.type.Money value)785 public Builder mergeUnitPrice(com.google.type.Money value) { 786 if (unitPriceBuilder_ == null) { 787 if (((bitField0_ & 0x00000002) != 0) 788 && unitPrice_ != null 789 && unitPrice_ != com.google.type.Money.getDefaultInstance()) { 790 getUnitPriceBuilder().mergeFrom(value); 791 } else { 792 unitPrice_ = value; 793 } 794 } else { 795 unitPriceBuilder_.mergeFrom(value); 796 } 797 bitField0_ |= 0x00000002; 798 onChanged(); 799 return this; 800 } 801 /** 802 * 803 * 804 * <pre> 805 * The price per unit of usage. 806 * Example: unit_price of amount $10 indicates that each unit will cost $10. 807 * </pre> 808 * 809 * <code>.google.type.Money unit_price = 2;</code> 810 */ clearUnitPrice()811 public Builder clearUnitPrice() { 812 bitField0_ = (bitField0_ & ~0x00000002); 813 unitPrice_ = null; 814 if (unitPriceBuilder_ != null) { 815 unitPriceBuilder_.dispose(); 816 unitPriceBuilder_ = null; 817 } 818 onChanged(); 819 return this; 820 } 821 /** 822 * 823 * 824 * <pre> 825 * The price per unit of usage. 826 * Example: unit_price of amount $10 indicates that each unit will cost $10. 827 * </pre> 828 * 829 * <code>.google.type.Money unit_price = 2;</code> 830 */ getUnitPriceBuilder()831 public com.google.type.Money.Builder getUnitPriceBuilder() { 832 bitField0_ |= 0x00000002; 833 onChanged(); 834 return getUnitPriceFieldBuilder().getBuilder(); 835 } 836 /** 837 * 838 * 839 * <pre> 840 * The price per unit of usage. 841 * Example: unit_price of amount $10 indicates that each unit will cost $10. 842 * </pre> 843 * 844 * <code>.google.type.Money unit_price = 2;</code> 845 */ getUnitPriceOrBuilder()846 public com.google.type.MoneyOrBuilder getUnitPriceOrBuilder() { 847 if (unitPriceBuilder_ != null) { 848 return unitPriceBuilder_.getMessageOrBuilder(); 849 } else { 850 return unitPrice_ == null ? com.google.type.Money.getDefaultInstance() : unitPrice_; 851 } 852 } 853 /** 854 * 855 * 856 * <pre> 857 * The price per unit of usage. 858 * Example: unit_price of amount $10 indicates that each unit will cost $10. 859 * </pre> 860 * 861 * <code>.google.type.Money unit_price = 2;</code> 862 */ 863 private com.google.protobuf.SingleFieldBuilderV3< 864 com.google.type.Money, com.google.type.Money.Builder, com.google.type.MoneyOrBuilder> getUnitPriceFieldBuilder()865 getUnitPriceFieldBuilder() { 866 if (unitPriceBuilder_ == null) { 867 unitPriceBuilder_ = 868 new com.google.protobuf.SingleFieldBuilderV3< 869 com.google.type.Money, 870 com.google.type.Money.Builder, 871 com.google.type.MoneyOrBuilder>( 872 getUnitPrice(), getParentForChildren(), isClean()); 873 unitPrice_ = null; 874 } 875 return unitPriceBuilder_; 876 } 877 878 @java.lang.Override setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)879 public final Builder setUnknownFields( 880 final com.google.protobuf.UnknownFieldSet unknownFields) { 881 return super.setUnknownFields(unknownFields); 882 } 883 884 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)885 public final Builder mergeUnknownFields( 886 final com.google.protobuf.UnknownFieldSet unknownFields) { 887 return super.mergeUnknownFields(unknownFields); 888 } 889 890 // @@protoc_insertion_point(builder_scope:google.cloud.billing.v1.PricingExpression.TierRate) 891 } 892 893 // @@protoc_insertion_point(class_scope:google.cloud.billing.v1.PricingExpression.TierRate) 894 private static final com.google.cloud.billing.v1.PricingExpression.TierRate DEFAULT_INSTANCE; 895 896 static { 897 DEFAULT_INSTANCE = new com.google.cloud.billing.v1.PricingExpression.TierRate(); 898 } 899 getDefaultInstance()900 public static com.google.cloud.billing.v1.PricingExpression.TierRate getDefaultInstance() { 901 return DEFAULT_INSTANCE; 902 } 903 904 private static final com.google.protobuf.Parser<TierRate> PARSER = 905 new com.google.protobuf.AbstractParser<TierRate>() { 906 @java.lang.Override 907 public TierRate parsePartialFrom( 908 com.google.protobuf.CodedInputStream input, 909 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 910 throws com.google.protobuf.InvalidProtocolBufferException { 911 Builder builder = newBuilder(); 912 try { 913 builder.mergeFrom(input, extensionRegistry); 914 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 915 throw e.setUnfinishedMessage(builder.buildPartial()); 916 } catch (com.google.protobuf.UninitializedMessageException e) { 917 throw e.asInvalidProtocolBufferException() 918 .setUnfinishedMessage(builder.buildPartial()); 919 } catch (java.io.IOException e) { 920 throw new com.google.protobuf.InvalidProtocolBufferException(e) 921 .setUnfinishedMessage(builder.buildPartial()); 922 } 923 return builder.buildPartial(); 924 } 925 }; 926 parser()927 public static com.google.protobuf.Parser<TierRate> parser() { 928 return PARSER; 929 } 930 931 @java.lang.Override getParserForType()932 public com.google.protobuf.Parser<TierRate> getParserForType() { 933 return PARSER; 934 } 935 936 @java.lang.Override getDefaultInstanceForType()937 public com.google.cloud.billing.v1.PricingExpression.TierRate getDefaultInstanceForType() { 938 return DEFAULT_INSTANCE; 939 } 940 } 941 942 public static final int USAGE_UNIT_FIELD_NUMBER = 1; 943 944 @SuppressWarnings("serial") 945 private volatile java.lang.Object usageUnit_ = ""; 946 /** 947 * 948 * 949 * <pre> 950 * The short hand for unit of usage this pricing is specified in. 951 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 952 * </pre> 953 * 954 * <code>string usage_unit = 1;</code> 955 * 956 * @return The usageUnit. 957 */ 958 @java.lang.Override getUsageUnit()959 public java.lang.String getUsageUnit() { 960 java.lang.Object ref = usageUnit_; 961 if (ref instanceof java.lang.String) { 962 return (java.lang.String) ref; 963 } else { 964 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 965 java.lang.String s = bs.toStringUtf8(); 966 usageUnit_ = s; 967 return s; 968 } 969 } 970 /** 971 * 972 * 973 * <pre> 974 * The short hand for unit of usage this pricing is specified in. 975 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 976 * </pre> 977 * 978 * <code>string usage_unit = 1;</code> 979 * 980 * @return The bytes for usageUnit. 981 */ 982 @java.lang.Override getUsageUnitBytes()983 public com.google.protobuf.ByteString getUsageUnitBytes() { 984 java.lang.Object ref = usageUnit_; 985 if (ref instanceof java.lang.String) { 986 com.google.protobuf.ByteString b = 987 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 988 usageUnit_ = b; 989 return b; 990 } else { 991 return (com.google.protobuf.ByteString) ref; 992 } 993 } 994 995 public static final int DISPLAY_QUANTITY_FIELD_NUMBER = 2; 996 private double displayQuantity_ = 0D; 997 /** 998 * 999 * 1000 * <pre> 1001 * The recommended quantity of units for displaying pricing info. When 1002 * displaying pricing info it is recommended to display: 1003 * (unit_price * display_quantity) per display_quantity usage_unit. 1004 * This field does not affect the pricing formula and is for display purposes 1005 * only. 1006 * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and 1007 * the display_quantity is "1000" then the recommended way of displaying the 1008 * pricing info is "0.10 USD per 1000 GB" 1009 * </pre> 1010 * 1011 * <code>double display_quantity = 2;</code> 1012 * 1013 * @return The displayQuantity. 1014 */ 1015 @java.lang.Override getDisplayQuantity()1016 public double getDisplayQuantity() { 1017 return displayQuantity_; 1018 } 1019 1020 public static final int TIERED_RATES_FIELD_NUMBER = 3; 1021 1022 @SuppressWarnings("serial") 1023 private java.util.List<com.google.cloud.billing.v1.PricingExpression.TierRate> tieredRates_; 1024 /** 1025 * 1026 * 1027 * <pre> 1028 * The list of tiered rates for this pricing. The total cost is computed by 1029 * applying each of the tiered rates on usage. This repeated list is sorted 1030 * by ascending order of start_usage_amount. 1031 * </pre> 1032 * 1033 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 1034 */ 1035 @java.lang.Override 1036 public java.util.List<com.google.cloud.billing.v1.PricingExpression.TierRate> getTieredRatesList()1037 getTieredRatesList() { 1038 return tieredRates_; 1039 } 1040 /** 1041 * 1042 * 1043 * <pre> 1044 * The list of tiered rates for this pricing. The total cost is computed by 1045 * applying each of the tiered rates on usage. This repeated list is sorted 1046 * by ascending order of start_usage_amount. 1047 * </pre> 1048 * 1049 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 1050 */ 1051 @java.lang.Override 1052 public java.util.List<? extends com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder> getTieredRatesOrBuilderList()1053 getTieredRatesOrBuilderList() { 1054 return tieredRates_; 1055 } 1056 /** 1057 * 1058 * 1059 * <pre> 1060 * The list of tiered rates for this pricing. The total cost is computed by 1061 * applying each of the tiered rates on usage. This repeated list is sorted 1062 * by ascending order of start_usage_amount. 1063 * </pre> 1064 * 1065 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 1066 */ 1067 @java.lang.Override getTieredRatesCount()1068 public int getTieredRatesCount() { 1069 return tieredRates_.size(); 1070 } 1071 /** 1072 * 1073 * 1074 * <pre> 1075 * The list of tiered rates for this pricing. The total cost is computed by 1076 * applying each of the tiered rates on usage. This repeated list is sorted 1077 * by ascending order of start_usage_amount. 1078 * </pre> 1079 * 1080 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 1081 */ 1082 @java.lang.Override getTieredRates(int index)1083 public com.google.cloud.billing.v1.PricingExpression.TierRate getTieredRates(int index) { 1084 return tieredRates_.get(index); 1085 } 1086 /** 1087 * 1088 * 1089 * <pre> 1090 * The list of tiered rates for this pricing. The total cost is computed by 1091 * applying each of the tiered rates on usage. This repeated list is sorted 1092 * by ascending order of start_usage_amount. 1093 * </pre> 1094 * 1095 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 1096 */ 1097 @java.lang.Override getTieredRatesOrBuilder( int index)1098 public com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder getTieredRatesOrBuilder( 1099 int index) { 1100 return tieredRates_.get(index); 1101 } 1102 1103 public static final int USAGE_UNIT_DESCRIPTION_FIELD_NUMBER = 4; 1104 1105 @SuppressWarnings("serial") 1106 private volatile java.lang.Object usageUnitDescription_ = ""; 1107 /** 1108 * 1109 * 1110 * <pre> 1111 * The unit of usage in human readable form. 1112 * Example: "gibi byte". 1113 * </pre> 1114 * 1115 * <code>string usage_unit_description = 4;</code> 1116 * 1117 * @return The usageUnitDescription. 1118 */ 1119 @java.lang.Override getUsageUnitDescription()1120 public java.lang.String getUsageUnitDescription() { 1121 java.lang.Object ref = usageUnitDescription_; 1122 if (ref instanceof java.lang.String) { 1123 return (java.lang.String) ref; 1124 } else { 1125 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1126 java.lang.String s = bs.toStringUtf8(); 1127 usageUnitDescription_ = s; 1128 return s; 1129 } 1130 } 1131 /** 1132 * 1133 * 1134 * <pre> 1135 * The unit of usage in human readable form. 1136 * Example: "gibi byte". 1137 * </pre> 1138 * 1139 * <code>string usage_unit_description = 4;</code> 1140 * 1141 * @return The bytes for usageUnitDescription. 1142 */ 1143 @java.lang.Override getUsageUnitDescriptionBytes()1144 public com.google.protobuf.ByteString getUsageUnitDescriptionBytes() { 1145 java.lang.Object ref = usageUnitDescription_; 1146 if (ref instanceof java.lang.String) { 1147 com.google.protobuf.ByteString b = 1148 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1149 usageUnitDescription_ = b; 1150 return b; 1151 } else { 1152 return (com.google.protobuf.ByteString) ref; 1153 } 1154 } 1155 1156 public static final int BASE_UNIT_FIELD_NUMBER = 5; 1157 1158 @SuppressWarnings("serial") 1159 private volatile java.lang.Object baseUnit_ = ""; 1160 /** 1161 * 1162 * 1163 * <pre> 1164 * The base unit for the SKU which is the unit used in usage exports. 1165 * Example: "By" 1166 * </pre> 1167 * 1168 * <code>string base_unit = 5;</code> 1169 * 1170 * @return The baseUnit. 1171 */ 1172 @java.lang.Override getBaseUnit()1173 public java.lang.String getBaseUnit() { 1174 java.lang.Object ref = baseUnit_; 1175 if (ref instanceof java.lang.String) { 1176 return (java.lang.String) ref; 1177 } else { 1178 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1179 java.lang.String s = bs.toStringUtf8(); 1180 baseUnit_ = s; 1181 return s; 1182 } 1183 } 1184 /** 1185 * 1186 * 1187 * <pre> 1188 * The base unit for the SKU which is the unit used in usage exports. 1189 * Example: "By" 1190 * </pre> 1191 * 1192 * <code>string base_unit = 5;</code> 1193 * 1194 * @return The bytes for baseUnit. 1195 */ 1196 @java.lang.Override getBaseUnitBytes()1197 public com.google.protobuf.ByteString getBaseUnitBytes() { 1198 java.lang.Object ref = baseUnit_; 1199 if (ref instanceof java.lang.String) { 1200 com.google.protobuf.ByteString b = 1201 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1202 baseUnit_ = b; 1203 return b; 1204 } else { 1205 return (com.google.protobuf.ByteString) ref; 1206 } 1207 } 1208 1209 public static final int BASE_UNIT_DESCRIPTION_FIELD_NUMBER = 6; 1210 1211 @SuppressWarnings("serial") 1212 private volatile java.lang.Object baseUnitDescription_ = ""; 1213 /** 1214 * 1215 * 1216 * <pre> 1217 * The base unit in human readable form. 1218 * Example: "byte". 1219 * </pre> 1220 * 1221 * <code>string base_unit_description = 6;</code> 1222 * 1223 * @return The baseUnitDescription. 1224 */ 1225 @java.lang.Override getBaseUnitDescription()1226 public java.lang.String getBaseUnitDescription() { 1227 java.lang.Object ref = baseUnitDescription_; 1228 if (ref instanceof java.lang.String) { 1229 return (java.lang.String) ref; 1230 } else { 1231 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1232 java.lang.String s = bs.toStringUtf8(); 1233 baseUnitDescription_ = s; 1234 return s; 1235 } 1236 } 1237 /** 1238 * 1239 * 1240 * <pre> 1241 * The base unit in human readable form. 1242 * Example: "byte". 1243 * </pre> 1244 * 1245 * <code>string base_unit_description = 6;</code> 1246 * 1247 * @return The bytes for baseUnitDescription. 1248 */ 1249 @java.lang.Override getBaseUnitDescriptionBytes()1250 public com.google.protobuf.ByteString getBaseUnitDescriptionBytes() { 1251 java.lang.Object ref = baseUnitDescription_; 1252 if (ref instanceof java.lang.String) { 1253 com.google.protobuf.ByteString b = 1254 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1255 baseUnitDescription_ = b; 1256 return b; 1257 } else { 1258 return (com.google.protobuf.ByteString) ref; 1259 } 1260 } 1261 1262 public static final int BASE_UNIT_CONVERSION_FACTOR_FIELD_NUMBER = 7; 1263 private double baseUnitConversionFactor_ = 0D; 1264 /** 1265 * 1266 * 1267 * <pre> 1268 * Conversion factor for converting from price per usage_unit to price per 1269 * base_unit, and start_usage_amount to start_usage_amount in base_unit. 1270 * unit_price / base_unit_conversion_factor = price per base_unit. 1271 * start_usage_amount * base_unit_conversion_factor = start_usage_amount in 1272 * base_unit. 1273 * </pre> 1274 * 1275 * <code>double base_unit_conversion_factor = 7;</code> 1276 * 1277 * @return The baseUnitConversionFactor. 1278 */ 1279 @java.lang.Override getBaseUnitConversionFactor()1280 public double getBaseUnitConversionFactor() { 1281 return baseUnitConversionFactor_; 1282 } 1283 1284 private byte memoizedIsInitialized = -1; 1285 1286 @java.lang.Override isInitialized()1287 public final boolean isInitialized() { 1288 byte isInitialized = memoizedIsInitialized; 1289 if (isInitialized == 1) return true; 1290 if (isInitialized == 0) return false; 1291 1292 memoizedIsInitialized = 1; 1293 return true; 1294 } 1295 1296 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1297 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1298 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(usageUnit_)) { 1299 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, usageUnit_); 1300 } 1301 if (java.lang.Double.doubleToRawLongBits(displayQuantity_) != 0) { 1302 output.writeDouble(2, displayQuantity_); 1303 } 1304 for (int i = 0; i < tieredRates_.size(); i++) { 1305 output.writeMessage(3, tieredRates_.get(i)); 1306 } 1307 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(usageUnitDescription_)) { 1308 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, usageUnitDescription_); 1309 } 1310 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(baseUnit_)) { 1311 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, baseUnit_); 1312 } 1313 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(baseUnitDescription_)) { 1314 com.google.protobuf.GeneratedMessageV3.writeString(output, 6, baseUnitDescription_); 1315 } 1316 if (java.lang.Double.doubleToRawLongBits(baseUnitConversionFactor_) != 0) { 1317 output.writeDouble(7, baseUnitConversionFactor_); 1318 } 1319 getUnknownFields().writeTo(output); 1320 } 1321 1322 @java.lang.Override getSerializedSize()1323 public int getSerializedSize() { 1324 int size = memoizedSize; 1325 if (size != -1) return size; 1326 1327 size = 0; 1328 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(usageUnit_)) { 1329 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, usageUnit_); 1330 } 1331 if (java.lang.Double.doubleToRawLongBits(displayQuantity_) != 0) { 1332 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, displayQuantity_); 1333 } 1334 for (int i = 0; i < tieredRates_.size(); i++) { 1335 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, tieredRates_.get(i)); 1336 } 1337 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(usageUnitDescription_)) { 1338 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, usageUnitDescription_); 1339 } 1340 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(baseUnit_)) { 1341 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, baseUnit_); 1342 } 1343 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(baseUnitDescription_)) { 1344 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, baseUnitDescription_); 1345 } 1346 if (java.lang.Double.doubleToRawLongBits(baseUnitConversionFactor_) != 0) { 1347 size += com.google.protobuf.CodedOutputStream.computeDoubleSize(7, baseUnitConversionFactor_); 1348 } 1349 size += getUnknownFields().getSerializedSize(); 1350 memoizedSize = size; 1351 return size; 1352 } 1353 1354 @java.lang.Override equals(final java.lang.Object obj)1355 public boolean equals(final java.lang.Object obj) { 1356 if (obj == this) { 1357 return true; 1358 } 1359 if (!(obj instanceof com.google.cloud.billing.v1.PricingExpression)) { 1360 return super.equals(obj); 1361 } 1362 com.google.cloud.billing.v1.PricingExpression other = 1363 (com.google.cloud.billing.v1.PricingExpression) obj; 1364 1365 if (!getUsageUnit().equals(other.getUsageUnit())) return false; 1366 if (java.lang.Double.doubleToLongBits(getDisplayQuantity()) 1367 != java.lang.Double.doubleToLongBits(other.getDisplayQuantity())) return false; 1368 if (!getTieredRatesList().equals(other.getTieredRatesList())) return false; 1369 if (!getUsageUnitDescription().equals(other.getUsageUnitDescription())) return false; 1370 if (!getBaseUnit().equals(other.getBaseUnit())) return false; 1371 if (!getBaseUnitDescription().equals(other.getBaseUnitDescription())) return false; 1372 if (java.lang.Double.doubleToLongBits(getBaseUnitConversionFactor()) 1373 != java.lang.Double.doubleToLongBits(other.getBaseUnitConversionFactor())) return false; 1374 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1375 return true; 1376 } 1377 1378 @java.lang.Override hashCode()1379 public int hashCode() { 1380 if (memoizedHashCode != 0) { 1381 return memoizedHashCode; 1382 } 1383 int hash = 41; 1384 hash = (19 * hash) + getDescriptor().hashCode(); 1385 hash = (37 * hash) + USAGE_UNIT_FIELD_NUMBER; 1386 hash = (53 * hash) + getUsageUnit().hashCode(); 1387 hash = (37 * hash) + DISPLAY_QUANTITY_FIELD_NUMBER; 1388 hash = 1389 (53 * hash) 1390 + com.google.protobuf.Internal.hashLong( 1391 java.lang.Double.doubleToLongBits(getDisplayQuantity())); 1392 if (getTieredRatesCount() > 0) { 1393 hash = (37 * hash) + TIERED_RATES_FIELD_NUMBER; 1394 hash = (53 * hash) + getTieredRatesList().hashCode(); 1395 } 1396 hash = (37 * hash) + USAGE_UNIT_DESCRIPTION_FIELD_NUMBER; 1397 hash = (53 * hash) + getUsageUnitDescription().hashCode(); 1398 hash = (37 * hash) + BASE_UNIT_FIELD_NUMBER; 1399 hash = (53 * hash) + getBaseUnit().hashCode(); 1400 hash = (37 * hash) + BASE_UNIT_DESCRIPTION_FIELD_NUMBER; 1401 hash = (53 * hash) + getBaseUnitDescription().hashCode(); 1402 hash = (37 * hash) + BASE_UNIT_CONVERSION_FACTOR_FIELD_NUMBER; 1403 hash = 1404 (53 * hash) 1405 + com.google.protobuf.Internal.hashLong( 1406 java.lang.Double.doubleToLongBits(getBaseUnitConversionFactor())); 1407 hash = (29 * hash) + getUnknownFields().hashCode(); 1408 memoizedHashCode = hash; 1409 return hash; 1410 } 1411 parseFrom(java.nio.ByteBuffer data)1412 public static com.google.cloud.billing.v1.PricingExpression parseFrom(java.nio.ByteBuffer data) 1413 throws com.google.protobuf.InvalidProtocolBufferException { 1414 return PARSER.parseFrom(data); 1415 } 1416 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1417 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1418 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1419 throws com.google.protobuf.InvalidProtocolBufferException { 1420 return PARSER.parseFrom(data, extensionRegistry); 1421 } 1422 parseFrom( com.google.protobuf.ByteString data)1423 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1424 com.google.protobuf.ByteString data) 1425 throws com.google.protobuf.InvalidProtocolBufferException { 1426 return PARSER.parseFrom(data); 1427 } 1428 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1429 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1430 com.google.protobuf.ByteString data, 1431 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1432 throws com.google.protobuf.InvalidProtocolBufferException { 1433 return PARSER.parseFrom(data, extensionRegistry); 1434 } 1435 parseFrom(byte[] data)1436 public static com.google.cloud.billing.v1.PricingExpression parseFrom(byte[] data) 1437 throws com.google.protobuf.InvalidProtocolBufferException { 1438 return PARSER.parseFrom(data); 1439 } 1440 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1441 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1442 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1443 throws com.google.protobuf.InvalidProtocolBufferException { 1444 return PARSER.parseFrom(data, extensionRegistry); 1445 } 1446 parseFrom(java.io.InputStream input)1447 public static com.google.cloud.billing.v1.PricingExpression parseFrom(java.io.InputStream input) 1448 throws java.io.IOException { 1449 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1450 } 1451 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1452 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1453 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1454 throws java.io.IOException { 1455 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1456 PARSER, input, extensionRegistry); 1457 } 1458 parseDelimitedFrom( java.io.InputStream input)1459 public static com.google.cloud.billing.v1.PricingExpression parseDelimitedFrom( 1460 java.io.InputStream input) throws java.io.IOException { 1461 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1462 } 1463 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1464 public static com.google.cloud.billing.v1.PricingExpression parseDelimitedFrom( 1465 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1466 throws java.io.IOException { 1467 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1468 PARSER, input, extensionRegistry); 1469 } 1470 parseFrom( com.google.protobuf.CodedInputStream input)1471 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1472 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1473 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1474 } 1475 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1476 public static com.google.cloud.billing.v1.PricingExpression parseFrom( 1477 com.google.protobuf.CodedInputStream input, 1478 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1479 throws java.io.IOException { 1480 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1481 PARSER, input, extensionRegistry); 1482 } 1483 1484 @java.lang.Override newBuilderForType()1485 public Builder newBuilderForType() { 1486 return newBuilder(); 1487 } 1488 newBuilder()1489 public static Builder newBuilder() { 1490 return DEFAULT_INSTANCE.toBuilder(); 1491 } 1492 newBuilder(com.google.cloud.billing.v1.PricingExpression prototype)1493 public static Builder newBuilder(com.google.cloud.billing.v1.PricingExpression prototype) { 1494 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1495 } 1496 1497 @java.lang.Override toBuilder()1498 public Builder toBuilder() { 1499 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1500 } 1501 1502 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1503 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1504 Builder builder = new Builder(parent); 1505 return builder; 1506 } 1507 /** 1508 * 1509 * 1510 * <pre> 1511 * Expresses a mathematical pricing formula. For Example:- 1512 * `usage_unit: GBy` 1513 * `tiered_rates:` 1514 * `[start_usage_amount: 20, unit_price: $10]` 1515 * `[start_usage_amount: 100, unit_price: $5]` 1516 * The above expresses a pricing formula where the first 20GB is free, the 1517 * next 80GB is priced at $10 per GB followed by $5 per GB for additional 1518 * usage. 1519 * </pre> 1520 * 1521 * Protobuf type {@code google.cloud.billing.v1.PricingExpression} 1522 */ 1523 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1524 implements 1525 // @@protoc_insertion_point(builder_implements:google.cloud.billing.v1.PricingExpression) 1526 com.google.cloud.billing.v1.PricingExpressionOrBuilder { getDescriptor()1527 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1528 return com.google.cloud.billing.v1.CloudCatalogProto 1529 .internal_static_google_cloud_billing_v1_PricingExpression_descriptor; 1530 } 1531 1532 @java.lang.Override 1533 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1534 internalGetFieldAccessorTable() { 1535 return com.google.cloud.billing.v1.CloudCatalogProto 1536 .internal_static_google_cloud_billing_v1_PricingExpression_fieldAccessorTable 1537 .ensureFieldAccessorsInitialized( 1538 com.google.cloud.billing.v1.PricingExpression.class, 1539 com.google.cloud.billing.v1.PricingExpression.Builder.class); 1540 } 1541 1542 // Construct using com.google.cloud.billing.v1.PricingExpression.newBuilder() Builder()1543 private Builder() {} 1544 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1545 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1546 super(parent); 1547 } 1548 1549 @java.lang.Override clear()1550 public Builder clear() { 1551 super.clear(); 1552 bitField0_ = 0; 1553 usageUnit_ = ""; 1554 displayQuantity_ = 0D; 1555 if (tieredRatesBuilder_ == null) { 1556 tieredRates_ = java.util.Collections.emptyList(); 1557 } else { 1558 tieredRates_ = null; 1559 tieredRatesBuilder_.clear(); 1560 } 1561 bitField0_ = (bitField0_ & ~0x00000004); 1562 usageUnitDescription_ = ""; 1563 baseUnit_ = ""; 1564 baseUnitDescription_ = ""; 1565 baseUnitConversionFactor_ = 0D; 1566 return this; 1567 } 1568 1569 @java.lang.Override getDescriptorForType()1570 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1571 return com.google.cloud.billing.v1.CloudCatalogProto 1572 .internal_static_google_cloud_billing_v1_PricingExpression_descriptor; 1573 } 1574 1575 @java.lang.Override getDefaultInstanceForType()1576 public com.google.cloud.billing.v1.PricingExpression getDefaultInstanceForType() { 1577 return com.google.cloud.billing.v1.PricingExpression.getDefaultInstance(); 1578 } 1579 1580 @java.lang.Override build()1581 public com.google.cloud.billing.v1.PricingExpression build() { 1582 com.google.cloud.billing.v1.PricingExpression result = buildPartial(); 1583 if (!result.isInitialized()) { 1584 throw newUninitializedMessageException(result); 1585 } 1586 return result; 1587 } 1588 1589 @java.lang.Override buildPartial()1590 public com.google.cloud.billing.v1.PricingExpression buildPartial() { 1591 com.google.cloud.billing.v1.PricingExpression result = 1592 new com.google.cloud.billing.v1.PricingExpression(this); 1593 buildPartialRepeatedFields(result); 1594 if (bitField0_ != 0) { 1595 buildPartial0(result); 1596 } 1597 onBuilt(); 1598 return result; 1599 } 1600 buildPartialRepeatedFields(com.google.cloud.billing.v1.PricingExpression result)1601 private void buildPartialRepeatedFields(com.google.cloud.billing.v1.PricingExpression result) { 1602 if (tieredRatesBuilder_ == null) { 1603 if (((bitField0_ & 0x00000004) != 0)) { 1604 tieredRates_ = java.util.Collections.unmodifiableList(tieredRates_); 1605 bitField0_ = (bitField0_ & ~0x00000004); 1606 } 1607 result.tieredRates_ = tieredRates_; 1608 } else { 1609 result.tieredRates_ = tieredRatesBuilder_.build(); 1610 } 1611 } 1612 buildPartial0(com.google.cloud.billing.v1.PricingExpression result)1613 private void buildPartial0(com.google.cloud.billing.v1.PricingExpression result) { 1614 int from_bitField0_ = bitField0_; 1615 if (((from_bitField0_ & 0x00000001) != 0)) { 1616 result.usageUnit_ = usageUnit_; 1617 } 1618 if (((from_bitField0_ & 0x00000002) != 0)) { 1619 result.displayQuantity_ = displayQuantity_; 1620 } 1621 if (((from_bitField0_ & 0x00000008) != 0)) { 1622 result.usageUnitDescription_ = usageUnitDescription_; 1623 } 1624 if (((from_bitField0_ & 0x00000010) != 0)) { 1625 result.baseUnit_ = baseUnit_; 1626 } 1627 if (((from_bitField0_ & 0x00000020) != 0)) { 1628 result.baseUnitDescription_ = baseUnitDescription_; 1629 } 1630 if (((from_bitField0_ & 0x00000040) != 0)) { 1631 result.baseUnitConversionFactor_ = baseUnitConversionFactor_; 1632 } 1633 } 1634 1635 @java.lang.Override clone()1636 public Builder clone() { 1637 return super.clone(); 1638 } 1639 1640 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1641 public Builder setField( 1642 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1643 return super.setField(field, value); 1644 } 1645 1646 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1647 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1648 return super.clearField(field); 1649 } 1650 1651 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1652 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1653 return super.clearOneof(oneof); 1654 } 1655 1656 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1657 public Builder setRepeatedField( 1658 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1659 return super.setRepeatedField(field, index, value); 1660 } 1661 1662 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1663 public Builder addRepeatedField( 1664 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1665 return super.addRepeatedField(field, value); 1666 } 1667 1668 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1669 public Builder mergeFrom(com.google.protobuf.Message other) { 1670 if (other instanceof com.google.cloud.billing.v1.PricingExpression) { 1671 return mergeFrom((com.google.cloud.billing.v1.PricingExpression) other); 1672 } else { 1673 super.mergeFrom(other); 1674 return this; 1675 } 1676 } 1677 mergeFrom(com.google.cloud.billing.v1.PricingExpression other)1678 public Builder mergeFrom(com.google.cloud.billing.v1.PricingExpression other) { 1679 if (other == com.google.cloud.billing.v1.PricingExpression.getDefaultInstance()) return this; 1680 if (!other.getUsageUnit().isEmpty()) { 1681 usageUnit_ = other.usageUnit_; 1682 bitField0_ |= 0x00000001; 1683 onChanged(); 1684 } 1685 if (other.getDisplayQuantity() != 0D) { 1686 setDisplayQuantity(other.getDisplayQuantity()); 1687 } 1688 if (tieredRatesBuilder_ == null) { 1689 if (!other.tieredRates_.isEmpty()) { 1690 if (tieredRates_.isEmpty()) { 1691 tieredRates_ = other.tieredRates_; 1692 bitField0_ = (bitField0_ & ~0x00000004); 1693 } else { 1694 ensureTieredRatesIsMutable(); 1695 tieredRates_.addAll(other.tieredRates_); 1696 } 1697 onChanged(); 1698 } 1699 } else { 1700 if (!other.tieredRates_.isEmpty()) { 1701 if (tieredRatesBuilder_.isEmpty()) { 1702 tieredRatesBuilder_.dispose(); 1703 tieredRatesBuilder_ = null; 1704 tieredRates_ = other.tieredRates_; 1705 bitField0_ = (bitField0_ & ~0x00000004); 1706 tieredRatesBuilder_ = 1707 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 1708 ? getTieredRatesFieldBuilder() 1709 : null; 1710 } else { 1711 tieredRatesBuilder_.addAllMessages(other.tieredRates_); 1712 } 1713 } 1714 } 1715 if (!other.getUsageUnitDescription().isEmpty()) { 1716 usageUnitDescription_ = other.usageUnitDescription_; 1717 bitField0_ |= 0x00000008; 1718 onChanged(); 1719 } 1720 if (!other.getBaseUnit().isEmpty()) { 1721 baseUnit_ = other.baseUnit_; 1722 bitField0_ |= 0x00000010; 1723 onChanged(); 1724 } 1725 if (!other.getBaseUnitDescription().isEmpty()) { 1726 baseUnitDescription_ = other.baseUnitDescription_; 1727 bitField0_ |= 0x00000020; 1728 onChanged(); 1729 } 1730 if (other.getBaseUnitConversionFactor() != 0D) { 1731 setBaseUnitConversionFactor(other.getBaseUnitConversionFactor()); 1732 } 1733 this.mergeUnknownFields(other.getUnknownFields()); 1734 onChanged(); 1735 return this; 1736 } 1737 1738 @java.lang.Override isInitialized()1739 public final boolean isInitialized() { 1740 return true; 1741 } 1742 1743 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1744 public Builder mergeFrom( 1745 com.google.protobuf.CodedInputStream input, 1746 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1747 throws java.io.IOException { 1748 if (extensionRegistry == null) { 1749 throw new java.lang.NullPointerException(); 1750 } 1751 try { 1752 boolean done = false; 1753 while (!done) { 1754 int tag = input.readTag(); 1755 switch (tag) { 1756 case 0: 1757 done = true; 1758 break; 1759 case 10: 1760 { 1761 usageUnit_ = input.readStringRequireUtf8(); 1762 bitField0_ |= 0x00000001; 1763 break; 1764 } // case 10 1765 case 17: 1766 { 1767 displayQuantity_ = input.readDouble(); 1768 bitField0_ |= 0x00000002; 1769 break; 1770 } // case 17 1771 case 26: 1772 { 1773 com.google.cloud.billing.v1.PricingExpression.TierRate m = 1774 input.readMessage( 1775 com.google.cloud.billing.v1.PricingExpression.TierRate.parser(), 1776 extensionRegistry); 1777 if (tieredRatesBuilder_ == null) { 1778 ensureTieredRatesIsMutable(); 1779 tieredRates_.add(m); 1780 } else { 1781 tieredRatesBuilder_.addMessage(m); 1782 } 1783 break; 1784 } // case 26 1785 case 34: 1786 { 1787 usageUnitDescription_ = input.readStringRequireUtf8(); 1788 bitField0_ |= 0x00000008; 1789 break; 1790 } // case 34 1791 case 42: 1792 { 1793 baseUnit_ = input.readStringRequireUtf8(); 1794 bitField0_ |= 0x00000010; 1795 break; 1796 } // case 42 1797 case 50: 1798 { 1799 baseUnitDescription_ = input.readStringRequireUtf8(); 1800 bitField0_ |= 0x00000020; 1801 break; 1802 } // case 50 1803 case 57: 1804 { 1805 baseUnitConversionFactor_ = input.readDouble(); 1806 bitField0_ |= 0x00000040; 1807 break; 1808 } // case 57 1809 default: 1810 { 1811 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1812 done = true; // was an endgroup tag 1813 } 1814 break; 1815 } // default: 1816 } // switch (tag) 1817 } // while (!done) 1818 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1819 throw e.unwrapIOException(); 1820 } finally { 1821 onChanged(); 1822 } // finally 1823 return this; 1824 } 1825 1826 private int bitField0_; 1827 1828 private java.lang.Object usageUnit_ = ""; 1829 /** 1830 * 1831 * 1832 * <pre> 1833 * The short hand for unit of usage this pricing is specified in. 1834 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 1835 * </pre> 1836 * 1837 * <code>string usage_unit = 1;</code> 1838 * 1839 * @return The usageUnit. 1840 */ getUsageUnit()1841 public java.lang.String getUsageUnit() { 1842 java.lang.Object ref = usageUnit_; 1843 if (!(ref instanceof java.lang.String)) { 1844 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1845 java.lang.String s = bs.toStringUtf8(); 1846 usageUnit_ = s; 1847 return s; 1848 } else { 1849 return (java.lang.String) ref; 1850 } 1851 } 1852 /** 1853 * 1854 * 1855 * <pre> 1856 * The short hand for unit of usage this pricing is specified in. 1857 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 1858 * </pre> 1859 * 1860 * <code>string usage_unit = 1;</code> 1861 * 1862 * @return The bytes for usageUnit. 1863 */ getUsageUnitBytes()1864 public com.google.protobuf.ByteString getUsageUnitBytes() { 1865 java.lang.Object ref = usageUnit_; 1866 if (ref instanceof String) { 1867 com.google.protobuf.ByteString b = 1868 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1869 usageUnit_ = b; 1870 return b; 1871 } else { 1872 return (com.google.protobuf.ByteString) ref; 1873 } 1874 } 1875 /** 1876 * 1877 * 1878 * <pre> 1879 * The short hand for unit of usage this pricing is specified in. 1880 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 1881 * </pre> 1882 * 1883 * <code>string usage_unit = 1;</code> 1884 * 1885 * @param value The usageUnit to set. 1886 * @return This builder for chaining. 1887 */ setUsageUnit(java.lang.String value)1888 public Builder setUsageUnit(java.lang.String value) { 1889 if (value == null) { 1890 throw new NullPointerException(); 1891 } 1892 usageUnit_ = value; 1893 bitField0_ |= 0x00000001; 1894 onChanged(); 1895 return this; 1896 } 1897 /** 1898 * 1899 * 1900 * <pre> 1901 * The short hand for unit of usage this pricing is specified in. 1902 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 1903 * </pre> 1904 * 1905 * <code>string usage_unit = 1;</code> 1906 * 1907 * @return This builder for chaining. 1908 */ clearUsageUnit()1909 public Builder clearUsageUnit() { 1910 usageUnit_ = getDefaultInstance().getUsageUnit(); 1911 bitField0_ = (bitField0_ & ~0x00000001); 1912 onChanged(); 1913 return this; 1914 } 1915 /** 1916 * 1917 * 1918 * <pre> 1919 * The short hand for unit of usage this pricing is specified in. 1920 * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". 1921 * </pre> 1922 * 1923 * <code>string usage_unit = 1;</code> 1924 * 1925 * @param value The bytes for usageUnit to set. 1926 * @return This builder for chaining. 1927 */ setUsageUnitBytes(com.google.protobuf.ByteString value)1928 public Builder setUsageUnitBytes(com.google.protobuf.ByteString value) { 1929 if (value == null) { 1930 throw new NullPointerException(); 1931 } 1932 checkByteStringIsUtf8(value); 1933 usageUnit_ = value; 1934 bitField0_ |= 0x00000001; 1935 onChanged(); 1936 return this; 1937 } 1938 1939 private double displayQuantity_; 1940 /** 1941 * 1942 * 1943 * <pre> 1944 * The recommended quantity of units for displaying pricing info. When 1945 * displaying pricing info it is recommended to display: 1946 * (unit_price * display_quantity) per display_quantity usage_unit. 1947 * This field does not affect the pricing formula and is for display purposes 1948 * only. 1949 * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and 1950 * the display_quantity is "1000" then the recommended way of displaying the 1951 * pricing info is "0.10 USD per 1000 GB" 1952 * </pre> 1953 * 1954 * <code>double display_quantity = 2;</code> 1955 * 1956 * @return The displayQuantity. 1957 */ 1958 @java.lang.Override getDisplayQuantity()1959 public double getDisplayQuantity() { 1960 return displayQuantity_; 1961 } 1962 /** 1963 * 1964 * 1965 * <pre> 1966 * The recommended quantity of units for displaying pricing info. When 1967 * displaying pricing info it is recommended to display: 1968 * (unit_price * display_quantity) per display_quantity usage_unit. 1969 * This field does not affect the pricing formula and is for display purposes 1970 * only. 1971 * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and 1972 * the display_quantity is "1000" then the recommended way of displaying the 1973 * pricing info is "0.10 USD per 1000 GB" 1974 * </pre> 1975 * 1976 * <code>double display_quantity = 2;</code> 1977 * 1978 * @param value The displayQuantity to set. 1979 * @return This builder for chaining. 1980 */ setDisplayQuantity(double value)1981 public Builder setDisplayQuantity(double value) { 1982 1983 displayQuantity_ = value; 1984 bitField0_ |= 0x00000002; 1985 onChanged(); 1986 return this; 1987 } 1988 /** 1989 * 1990 * 1991 * <pre> 1992 * The recommended quantity of units for displaying pricing info. When 1993 * displaying pricing info it is recommended to display: 1994 * (unit_price * display_quantity) per display_quantity usage_unit. 1995 * This field does not affect the pricing formula and is for display purposes 1996 * only. 1997 * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and 1998 * the display_quantity is "1000" then the recommended way of displaying the 1999 * pricing info is "0.10 USD per 1000 GB" 2000 * </pre> 2001 * 2002 * <code>double display_quantity = 2;</code> 2003 * 2004 * @return This builder for chaining. 2005 */ clearDisplayQuantity()2006 public Builder clearDisplayQuantity() { 2007 bitField0_ = (bitField0_ & ~0x00000002); 2008 displayQuantity_ = 0D; 2009 onChanged(); 2010 return this; 2011 } 2012 2013 private java.util.List<com.google.cloud.billing.v1.PricingExpression.TierRate> tieredRates_ = 2014 java.util.Collections.emptyList(); 2015 ensureTieredRatesIsMutable()2016 private void ensureTieredRatesIsMutable() { 2017 if (!((bitField0_ & 0x00000004) != 0)) { 2018 tieredRates_ = 2019 new java.util.ArrayList<com.google.cloud.billing.v1.PricingExpression.TierRate>( 2020 tieredRates_); 2021 bitField0_ |= 0x00000004; 2022 } 2023 } 2024 2025 private com.google.protobuf.RepeatedFieldBuilderV3< 2026 com.google.cloud.billing.v1.PricingExpression.TierRate, 2027 com.google.cloud.billing.v1.PricingExpression.TierRate.Builder, 2028 com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder> 2029 tieredRatesBuilder_; 2030 2031 /** 2032 * 2033 * 2034 * <pre> 2035 * The list of tiered rates for this pricing. The total cost is computed by 2036 * applying each of the tiered rates on usage. This repeated list is sorted 2037 * by ascending order of start_usage_amount. 2038 * </pre> 2039 * 2040 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2041 */ 2042 public java.util.List<com.google.cloud.billing.v1.PricingExpression.TierRate> getTieredRatesList()2043 getTieredRatesList() { 2044 if (tieredRatesBuilder_ == null) { 2045 return java.util.Collections.unmodifiableList(tieredRates_); 2046 } else { 2047 return tieredRatesBuilder_.getMessageList(); 2048 } 2049 } 2050 /** 2051 * 2052 * 2053 * <pre> 2054 * The list of tiered rates for this pricing. The total cost is computed by 2055 * applying each of the tiered rates on usage. This repeated list is sorted 2056 * by ascending order of start_usage_amount. 2057 * </pre> 2058 * 2059 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2060 */ getTieredRatesCount()2061 public int getTieredRatesCount() { 2062 if (tieredRatesBuilder_ == null) { 2063 return tieredRates_.size(); 2064 } else { 2065 return tieredRatesBuilder_.getCount(); 2066 } 2067 } 2068 /** 2069 * 2070 * 2071 * <pre> 2072 * The list of tiered rates for this pricing. The total cost is computed by 2073 * applying each of the tiered rates on usage. This repeated list is sorted 2074 * by ascending order of start_usage_amount. 2075 * </pre> 2076 * 2077 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2078 */ getTieredRates(int index)2079 public com.google.cloud.billing.v1.PricingExpression.TierRate getTieredRates(int index) { 2080 if (tieredRatesBuilder_ == null) { 2081 return tieredRates_.get(index); 2082 } else { 2083 return tieredRatesBuilder_.getMessage(index); 2084 } 2085 } 2086 /** 2087 * 2088 * 2089 * <pre> 2090 * The list of tiered rates for this pricing. The total cost is computed by 2091 * applying each of the tiered rates on usage. This repeated list is sorted 2092 * by ascending order of start_usage_amount. 2093 * </pre> 2094 * 2095 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2096 */ setTieredRates( int index, com.google.cloud.billing.v1.PricingExpression.TierRate value)2097 public Builder setTieredRates( 2098 int index, com.google.cloud.billing.v1.PricingExpression.TierRate value) { 2099 if (tieredRatesBuilder_ == null) { 2100 if (value == null) { 2101 throw new NullPointerException(); 2102 } 2103 ensureTieredRatesIsMutable(); 2104 tieredRates_.set(index, value); 2105 onChanged(); 2106 } else { 2107 tieredRatesBuilder_.setMessage(index, value); 2108 } 2109 return this; 2110 } 2111 /** 2112 * 2113 * 2114 * <pre> 2115 * The list of tiered rates for this pricing. The total cost is computed by 2116 * applying each of the tiered rates on usage. This repeated list is sorted 2117 * by ascending order of start_usage_amount. 2118 * </pre> 2119 * 2120 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2121 */ setTieredRates( int index, com.google.cloud.billing.v1.PricingExpression.TierRate.Builder builderForValue)2122 public Builder setTieredRates( 2123 int index, com.google.cloud.billing.v1.PricingExpression.TierRate.Builder builderForValue) { 2124 if (tieredRatesBuilder_ == null) { 2125 ensureTieredRatesIsMutable(); 2126 tieredRates_.set(index, builderForValue.build()); 2127 onChanged(); 2128 } else { 2129 tieredRatesBuilder_.setMessage(index, builderForValue.build()); 2130 } 2131 return this; 2132 } 2133 /** 2134 * 2135 * 2136 * <pre> 2137 * The list of tiered rates for this pricing. The total cost is computed by 2138 * applying each of the tiered rates on usage. This repeated list is sorted 2139 * by ascending order of start_usage_amount. 2140 * </pre> 2141 * 2142 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2143 */ addTieredRates(com.google.cloud.billing.v1.PricingExpression.TierRate value)2144 public Builder addTieredRates(com.google.cloud.billing.v1.PricingExpression.TierRate value) { 2145 if (tieredRatesBuilder_ == null) { 2146 if (value == null) { 2147 throw new NullPointerException(); 2148 } 2149 ensureTieredRatesIsMutable(); 2150 tieredRates_.add(value); 2151 onChanged(); 2152 } else { 2153 tieredRatesBuilder_.addMessage(value); 2154 } 2155 return this; 2156 } 2157 /** 2158 * 2159 * 2160 * <pre> 2161 * The list of tiered rates for this pricing. The total cost is computed by 2162 * applying each of the tiered rates on usage. This repeated list is sorted 2163 * by ascending order of start_usage_amount. 2164 * </pre> 2165 * 2166 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2167 */ addTieredRates( int index, com.google.cloud.billing.v1.PricingExpression.TierRate value)2168 public Builder addTieredRates( 2169 int index, com.google.cloud.billing.v1.PricingExpression.TierRate value) { 2170 if (tieredRatesBuilder_ == null) { 2171 if (value == null) { 2172 throw new NullPointerException(); 2173 } 2174 ensureTieredRatesIsMutable(); 2175 tieredRates_.add(index, value); 2176 onChanged(); 2177 } else { 2178 tieredRatesBuilder_.addMessage(index, value); 2179 } 2180 return this; 2181 } 2182 /** 2183 * 2184 * 2185 * <pre> 2186 * The list of tiered rates for this pricing. The total cost is computed by 2187 * applying each of the tiered rates on usage. This repeated list is sorted 2188 * by ascending order of start_usage_amount. 2189 * </pre> 2190 * 2191 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2192 */ addTieredRates( com.google.cloud.billing.v1.PricingExpression.TierRate.Builder builderForValue)2193 public Builder addTieredRates( 2194 com.google.cloud.billing.v1.PricingExpression.TierRate.Builder builderForValue) { 2195 if (tieredRatesBuilder_ == null) { 2196 ensureTieredRatesIsMutable(); 2197 tieredRates_.add(builderForValue.build()); 2198 onChanged(); 2199 } else { 2200 tieredRatesBuilder_.addMessage(builderForValue.build()); 2201 } 2202 return this; 2203 } 2204 /** 2205 * 2206 * 2207 * <pre> 2208 * The list of tiered rates for this pricing. The total cost is computed by 2209 * applying each of the tiered rates on usage. This repeated list is sorted 2210 * by ascending order of start_usage_amount. 2211 * </pre> 2212 * 2213 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2214 */ addTieredRates( int index, com.google.cloud.billing.v1.PricingExpression.TierRate.Builder builderForValue)2215 public Builder addTieredRates( 2216 int index, com.google.cloud.billing.v1.PricingExpression.TierRate.Builder builderForValue) { 2217 if (tieredRatesBuilder_ == null) { 2218 ensureTieredRatesIsMutable(); 2219 tieredRates_.add(index, builderForValue.build()); 2220 onChanged(); 2221 } else { 2222 tieredRatesBuilder_.addMessage(index, builderForValue.build()); 2223 } 2224 return this; 2225 } 2226 /** 2227 * 2228 * 2229 * <pre> 2230 * The list of tiered rates for this pricing. The total cost is computed by 2231 * applying each of the tiered rates on usage. This repeated list is sorted 2232 * by ascending order of start_usage_amount. 2233 * </pre> 2234 * 2235 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2236 */ addAllTieredRates( java.lang.Iterable<? extends com.google.cloud.billing.v1.PricingExpression.TierRate> values)2237 public Builder addAllTieredRates( 2238 java.lang.Iterable<? extends com.google.cloud.billing.v1.PricingExpression.TierRate> 2239 values) { 2240 if (tieredRatesBuilder_ == null) { 2241 ensureTieredRatesIsMutable(); 2242 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tieredRates_); 2243 onChanged(); 2244 } else { 2245 tieredRatesBuilder_.addAllMessages(values); 2246 } 2247 return this; 2248 } 2249 /** 2250 * 2251 * 2252 * <pre> 2253 * The list of tiered rates for this pricing. The total cost is computed by 2254 * applying each of the tiered rates on usage. This repeated list is sorted 2255 * by ascending order of start_usage_amount. 2256 * </pre> 2257 * 2258 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2259 */ clearTieredRates()2260 public Builder clearTieredRates() { 2261 if (tieredRatesBuilder_ == null) { 2262 tieredRates_ = java.util.Collections.emptyList(); 2263 bitField0_ = (bitField0_ & ~0x00000004); 2264 onChanged(); 2265 } else { 2266 tieredRatesBuilder_.clear(); 2267 } 2268 return this; 2269 } 2270 /** 2271 * 2272 * 2273 * <pre> 2274 * The list of tiered rates for this pricing. The total cost is computed by 2275 * applying each of the tiered rates on usage. This repeated list is sorted 2276 * by ascending order of start_usage_amount. 2277 * </pre> 2278 * 2279 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2280 */ removeTieredRates(int index)2281 public Builder removeTieredRates(int index) { 2282 if (tieredRatesBuilder_ == null) { 2283 ensureTieredRatesIsMutable(); 2284 tieredRates_.remove(index); 2285 onChanged(); 2286 } else { 2287 tieredRatesBuilder_.remove(index); 2288 } 2289 return this; 2290 } 2291 /** 2292 * 2293 * 2294 * <pre> 2295 * The list of tiered rates for this pricing. The total cost is computed by 2296 * applying each of the tiered rates on usage. This repeated list is sorted 2297 * by ascending order of start_usage_amount. 2298 * </pre> 2299 * 2300 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2301 */ getTieredRatesBuilder( int index)2302 public com.google.cloud.billing.v1.PricingExpression.TierRate.Builder getTieredRatesBuilder( 2303 int index) { 2304 return getTieredRatesFieldBuilder().getBuilder(index); 2305 } 2306 /** 2307 * 2308 * 2309 * <pre> 2310 * The list of tiered rates for this pricing. The total cost is computed by 2311 * applying each of the tiered rates on usage. This repeated list is sorted 2312 * by ascending order of start_usage_amount. 2313 * </pre> 2314 * 2315 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2316 */ getTieredRatesOrBuilder( int index)2317 public com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder getTieredRatesOrBuilder( 2318 int index) { 2319 if (tieredRatesBuilder_ == null) { 2320 return tieredRates_.get(index); 2321 } else { 2322 return tieredRatesBuilder_.getMessageOrBuilder(index); 2323 } 2324 } 2325 /** 2326 * 2327 * 2328 * <pre> 2329 * The list of tiered rates for this pricing. The total cost is computed by 2330 * applying each of the tiered rates on usage. This repeated list is sorted 2331 * by ascending order of start_usage_amount. 2332 * </pre> 2333 * 2334 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2335 */ 2336 public java.util.List<? extends com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder> getTieredRatesOrBuilderList()2337 getTieredRatesOrBuilderList() { 2338 if (tieredRatesBuilder_ != null) { 2339 return tieredRatesBuilder_.getMessageOrBuilderList(); 2340 } else { 2341 return java.util.Collections.unmodifiableList(tieredRates_); 2342 } 2343 } 2344 /** 2345 * 2346 * 2347 * <pre> 2348 * The list of tiered rates for this pricing. The total cost is computed by 2349 * applying each of the tiered rates on usage. This repeated list is sorted 2350 * by ascending order of start_usage_amount. 2351 * </pre> 2352 * 2353 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2354 */ addTieredRatesBuilder()2355 public com.google.cloud.billing.v1.PricingExpression.TierRate.Builder addTieredRatesBuilder() { 2356 return getTieredRatesFieldBuilder() 2357 .addBuilder(com.google.cloud.billing.v1.PricingExpression.TierRate.getDefaultInstance()); 2358 } 2359 /** 2360 * 2361 * 2362 * <pre> 2363 * The list of tiered rates for this pricing. The total cost is computed by 2364 * applying each of the tiered rates on usage. This repeated list is sorted 2365 * by ascending order of start_usage_amount. 2366 * </pre> 2367 * 2368 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2369 */ addTieredRatesBuilder( int index)2370 public com.google.cloud.billing.v1.PricingExpression.TierRate.Builder addTieredRatesBuilder( 2371 int index) { 2372 return getTieredRatesFieldBuilder() 2373 .addBuilder( 2374 index, com.google.cloud.billing.v1.PricingExpression.TierRate.getDefaultInstance()); 2375 } 2376 /** 2377 * 2378 * 2379 * <pre> 2380 * The list of tiered rates for this pricing. The total cost is computed by 2381 * applying each of the tiered rates on usage. This repeated list is sorted 2382 * by ascending order of start_usage_amount. 2383 * </pre> 2384 * 2385 * <code>repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;</code> 2386 */ 2387 public java.util.List<com.google.cloud.billing.v1.PricingExpression.TierRate.Builder> getTieredRatesBuilderList()2388 getTieredRatesBuilderList() { 2389 return getTieredRatesFieldBuilder().getBuilderList(); 2390 } 2391 2392 private com.google.protobuf.RepeatedFieldBuilderV3< 2393 com.google.cloud.billing.v1.PricingExpression.TierRate, 2394 com.google.cloud.billing.v1.PricingExpression.TierRate.Builder, 2395 com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder> getTieredRatesFieldBuilder()2396 getTieredRatesFieldBuilder() { 2397 if (tieredRatesBuilder_ == null) { 2398 tieredRatesBuilder_ = 2399 new com.google.protobuf.RepeatedFieldBuilderV3< 2400 com.google.cloud.billing.v1.PricingExpression.TierRate, 2401 com.google.cloud.billing.v1.PricingExpression.TierRate.Builder, 2402 com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder>( 2403 tieredRates_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); 2404 tieredRates_ = null; 2405 } 2406 return tieredRatesBuilder_; 2407 } 2408 2409 private java.lang.Object usageUnitDescription_ = ""; 2410 /** 2411 * 2412 * 2413 * <pre> 2414 * The unit of usage in human readable form. 2415 * Example: "gibi byte". 2416 * </pre> 2417 * 2418 * <code>string usage_unit_description = 4;</code> 2419 * 2420 * @return The usageUnitDescription. 2421 */ getUsageUnitDescription()2422 public java.lang.String getUsageUnitDescription() { 2423 java.lang.Object ref = usageUnitDescription_; 2424 if (!(ref instanceof java.lang.String)) { 2425 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2426 java.lang.String s = bs.toStringUtf8(); 2427 usageUnitDescription_ = s; 2428 return s; 2429 } else { 2430 return (java.lang.String) ref; 2431 } 2432 } 2433 /** 2434 * 2435 * 2436 * <pre> 2437 * The unit of usage in human readable form. 2438 * Example: "gibi byte". 2439 * </pre> 2440 * 2441 * <code>string usage_unit_description = 4;</code> 2442 * 2443 * @return The bytes for usageUnitDescription. 2444 */ getUsageUnitDescriptionBytes()2445 public com.google.protobuf.ByteString getUsageUnitDescriptionBytes() { 2446 java.lang.Object ref = usageUnitDescription_; 2447 if (ref instanceof String) { 2448 com.google.protobuf.ByteString b = 2449 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2450 usageUnitDescription_ = b; 2451 return b; 2452 } else { 2453 return (com.google.protobuf.ByteString) ref; 2454 } 2455 } 2456 /** 2457 * 2458 * 2459 * <pre> 2460 * The unit of usage in human readable form. 2461 * Example: "gibi byte". 2462 * </pre> 2463 * 2464 * <code>string usage_unit_description = 4;</code> 2465 * 2466 * @param value The usageUnitDescription to set. 2467 * @return This builder for chaining. 2468 */ setUsageUnitDescription(java.lang.String value)2469 public Builder setUsageUnitDescription(java.lang.String value) { 2470 if (value == null) { 2471 throw new NullPointerException(); 2472 } 2473 usageUnitDescription_ = value; 2474 bitField0_ |= 0x00000008; 2475 onChanged(); 2476 return this; 2477 } 2478 /** 2479 * 2480 * 2481 * <pre> 2482 * The unit of usage in human readable form. 2483 * Example: "gibi byte". 2484 * </pre> 2485 * 2486 * <code>string usage_unit_description = 4;</code> 2487 * 2488 * @return This builder for chaining. 2489 */ clearUsageUnitDescription()2490 public Builder clearUsageUnitDescription() { 2491 usageUnitDescription_ = getDefaultInstance().getUsageUnitDescription(); 2492 bitField0_ = (bitField0_ & ~0x00000008); 2493 onChanged(); 2494 return this; 2495 } 2496 /** 2497 * 2498 * 2499 * <pre> 2500 * The unit of usage in human readable form. 2501 * Example: "gibi byte". 2502 * </pre> 2503 * 2504 * <code>string usage_unit_description = 4;</code> 2505 * 2506 * @param value The bytes for usageUnitDescription to set. 2507 * @return This builder for chaining. 2508 */ setUsageUnitDescriptionBytes(com.google.protobuf.ByteString value)2509 public Builder setUsageUnitDescriptionBytes(com.google.protobuf.ByteString value) { 2510 if (value == null) { 2511 throw new NullPointerException(); 2512 } 2513 checkByteStringIsUtf8(value); 2514 usageUnitDescription_ = value; 2515 bitField0_ |= 0x00000008; 2516 onChanged(); 2517 return this; 2518 } 2519 2520 private java.lang.Object baseUnit_ = ""; 2521 /** 2522 * 2523 * 2524 * <pre> 2525 * The base unit for the SKU which is the unit used in usage exports. 2526 * Example: "By" 2527 * </pre> 2528 * 2529 * <code>string base_unit = 5;</code> 2530 * 2531 * @return The baseUnit. 2532 */ getBaseUnit()2533 public java.lang.String getBaseUnit() { 2534 java.lang.Object ref = baseUnit_; 2535 if (!(ref instanceof java.lang.String)) { 2536 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2537 java.lang.String s = bs.toStringUtf8(); 2538 baseUnit_ = s; 2539 return s; 2540 } else { 2541 return (java.lang.String) ref; 2542 } 2543 } 2544 /** 2545 * 2546 * 2547 * <pre> 2548 * The base unit for the SKU which is the unit used in usage exports. 2549 * Example: "By" 2550 * </pre> 2551 * 2552 * <code>string base_unit = 5;</code> 2553 * 2554 * @return The bytes for baseUnit. 2555 */ getBaseUnitBytes()2556 public com.google.protobuf.ByteString getBaseUnitBytes() { 2557 java.lang.Object ref = baseUnit_; 2558 if (ref instanceof String) { 2559 com.google.protobuf.ByteString b = 2560 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2561 baseUnit_ = b; 2562 return b; 2563 } else { 2564 return (com.google.protobuf.ByteString) ref; 2565 } 2566 } 2567 /** 2568 * 2569 * 2570 * <pre> 2571 * The base unit for the SKU which is the unit used in usage exports. 2572 * Example: "By" 2573 * </pre> 2574 * 2575 * <code>string base_unit = 5;</code> 2576 * 2577 * @param value The baseUnit to set. 2578 * @return This builder for chaining. 2579 */ setBaseUnit(java.lang.String value)2580 public Builder setBaseUnit(java.lang.String value) { 2581 if (value == null) { 2582 throw new NullPointerException(); 2583 } 2584 baseUnit_ = value; 2585 bitField0_ |= 0x00000010; 2586 onChanged(); 2587 return this; 2588 } 2589 /** 2590 * 2591 * 2592 * <pre> 2593 * The base unit for the SKU which is the unit used in usage exports. 2594 * Example: "By" 2595 * </pre> 2596 * 2597 * <code>string base_unit = 5;</code> 2598 * 2599 * @return This builder for chaining. 2600 */ clearBaseUnit()2601 public Builder clearBaseUnit() { 2602 baseUnit_ = getDefaultInstance().getBaseUnit(); 2603 bitField0_ = (bitField0_ & ~0x00000010); 2604 onChanged(); 2605 return this; 2606 } 2607 /** 2608 * 2609 * 2610 * <pre> 2611 * The base unit for the SKU which is the unit used in usage exports. 2612 * Example: "By" 2613 * </pre> 2614 * 2615 * <code>string base_unit = 5;</code> 2616 * 2617 * @param value The bytes for baseUnit to set. 2618 * @return This builder for chaining. 2619 */ setBaseUnitBytes(com.google.protobuf.ByteString value)2620 public Builder setBaseUnitBytes(com.google.protobuf.ByteString value) { 2621 if (value == null) { 2622 throw new NullPointerException(); 2623 } 2624 checkByteStringIsUtf8(value); 2625 baseUnit_ = value; 2626 bitField0_ |= 0x00000010; 2627 onChanged(); 2628 return this; 2629 } 2630 2631 private java.lang.Object baseUnitDescription_ = ""; 2632 /** 2633 * 2634 * 2635 * <pre> 2636 * The base unit in human readable form. 2637 * Example: "byte". 2638 * </pre> 2639 * 2640 * <code>string base_unit_description = 6;</code> 2641 * 2642 * @return The baseUnitDescription. 2643 */ getBaseUnitDescription()2644 public java.lang.String getBaseUnitDescription() { 2645 java.lang.Object ref = baseUnitDescription_; 2646 if (!(ref instanceof java.lang.String)) { 2647 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2648 java.lang.String s = bs.toStringUtf8(); 2649 baseUnitDescription_ = s; 2650 return s; 2651 } else { 2652 return (java.lang.String) ref; 2653 } 2654 } 2655 /** 2656 * 2657 * 2658 * <pre> 2659 * The base unit in human readable form. 2660 * Example: "byte". 2661 * </pre> 2662 * 2663 * <code>string base_unit_description = 6;</code> 2664 * 2665 * @return The bytes for baseUnitDescription. 2666 */ getBaseUnitDescriptionBytes()2667 public com.google.protobuf.ByteString getBaseUnitDescriptionBytes() { 2668 java.lang.Object ref = baseUnitDescription_; 2669 if (ref instanceof String) { 2670 com.google.protobuf.ByteString b = 2671 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2672 baseUnitDescription_ = b; 2673 return b; 2674 } else { 2675 return (com.google.protobuf.ByteString) ref; 2676 } 2677 } 2678 /** 2679 * 2680 * 2681 * <pre> 2682 * The base unit in human readable form. 2683 * Example: "byte". 2684 * </pre> 2685 * 2686 * <code>string base_unit_description = 6;</code> 2687 * 2688 * @param value The baseUnitDescription to set. 2689 * @return This builder for chaining. 2690 */ setBaseUnitDescription(java.lang.String value)2691 public Builder setBaseUnitDescription(java.lang.String value) { 2692 if (value == null) { 2693 throw new NullPointerException(); 2694 } 2695 baseUnitDescription_ = value; 2696 bitField0_ |= 0x00000020; 2697 onChanged(); 2698 return this; 2699 } 2700 /** 2701 * 2702 * 2703 * <pre> 2704 * The base unit in human readable form. 2705 * Example: "byte". 2706 * </pre> 2707 * 2708 * <code>string base_unit_description = 6;</code> 2709 * 2710 * @return This builder for chaining. 2711 */ clearBaseUnitDescription()2712 public Builder clearBaseUnitDescription() { 2713 baseUnitDescription_ = getDefaultInstance().getBaseUnitDescription(); 2714 bitField0_ = (bitField0_ & ~0x00000020); 2715 onChanged(); 2716 return this; 2717 } 2718 /** 2719 * 2720 * 2721 * <pre> 2722 * The base unit in human readable form. 2723 * Example: "byte". 2724 * </pre> 2725 * 2726 * <code>string base_unit_description = 6;</code> 2727 * 2728 * @param value The bytes for baseUnitDescription to set. 2729 * @return This builder for chaining. 2730 */ setBaseUnitDescriptionBytes(com.google.protobuf.ByteString value)2731 public Builder setBaseUnitDescriptionBytes(com.google.protobuf.ByteString value) { 2732 if (value == null) { 2733 throw new NullPointerException(); 2734 } 2735 checkByteStringIsUtf8(value); 2736 baseUnitDescription_ = value; 2737 bitField0_ |= 0x00000020; 2738 onChanged(); 2739 return this; 2740 } 2741 2742 private double baseUnitConversionFactor_; 2743 /** 2744 * 2745 * 2746 * <pre> 2747 * Conversion factor for converting from price per usage_unit to price per 2748 * base_unit, and start_usage_amount to start_usage_amount in base_unit. 2749 * unit_price / base_unit_conversion_factor = price per base_unit. 2750 * start_usage_amount * base_unit_conversion_factor = start_usage_amount in 2751 * base_unit. 2752 * </pre> 2753 * 2754 * <code>double base_unit_conversion_factor = 7;</code> 2755 * 2756 * @return The baseUnitConversionFactor. 2757 */ 2758 @java.lang.Override getBaseUnitConversionFactor()2759 public double getBaseUnitConversionFactor() { 2760 return baseUnitConversionFactor_; 2761 } 2762 /** 2763 * 2764 * 2765 * <pre> 2766 * Conversion factor for converting from price per usage_unit to price per 2767 * base_unit, and start_usage_amount to start_usage_amount in base_unit. 2768 * unit_price / base_unit_conversion_factor = price per base_unit. 2769 * start_usage_amount * base_unit_conversion_factor = start_usage_amount in 2770 * base_unit. 2771 * </pre> 2772 * 2773 * <code>double base_unit_conversion_factor = 7;</code> 2774 * 2775 * @param value The baseUnitConversionFactor to set. 2776 * @return This builder for chaining. 2777 */ setBaseUnitConversionFactor(double value)2778 public Builder setBaseUnitConversionFactor(double value) { 2779 2780 baseUnitConversionFactor_ = value; 2781 bitField0_ |= 0x00000040; 2782 onChanged(); 2783 return this; 2784 } 2785 /** 2786 * 2787 * 2788 * <pre> 2789 * Conversion factor for converting from price per usage_unit to price per 2790 * base_unit, and start_usage_amount to start_usage_amount in base_unit. 2791 * unit_price / base_unit_conversion_factor = price per base_unit. 2792 * start_usage_amount * base_unit_conversion_factor = start_usage_amount in 2793 * base_unit. 2794 * </pre> 2795 * 2796 * <code>double base_unit_conversion_factor = 7;</code> 2797 * 2798 * @return This builder for chaining. 2799 */ clearBaseUnitConversionFactor()2800 public Builder clearBaseUnitConversionFactor() { 2801 bitField0_ = (bitField0_ & ~0x00000040); 2802 baseUnitConversionFactor_ = 0D; 2803 onChanged(); 2804 return this; 2805 } 2806 2807 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2808 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2809 return super.setUnknownFields(unknownFields); 2810 } 2811 2812 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2813 public final Builder mergeUnknownFields( 2814 final com.google.protobuf.UnknownFieldSet unknownFields) { 2815 return super.mergeUnknownFields(unknownFields); 2816 } 2817 2818 // @@protoc_insertion_point(builder_scope:google.cloud.billing.v1.PricingExpression) 2819 } 2820 2821 // @@protoc_insertion_point(class_scope:google.cloud.billing.v1.PricingExpression) 2822 private static final com.google.cloud.billing.v1.PricingExpression DEFAULT_INSTANCE; 2823 2824 static { 2825 DEFAULT_INSTANCE = new com.google.cloud.billing.v1.PricingExpression(); 2826 } 2827 getDefaultInstance()2828 public static com.google.cloud.billing.v1.PricingExpression getDefaultInstance() { 2829 return DEFAULT_INSTANCE; 2830 } 2831 2832 private static final com.google.protobuf.Parser<PricingExpression> PARSER = 2833 new com.google.protobuf.AbstractParser<PricingExpression>() { 2834 @java.lang.Override 2835 public PricingExpression parsePartialFrom( 2836 com.google.protobuf.CodedInputStream input, 2837 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2838 throws com.google.protobuf.InvalidProtocolBufferException { 2839 Builder builder = newBuilder(); 2840 try { 2841 builder.mergeFrom(input, extensionRegistry); 2842 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2843 throw e.setUnfinishedMessage(builder.buildPartial()); 2844 } catch (com.google.protobuf.UninitializedMessageException e) { 2845 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2846 } catch (java.io.IOException e) { 2847 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2848 .setUnfinishedMessage(builder.buildPartial()); 2849 } 2850 return builder.buildPartial(); 2851 } 2852 }; 2853 parser()2854 public static com.google.protobuf.Parser<PricingExpression> parser() { 2855 return PARSER; 2856 } 2857 2858 @java.lang.Override getParserForType()2859 public com.google.protobuf.Parser<PricingExpression> getParserForType() { 2860 return PARSER; 2861 } 2862 2863 @java.lang.Override getDefaultInstanceForType()2864 public com.google.cloud.billing.v1.PricingExpression getDefaultInstanceForType() { 2865 return DEFAULT_INSTANCE; 2866 } 2867 } 2868