• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  * Represents the pricing information for a SKU at a single point of time.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.billing.v1.PricingInfo}
29  */
30 public final class PricingInfo extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.billing.v1.PricingInfo)
33     PricingInfoOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use PricingInfo.newBuilder() to construct.
PricingInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private PricingInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
PricingInfo()40   private PricingInfo() {
41     summary_ = "";
42   }
43 
44   @java.lang.Override
45   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)46   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
47     return new PricingInfo();
48   }
49 
50   @java.lang.Override
getUnknownFields()51   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
52     return this.unknownFields;
53   }
54 
getDescriptor()55   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
56     return com.google.cloud.billing.v1.CloudCatalogProto
57         .internal_static_google_cloud_billing_v1_PricingInfo_descriptor;
58   }
59 
60   @java.lang.Override
61   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()62       internalGetFieldAccessorTable() {
63     return com.google.cloud.billing.v1.CloudCatalogProto
64         .internal_static_google_cloud_billing_v1_PricingInfo_fieldAccessorTable
65         .ensureFieldAccessorsInitialized(
66             com.google.cloud.billing.v1.PricingInfo.class,
67             com.google.cloud.billing.v1.PricingInfo.Builder.class);
68   }
69 
70   public static final int EFFECTIVE_TIME_FIELD_NUMBER = 1;
71   private com.google.protobuf.Timestamp effectiveTime_;
72   /**
73    *
74    *
75    * <pre>
76    * The timestamp from which this pricing was effective within the requested
77    * time range. This is guaranteed to be greater than or equal to the
78    * start_time field in the request and less than the end_time field in the
79    * request. If a time range was not specified in the request this field will
80    * be equivalent to a time within the last 12 hours, indicating the latest
81    * pricing info.
82    * </pre>
83    *
84    * <code>.google.protobuf.Timestamp effective_time = 1;</code>
85    *
86    * @return Whether the effectiveTime field is set.
87    */
88   @java.lang.Override
hasEffectiveTime()89   public boolean hasEffectiveTime() {
90     return effectiveTime_ != null;
91   }
92   /**
93    *
94    *
95    * <pre>
96    * The timestamp from which this pricing was effective within the requested
97    * time range. This is guaranteed to be greater than or equal to the
98    * start_time field in the request and less than the end_time field in the
99    * request. If a time range was not specified in the request this field will
100    * be equivalent to a time within the last 12 hours, indicating the latest
101    * pricing info.
102    * </pre>
103    *
104    * <code>.google.protobuf.Timestamp effective_time = 1;</code>
105    *
106    * @return The effectiveTime.
107    */
108   @java.lang.Override
getEffectiveTime()109   public com.google.protobuf.Timestamp getEffectiveTime() {
110     return effectiveTime_ == null
111         ? com.google.protobuf.Timestamp.getDefaultInstance()
112         : effectiveTime_;
113   }
114   /**
115    *
116    *
117    * <pre>
118    * The timestamp from which this pricing was effective within the requested
119    * time range. This is guaranteed to be greater than or equal to the
120    * start_time field in the request and less than the end_time field in the
121    * request. If a time range was not specified in the request this field will
122    * be equivalent to a time within the last 12 hours, indicating the latest
123    * pricing info.
124    * </pre>
125    *
126    * <code>.google.protobuf.Timestamp effective_time = 1;</code>
127    */
128   @java.lang.Override
getEffectiveTimeOrBuilder()129   public com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder() {
130     return effectiveTime_ == null
131         ? com.google.protobuf.Timestamp.getDefaultInstance()
132         : effectiveTime_;
133   }
134 
135   public static final int SUMMARY_FIELD_NUMBER = 2;
136 
137   @SuppressWarnings("serial")
138   private volatile java.lang.Object summary_ = "";
139   /**
140    *
141    *
142    * <pre>
143    * An optional human readable summary of the pricing information, has a
144    * maximum length of 256 characters.
145    * </pre>
146    *
147    * <code>string summary = 2;</code>
148    *
149    * @return The summary.
150    */
151   @java.lang.Override
getSummary()152   public java.lang.String getSummary() {
153     java.lang.Object ref = summary_;
154     if (ref instanceof java.lang.String) {
155       return (java.lang.String) ref;
156     } else {
157       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
158       java.lang.String s = bs.toStringUtf8();
159       summary_ = s;
160       return s;
161     }
162   }
163   /**
164    *
165    *
166    * <pre>
167    * An optional human readable summary of the pricing information, has a
168    * maximum length of 256 characters.
169    * </pre>
170    *
171    * <code>string summary = 2;</code>
172    *
173    * @return The bytes for summary.
174    */
175   @java.lang.Override
getSummaryBytes()176   public com.google.protobuf.ByteString getSummaryBytes() {
177     java.lang.Object ref = summary_;
178     if (ref instanceof java.lang.String) {
179       com.google.protobuf.ByteString b =
180           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
181       summary_ = b;
182       return b;
183     } else {
184       return (com.google.protobuf.ByteString) ref;
185     }
186   }
187 
188   public static final int PRICING_EXPRESSION_FIELD_NUMBER = 3;
189   private com.google.cloud.billing.v1.PricingExpression pricingExpression_;
190   /**
191    *
192    *
193    * <pre>
194    * Expresses the pricing formula. See `PricingExpression` for an example.
195    * </pre>
196    *
197    * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
198    *
199    * @return Whether the pricingExpression field is set.
200    */
201   @java.lang.Override
hasPricingExpression()202   public boolean hasPricingExpression() {
203     return pricingExpression_ != null;
204   }
205   /**
206    *
207    *
208    * <pre>
209    * Expresses the pricing formula. See `PricingExpression` for an example.
210    * </pre>
211    *
212    * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
213    *
214    * @return The pricingExpression.
215    */
216   @java.lang.Override
getPricingExpression()217   public com.google.cloud.billing.v1.PricingExpression getPricingExpression() {
218     return pricingExpression_ == null
219         ? com.google.cloud.billing.v1.PricingExpression.getDefaultInstance()
220         : pricingExpression_;
221   }
222   /**
223    *
224    *
225    * <pre>
226    * Expresses the pricing formula. See `PricingExpression` for an example.
227    * </pre>
228    *
229    * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
230    */
231   @java.lang.Override
getPricingExpressionOrBuilder()232   public com.google.cloud.billing.v1.PricingExpressionOrBuilder getPricingExpressionOrBuilder() {
233     return pricingExpression_ == null
234         ? com.google.cloud.billing.v1.PricingExpression.getDefaultInstance()
235         : pricingExpression_;
236   }
237 
238   public static final int AGGREGATION_INFO_FIELD_NUMBER = 4;
239   private com.google.cloud.billing.v1.AggregationInfo aggregationInfo_;
240   /**
241    *
242    *
243    * <pre>
244    * Aggregation Info. This can be left unspecified if the pricing expression
245    * doesn't require aggregation.
246    * </pre>
247    *
248    * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
249    *
250    * @return Whether the aggregationInfo field is set.
251    */
252   @java.lang.Override
hasAggregationInfo()253   public boolean hasAggregationInfo() {
254     return aggregationInfo_ != null;
255   }
256   /**
257    *
258    *
259    * <pre>
260    * Aggregation Info. This can be left unspecified if the pricing expression
261    * doesn't require aggregation.
262    * </pre>
263    *
264    * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
265    *
266    * @return The aggregationInfo.
267    */
268   @java.lang.Override
getAggregationInfo()269   public com.google.cloud.billing.v1.AggregationInfo getAggregationInfo() {
270     return aggregationInfo_ == null
271         ? com.google.cloud.billing.v1.AggregationInfo.getDefaultInstance()
272         : aggregationInfo_;
273   }
274   /**
275    *
276    *
277    * <pre>
278    * Aggregation Info. This can be left unspecified if the pricing expression
279    * doesn't require aggregation.
280    * </pre>
281    *
282    * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
283    */
284   @java.lang.Override
getAggregationInfoOrBuilder()285   public com.google.cloud.billing.v1.AggregationInfoOrBuilder getAggregationInfoOrBuilder() {
286     return aggregationInfo_ == null
287         ? com.google.cloud.billing.v1.AggregationInfo.getDefaultInstance()
288         : aggregationInfo_;
289   }
290 
291   public static final int CURRENCY_CONVERSION_RATE_FIELD_NUMBER = 5;
292   private double currencyConversionRate_ = 0D;
293   /**
294    *
295    *
296    * <pre>
297    * Conversion rate used for currency conversion, from USD to the currency
298    * specified in the request. This includes any surcharge collected for billing
299    * in non USD currency. If a currency is not specified in the request this
300    * defaults to 1.0.
301    * Example: USD * currency_conversion_rate = JPY
302    * </pre>
303    *
304    * <code>double currency_conversion_rate = 5;</code>
305    *
306    * @return The currencyConversionRate.
307    */
308   @java.lang.Override
getCurrencyConversionRate()309   public double getCurrencyConversionRate() {
310     return currencyConversionRate_;
311   }
312 
313   private byte memoizedIsInitialized = -1;
314 
315   @java.lang.Override
isInitialized()316   public final boolean isInitialized() {
317     byte isInitialized = memoizedIsInitialized;
318     if (isInitialized == 1) return true;
319     if (isInitialized == 0) return false;
320 
321     memoizedIsInitialized = 1;
322     return true;
323   }
324 
325   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)326   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
327     if (effectiveTime_ != null) {
328       output.writeMessage(1, getEffectiveTime());
329     }
330     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summary_)) {
331       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, summary_);
332     }
333     if (pricingExpression_ != null) {
334       output.writeMessage(3, getPricingExpression());
335     }
336     if (aggregationInfo_ != null) {
337       output.writeMessage(4, getAggregationInfo());
338     }
339     if (java.lang.Double.doubleToRawLongBits(currencyConversionRate_) != 0) {
340       output.writeDouble(5, currencyConversionRate_);
341     }
342     getUnknownFields().writeTo(output);
343   }
344 
345   @java.lang.Override
getSerializedSize()346   public int getSerializedSize() {
347     int size = memoizedSize;
348     if (size != -1) return size;
349 
350     size = 0;
351     if (effectiveTime_ != null) {
352       size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEffectiveTime());
353     }
354     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summary_)) {
355       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, summary_);
356     }
357     if (pricingExpression_ != null) {
358       size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPricingExpression());
359     }
360     if (aggregationInfo_ != null) {
361       size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAggregationInfo());
362     }
363     if (java.lang.Double.doubleToRawLongBits(currencyConversionRate_) != 0) {
364       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, currencyConversionRate_);
365     }
366     size += getUnknownFields().getSerializedSize();
367     memoizedSize = size;
368     return size;
369   }
370 
371   @java.lang.Override
equals(final java.lang.Object obj)372   public boolean equals(final java.lang.Object obj) {
373     if (obj == this) {
374       return true;
375     }
376     if (!(obj instanceof com.google.cloud.billing.v1.PricingInfo)) {
377       return super.equals(obj);
378     }
379     com.google.cloud.billing.v1.PricingInfo other = (com.google.cloud.billing.v1.PricingInfo) obj;
380 
381     if (hasEffectiveTime() != other.hasEffectiveTime()) return false;
382     if (hasEffectiveTime()) {
383       if (!getEffectiveTime().equals(other.getEffectiveTime())) return false;
384     }
385     if (!getSummary().equals(other.getSummary())) return false;
386     if (hasPricingExpression() != other.hasPricingExpression()) return false;
387     if (hasPricingExpression()) {
388       if (!getPricingExpression().equals(other.getPricingExpression())) return false;
389     }
390     if (hasAggregationInfo() != other.hasAggregationInfo()) return false;
391     if (hasAggregationInfo()) {
392       if (!getAggregationInfo().equals(other.getAggregationInfo())) return false;
393     }
394     if (java.lang.Double.doubleToLongBits(getCurrencyConversionRate())
395         != java.lang.Double.doubleToLongBits(other.getCurrencyConversionRate())) return false;
396     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
397     return true;
398   }
399 
400   @java.lang.Override
hashCode()401   public int hashCode() {
402     if (memoizedHashCode != 0) {
403       return memoizedHashCode;
404     }
405     int hash = 41;
406     hash = (19 * hash) + getDescriptor().hashCode();
407     if (hasEffectiveTime()) {
408       hash = (37 * hash) + EFFECTIVE_TIME_FIELD_NUMBER;
409       hash = (53 * hash) + getEffectiveTime().hashCode();
410     }
411     hash = (37 * hash) + SUMMARY_FIELD_NUMBER;
412     hash = (53 * hash) + getSummary().hashCode();
413     if (hasPricingExpression()) {
414       hash = (37 * hash) + PRICING_EXPRESSION_FIELD_NUMBER;
415       hash = (53 * hash) + getPricingExpression().hashCode();
416     }
417     if (hasAggregationInfo()) {
418       hash = (37 * hash) + AGGREGATION_INFO_FIELD_NUMBER;
419       hash = (53 * hash) + getAggregationInfo().hashCode();
420     }
421     hash = (37 * hash) + CURRENCY_CONVERSION_RATE_FIELD_NUMBER;
422     hash =
423         (53 * hash)
424             + com.google.protobuf.Internal.hashLong(
425                 java.lang.Double.doubleToLongBits(getCurrencyConversionRate()));
426     hash = (29 * hash) + getUnknownFields().hashCode();
427     memoizedHashCode = hash;
428     return hash;
429   }
430 
parseFrom(java.nio.ByteBuffer data)431   public static com.google.cloud.billing.v1.PricingInfo parseFrom(java.nio.ByteBuffer data)
432       throws com.google.protobuf.InvalidProtocolBufferException {
433     return PARSER.parseFrom(data);
434   }
435 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)436   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
437       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
438       throws com.google.protobuf.InvalidProtocolBufferException {
439     return PARSER.parseFrom(data, extensionRegistry);
440   }
441 
parseFrom( com.google.protobuf.ByteString data)442   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
443       com.google.protobuf.ByteString data)
444       throws com.google.protobuf.InvalidProtocolBufferException {
445     return PARSER.parseFrom(data);
446   }
447 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)448   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
449       com.google.protobuf.ByteString data,
450       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
451       throws com.google.protobuf.InvalidProtocolBufferException {
452     return PARSER.parseFrom(data, extensionRegistry);
453   }
454 
parseFrom(byte[] data)455   public static com.google.cloud.billing.v1.PricingInfo parseFrom(byte[] data)
456       throws com.google.protobuf.InvalidProtocolBufferException {
457     return PARSER.parseFrom(data);
458   }
459 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)460   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
461       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
462       throws com.google.protobuf.InvalidProtocolBufferException {
463     return PARSER.parseFrom(data, extensionRegistry);
464   }
465 
parseFrom(java.io.InputStream input)466   public static com.google.cloud.billing.v1.PricingInfo parseFrom(java.io.InputStream input)
467       throws java.io.IOException {
468     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
469   }
470 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)471   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
472       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
473       throws java.io.IOException {
474     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
475         PARSER, input, extensionRegistry);
476   }
477 
parseDelimitedFrom( java.io.InputStream input)478   public static com.google.cloud.billing.v1.PricingInfo parseDelimitedFrom(
479       java.io.InputStream input) throws java.io.IOException {
480     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
481   }
482 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)483   public static com.google.cloud.billing.v1.PricingInfo parseDelimitedFrom(
484       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
485       throws java.io.IOException {
486     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
487         PARSER, input, extensionRegistry);
488   }
489 
parseFrom( com.google.protobuf.CodedInputStream input)490   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
491       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
492     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
493   }
494 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)495   public static com.google.cloud.billing.v1.PricingInfo parseFrom(
496       com.google.protobuf.CodedInputStream input,
497       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
498       throws java.io.IOException {
499     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
500         PARSER, input, extensionRegistry);
501   }
502 
503   @java.lang.Override
newBuilderForType()504   public Builder newBuilderForType() {
505     return newBuilder();
506   }
507 
newBuilder()508   public static Builder newBuilder() {
509     return DEFAULT_INSTANCE.toBuilder();
510   }
511 
newBuilder(com.google.cloud.billing.v1.PricingInfo prototype)512   public static Builder newBuilder(com.google.cloud.billing.v1.PricingInfo prototype) {
513     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
514   }
515 
516   @java.lang.Override
toBuilder()517   public Builder toBuilder() {
518     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
519   }
520 
521   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)522   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
523     Builder builder = new Builder(parent);
524     return builder;
525   }
526   /**
527    *
528    *
529    * <pre>
530    * Represents the pricing information for a SKU at a single point of time.
531    * </pre>
532    *
533    * Protobuf type {@code google.cloud.billing.v1.PricingInfo}
534    */
535   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
536       implements
537       // @@protoc_insertion_point(builder_implements:google.cloud.billing.v1.PricingInfo)
538       com.google.cloud.billing.v1.PricingInfoOrBuilder {
getDescriptor()539     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
540       return com.google.cloud.billing.v1.CloudCatalogProto
541           .internal_static_google_cloud_billing_v1_PricingInfo_descriptor;
542     }
543 
544     @java.lang.Override
545     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()546         internalGetFieldAccessorTable() {
547       return com.google.cloud.billing.v1.CloudCatalogProto
548           .internal_static_google_cloud_billing_v1_PricingInfo_fieldAccessorTable
549           .ensureFieldAccessorsInitialized(
550               com.google.cloud.billing.v1.PricingInfo.class,
551               com.google.cloud.billing.v1.PricingInfo.Builder.class);
552     }
553 
554     // Construct using com.google.cloud.billing.v1.PricingInfo.newBuilder()
Builder()555     private Builder() {}
556 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)557     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
558       super(parent);
559     }
560 
561     @java.lang.Override
clear()562     public Builder clear() {
563       super.clear();
564       bitField0_ = 0;
565       effectiveTime_ = null;
566       if (effectiveTimeBuilder_ != null) {
567         effectiveTimeBuilder_.dispose();
568         effectiveTimeBuilder_ = null;
569       }
570       summary_ = "";
571       pricingExpression_ = null;
572       if (pricingExpressionBuilder_ != null) {
573         pricingExpressionBuilder_.dispose();
574         pricingExpressionBuilder_ = null;
575       }
576       aggregationInfo_ = null;
577       if (aggregationInfoBuilder_ != null) {
578         aggregationInfoBuilder_.dispose();
579         aggregationInfoBuilder_ = null;
580       }
581       currencyConversionRate_ = 0D;
582       return this;
583     }
584 
585     @java.lang.Override
getDescriptorForType()586     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
587       return com.google.cloud.billing.v1.CloudCatalogProto
588           .internal_static_google_cloud_billing_v1_PricingInfo_descriptor;
589     }
590 
591     @java.lang.Override
getDefaultInstanceForType()592     public com.google.cloud.billing.v1.PricingInfo getDefaultInstanceForType() {
593       return com.google.cloud.billing.v1.PricingInfo.getDefaultInstance();
594     }
595 
596     @java.lang.Override
build()597     public com.google.cloud.billing.v1.PricingInfo build() {
598       com.google.cloud.billing.v1.PricingInfo result = buildPartial();
599       if (!result.isInitialized()) {
600         throw newUninitializedMessageException(result);
601       }
602       return result;
603     }
604 
605     @java.lang.Override
buildPartial()606     public com.google.cloud.billing.v1.PricingInfo buildPartial() {
607       com.google.cloud.billing.v1.PricingInfo result =
608           new com.google.cloud.billing.v1.PricingInfo(this);
609       if (bitField0_ != 0) {
610         buildPartial0(result);
611       }
612       onBuilt();
613       return result;
614     }
615 
buildPartial0(com.google.cloud.billing.v1.PricingInfo result)616     private void buildPartial0(com.google.cloud.billing.v1.PricingInfo result) {
617       int from_bitField0_ = bitField0_;
618       if (((from_bitField0_ & 0x00000001) != 0)) {
619         result.effectiveTime_ =
620             effectiveTimeBuilder_ == null ? effectiveTime_ : effectiveTimeBuilder_.build();
621       }
622       if (((from_bitField0_ & 0x00000002) != 0)) {
623         result.summary_ = summary_;
624       }
625       if (((from_bitField0_ & 0x00000004) != 0)) {
626         result.pricingExpression_ =
627             pricingExpressionBuilder_ == null
628                 ? pricingExpression_
629                 : pricingExpressionBuilder_.build();
630       }
631       if (((from_bitField0_ & 0x00000008) != 0)) {
632         result.aggregationInfo_ =
633             aggregationInfoBuilder_ == null ? aggregationInfo_ : aggregationInfoBuilder_.build();
634       }
635       if (((from_bitField0_ & 0x00000010) != 0)) {
636         result.currencyConversionRate_ = currencyConversionRate_;
637       }
638     }
639 
640     @java.lang.Override
clone()641     public Builder clone() {
642       return super.clone();
643     }
644 
645     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)646     public Builder setField(
647         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
648       return super.setField(field, value);
649     }
650 
651     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)652     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
653       return super.clearField(field);
654     }
655 
656     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)657     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
658       return super.clearOneof(oneof);
659     }
660 
661     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)662     public Builder setRepeatedField(
663         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
664       return super.setRepeatedField(field, index, value);
665     }
666 
667     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)668     public Builder addRepeatedField(
669         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
670       return super.addRepeatedField(field, value);
671     }
672 
673     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)674     public Builder mergeFrom(com.google.protobuf.Message other) {
675       if (other instanceof com.google.cloud.billing.v1.PricingInfo) {
676         return mergeFrom((com.google.cloud.billing.v1.PricingInfo) other);
677       } else {
678         super.mergeFrom(other);
679         return this;
680       }
681     }
682 
mergeFrom(com.google.cloud.billing.v1.PricingInfo other)683     public Builder mergeFrom(com.google.cloud.billing.v1.PricingInfo other) {
684       if (other == com.google.cloud.billing.v1.PricingInfo.getDefaultInstance()) return this;
685       if (other.hasEffectiveTime()) {
686         mergeEffectiveTime(other.getEffectiveTime());
687       }
688       if (!other.getSummary().isEmpty()) {
689         summary_ = other.summary_;
690         bitField0_ |= 0x00000002;
691         onChanged();
692       }
693       if (other.hasPricingExpression()) {
694         mergePricingExpression(other.getPricingExpression());
695       }
696       if (other.hasAggregationInfo()) {
697         mergeAggregationInfo(other.getAggregationInfo());
698       }
699       if (other.getCurrencyConversionRate() != 0D) {
700         setCurrencyConversionRate(other.getCurrencyConversionRate());
701       }
702       this.mergeUnknownFields(other.getUnknownFields());
703       onChanged();
704       return this;
705     }
706 
707     @java.lang.Override
isInitialized()708     public final boolean isInitialized() {
709       return true;
710     }
711 
712     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)713     public Builder mergeFrom(
714         com.google.protobuf.CodedInputStream input,
715         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
716         throws java.io.IOException {
717       if (extensionRegistry == null) {
718         throw new java.lang.NullPointerException();
719       }
720       try {
721         boolean done = false;
722         while (!done) {
723           int tag = input.readTag();
724           switch (tag) {
725             case 0:
726               done = true;
727               break;
728             case 10:
729               {
730                 input.readMessage(getEffectiveTimeFieldBuilder().getBuilder(), extensionRegistry);
731                 bitField0_ |= 0x00000001;
732                 break;
733               } // case 10
734             case 18:
735               {
736                 summary_ = input.readStringRequireUtf8();
737                 bitField0_ |= 0x00000002;
738                 break;
739               } // case 18
740             case 26:
741               {
742                 input.readMessage(
743                     getPricingExpressionFieldBuilder().getBuilder(), extensionRegistry);
744                 bitField0_ |= 0x00000004;
745                 break;
746               } // case 26
747             case 34:
748               {
749                 input.readMessage(getAggregationInfoFieldBuilder().getBuilder(), extensionRegistry);
750                 bitField0_ |= 0x00000008;
751                 break;
752               } // case 34
753             case 41:
754               {
755                 currencyConversionRate_ = input.readDouble();
756                 bitField0_ |= 0x00000010;
757                 break;
758               } // case 41
759             default:
760               {
761                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
762                   done = true; // was an endgroup tag
763                 }
764                 break;
765               } // default:
766           } // switch (tag)
767         } // while (!done)
768       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
769         throw e.unwrapIOException();
770       } finally {
771         onChanged();
772       } // finally
773       return this;
774     }
775 
776     private int bitField0_;
777 
778     private com.google.protobuf.Timestamp effectiveTime_;
779     private com.google.protobuf.SingleFieldBuilderV3<
780             com.google.protobuf.Timestamp,
781             com.google.protobuf.Timestamp.Builder,
782             com.google.protobuf.TimestampOrBuilder>
783         effectiveTimeBuilder_;
784     /**
785      *
786      *
787      * <pre>
788      * The timestamp from which this pricing was effective within the requested
789      * time range. This is guaranteed to be greater than or equal to the
790      * start_time field in the request and less than the end_time field in the
791      * request. If a time range was not specified in the request this field will
792      * be equivalent to a time within the last 12 hours, indicating the latest
793      * pricing info.
794      * </pre>
795      *
796      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
797      *
798      * @return Whether the effectiveTime field is set.
799      */
hasEffectiveTime()800     public boolean hasEffectiveTime() {
801       return ((bitField0_ & 0x00000001) != 0);
802     }
803     /**
804      *
805      *
806      * <pre>
807      * The timestamp from which this pricing was effective within the requested
808      * time range. This is guaranteed to be greater than or equal to the
809      * start_time field in the request and less than the end_time field in the
810      * request. If a time range was not specified in the request this field will
811      * be equivalent to a time within the last 12 hours, indicating the latest
812      * pricing info.
813      * </pre>
814      *
815      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
816      *
817      * @return The effectiveTime.
818      */
getEffectiveTime()819     public com.google.protobuf.Timestamp getEffectiveTime() {
820       if (effectiveTimeBuilder_ == null) {
821         return effectiveTime_ == null
822             ? com.google.protobuf.Timestamp.getDefaultInstance()
823             : effectiveTime_;
824       } else {
825         return effectiveTimeBuilder_.getMessage();
826       }
827     }
828     /**
829      *
830      *
831      * <pre>
832      * The timestamp from which this pricing was effective within the requested
833      * time range. This is guaranteed to be greater than or equal to the
834      * start_time field in the request and less than the end_time field in the
835      * request. If a time range was not specified in the request this field will
836      * be equivalent to a time within the last 12 hours, indicating the latest
837      * pricing info.
838      * </pre>
839      *
840      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
841      */
setEffectiveTime(com.google.protobuf.Timestamp value)842     public Builder setEffectiveTime(com.google.protobuf.Timestamp value) {
843       if (effectiveTimeBuilder_ == null) {
844         if (value == null) {
845           throw new NullPointerException();
846         }
847         effectiveTime_ = value;
848       } else {
849         effectiveTimeBuilder_.setMessage(value);
850       }
851       bitField0_ |= 0x00000001;
852       onChanged();
853       return this;
854     }
855     /**
856      *
857      *
858      * <pre>
859      * The timestamp from which this pricing was effective within the requested
860      * time range. This is guaranteed to be greater than or equal to the
861      * start_time field in the request and less than the end_time field in the
862      * request. If a time range was not specified in the request this field will
863      * be equivalent to a time within the last 12 hours, indicating the latest
864      * pricing info.
865      * </pre>
866      *
867      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
868      */
setEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue)869     public Builder setEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue) {
870       if (effectiveTimeBuilder_ == null) {
871         effectiveTime_ = builderForValue.build();
872       } else {
873         effectiveTimeBuilder_.setMessage(builderForValue.build());
874       }
875       bitField0_ |= 0x00000001;
876       onChanged();
877       return this;
878     }
879     /**
880      *
881      *
882      * <pre>
883      * The timestamp from which this pricing was effective within the requested
884      * time range. This is guaranteed to be greater than or equal to the
885      * start_time field in the request and less than the end_time field in the
886      * request. If a time range was not specified in the request this field will
887      * be equivalent to a time within the last 12 hours, indicating the latest
888      * pricing info.
889      * </pre>
890      *
891      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
892      */
mergeEffectiveTime(com.google.protobuf.Timestamp value)893     public Builder mergeEffectiveTime(com.google.protobuf.Timestamp value) {
894       if (effectiveTimeBuilder_ == null) {
895         if (((bitField0_ & 0x00000001) != 0)
896             && effectiveTime_ != null
897             && effectiveTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
898           getEffectiveTimeBuilder().mergeFrom(value);
899         } else {
900           effectiveTime_ = value;
901         }
902       } else {
903         effectiveTimeBuilder_.mergeFrom(value);
904       }
905       bitField0_ |= 0x00000001;
906       onChanged();
907       return this;
908     }
909     /**
910      *
911      *
912      * <pre>
913      * The timestamp from which this pricing was effective within the requested
914      * time range. This is guaranteed to be greater than or equal to the
915      * start_time field in the request and less than the end_time field in the
916      * request. If a time range was not specified in the request this field will
917      * be equivalent to a time within the last 12 hours, indicating the latest
918      * pricing info.
919      * </pre>
920      *
921      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
922      */
clearEffectiveTime()923     public Builder clearEffectiveTime() {
924       bitField0_ = (bitField0_ & ~0x00000001);
925       effectiveTime_ = null;
926       if (effectiveTimeBuilder_ != null) {
927         effectiveTimeBuilder_.dispose();
928         effectiveTimeBuilder_ = null;
929       }
930       onChanged();
931       return this;
932     }
933     /**
934      *
935      *
936      * <pre>
937      * The timestamp from which this pricing was effective within the requested
938      * time range. This is guaranteed to be greater than or equal to the
939      * start_time field in the request and less than the end_time field in the
940      * request. If a time range was not specified in the request this field will
941      * be equivalent to a time within the last 12 hours, indicating the latest
942      * pricing info.
943      * </pre>
944      *
945      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
946      */
getEffectiveTimeBuilder()947     public com.google.protobuf.Timestamp.Builder getEffectiveTimeBuilder() {
948       bitField0_ |= 0x00000001;
949       onChanged();
950       return getEffectiveTimeFieldBuilder().getBuilder();
951     }
952     /**
953      *
954      *
955      * <pre>
956      * The timestamp from which this pricing was effective within the requested
957      * time range. This is guaranteed to be greater than or equal to the
958      * start_time field in the request and less than the end_time field in the
959      * request. If a time range was not specified in the request this field will
960      * be equivalent to a time within the last 12 hours, indicating the latest
961      * pricing info.
962      * </pre>
963      *
964      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
965      */
getEffectiveTimeOrBuilder()966     public com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder() {
967       if (effectiveTimeBuilder_ != null) {
968         return effectiveTimeBuilder_.getMessageOrBuilder();
969       } else {
970         return effectiveTime_ == null
971             ? com.google.protobuf.Timestamp.getDefaultInstance()
972             : effectiveTime_;
973       }
974     }
975     /**
976      *
977      *
978      * <pre>
979      * The timestamp from which this pricing was effective within the requested
980      * time range. This is guaranteed to be greater than or equal to the
981      * start_time field in the request and less than the end_time field in the
982      * request. If a time range was not specified in the request this field will
983      * be equivalent to a time within the last 12 hours, indicating the latest
984      * pricing info.
985      * </pre>
986      *
987      * <code>.google.protobuf.Timestamp effective_time = 1;</code>
988      */
989     private com.google.protobuf.SingleFieldBuilderV3<
990             com.google.protobuf.Timestamp,
991             com.google.protobuf.Timestamp.Builder,
992             com.google.protobuf.TimestampOrBuilder>
getEffectiveTimeFieldBuilder()993         getEffectiveTimeFieldBuilder() {
994       if (effectiveTimeBuilder_ == null) {
995         effectiveTimeBuilder_ =
996             new com.google.protobuf.SingleFieldBuilderV3<
997                 com.google.protobuf.Timestamp,
998                 com.google.protobuf.Timestamp.Builder,
999                 com.google.protobuf.TimestampOrBuilder>(
1000                 getEffectiveTime(), getParentForChildren(), isClean());
1001         effectiveTime_ = null;
1002       }
1003       return effectiveTimeBuilder_;
1004     }
1005 
1006     private java.lang.Object summary_ = "";
1007     /**
1008      *
1009      *
1010      * <pre>
1011      * An optional human readable summary of the pricing information, has a
1012      * maximum length of 256 characters.
1013      * </pre>
1014      *
1015      * <code>string summary = 2;</code>
1016      *
1017      * @return The summary.
1018      */
getSummary()1019     public java.lang.String getSummary() {
1020       java.lang.Object ref = summary_;
1021       if (!(ref instanceof java.lang.String)) {
1022         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1023         java.lang.String s = bs.toStringUtf8();
1024         summary_ = s;
1025         return s;
1026       } else {
1027         return (java.lang.String) ref;
1028       }
1029     }
1030     /**
1031      *
1032      *
1033      * <pre>
1034      * An optional human readable summary of the pricing information, has a
1035      * maximum length of 256 characters.
1036      * </pre>
1037      *
1038      * <code>string summary = 2;</code>
1039      *
1040      * @return The bytes for summary.
1041      */
getSummaryBytes()1042     public com.google.protobuf.ByteString getSummaryBytes() {
1043       java.lang.Object ref = summary_;
1044       if (ref instanceof String) {
1045         com.google.protobuf.ByteString b =
1046             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1047         summary_ = b;
1048         return b;
1049       } else {
1050         return (com.google.protobuf.ByteString) ref;
1051       }
1052     }
1053     /**
1054      *
1055      *
1056      * <pre>
1057      * An optional human readable summary of the pricing information, has a
1058      * maximum length of 256 characters.
1059      * </pre>
1060      *
1061      * <code>string summary = 2;</code>
1062      *
1063      * @param value The summary to set.
1064      * @return This builder for chaining.
1065      */
setSummary(java.lang.String value)1066     public Builder setSummary(java.lang.String value) {
1067       if (value == null) {
1068         throw new NullPointerException();
1069       }
1070       summary_ = value;
1071       bitField0_ |= 0x00000002;
1072       onChanged();
1073       return this;
1074     }
1075     /**
1076      *
1077      *
1078      * <pre>
1079      * An optional human readable summary of the pricing information, has a
1080      * maximum length of 256 characters.
1081      * </pre>
1082      *
1083      * <code>string summary = 2;</code>
1084      *
1085      * @return This builder for chaining.
1086      */
clearSummary()1087     public Builder clearSummary() {
1088       summary_ = getDefaultInstance().getSummary();
1089       bitField0_ = (bitField0_ & ~0x00000002);
1090       onChanged();
1091       return this;
1092     }
1093     /**
1094      *
1095      *
1096      * <pre>
1097      * An optional human readable summary of the pricing information, has a
1098      * maximum length of 256 characters.
1099      * </pre>
1100      *
1101      * <code>string summary = 2;</code>
1102      *
1103      * @param value The bytes for summary to set.
1104      * @return This builder for chaining.
1105      */
setSummaryBytes(com.google.protobuf.ByteString value)1106     public Builder setSummaryBytes(com.google.protobuf.ByteString value) {
1107       if (value == null) {
1108         throw new NullPointerException();
1109       }
1110       checkByteStringIsUtf8(value);
1111       summary_ = value;
1112       bitField0_ |= 0x00000002;
1113       onChanged();
1114       return this;
1115     }
1116 
1117     private com.google.cloud.billing.v1.PricingExpression pricingExpression_;
1118     private com.google.protobuf.SingleFieldBuilderV3<
1119             com.google.cloud.billing.v1.PricingExpression,
1120             com.google.cloud.billing.v1.PricingExpression.Builder,
1121             com.google.cloud.billing.v1.PricingExpressionOrBuilder>
1122         pricingExpressionBuilder_;
1123     /**
1124      *
1125      *
1126      * <pre>
1127      * Expresses the pricing formula. See `PricingExpression` for an example.
1128      * </pre>
1129      *
1130      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1131      *
1132      * @return Whether the pricingExpression field is set.
1133      */
hasPricingExpression()1134     public boolean hasPricingExpression() {
1135       return ((bitField0_ & 0x00000004) != 0);
1136     }
1137     /**
1138      *
1139      *
1140      * <pre>
1141      * Expresses the pricing formula. See `PricingExpression` for an example.
1142      * </pre>
1143      *
1144      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1145      *
1146      * @return The pricingExpression.
1147      */
getPricingExpression()1148     public com.google.cloud.billing.v1.PricingExpression getPricingExpression() {
1149       if (pricingExpressionBuilder_ == null) {
1150         return pricingExpression_ == null
1151             ? com.google.cloud.billing.v1.PricingExpression.getDefaultInstance()
1152             : pricingExpression_;
1153       } else {
1154         return pricingExpressionBuilder_.getMessage();
1155       }
1156     }
1157     /**
1158      *
1159      *
1160      * <pre>
1161      * Expresses the pricing formula. See `PricingExpression` for an example.
1162      * </pre>
1163      *
1164      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1165      */
setPricingExpression(com.google.cloud.billing.v1.PricingExpression value)1166     public Builder setPricingExpression(com.google.cloud.billing.v1.PricingExpression value) {
1167       if (pricingExpressionBuilder_ == null) {
1168         if (value == null) {
1169           throw new NullPointerException();
1170         }
1171         pricingExpression_ = value;
1172       } else {
1173         pricingExpressionBuilder_.setMessage(value);
1174       }
1175       bitField0_ |= 0x00000004;
1176       onChanged();
1177       return this;
1178     }
1179     /**
1180      *
1181      *
1182      * <pre>
1183      * Expresses the pricing formula. See `PricingExpression` for an example.
1184      * </pre>
1185      *
1186      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1187      */
setPricingExpression( com.google.cloud.billing.v1.PricingExpression.Builder builderForValue)1188     public Builder setPricingExpression(
1189         com.google.cloud.billing.v1.PricingExpression.Builder builderForValue) {
1190       if (pricingExpressionBuilder_ == null) {
1191         pricingExpression_ = builderForValue.build();
1192       } else {
1193         pricingExpressionBuilder_.setMessage(builderForValue.build());
1194       }
1195       bitField0_ |= 0x00000004;
1196       onChanged();
1197       return this;
1198     }
1199     /**
1200      *
1201      *
1202      * <pre>
1203      * Expresses the pricing formula. See `PricingExpression` for an example.
1204      * </pre>
1205      *
1206      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1207      */
mergePricingExpression(com.google.cloud.billing.v1.PricingExpression value)1208     public Builder mergePricingExpression(com.google.cloud.billing.v1.PricingExpression value) {
1209       if (pricingExpressionBuilder_ == null) {
1210         if (((bitField0_ & 0x00000004) != 0)
1211             && pricingExpression_ != null
1212             && pricingExpression_
1213                 != com.google.cloud.billing.v1.PricingExpression.getDefaultInstance()) {
1214           getPricingExpressionBuilder().mergeFrom(value);
1215         } else {
1216           pricingExpression_ = value;
1217         }
1218       } else {
1219         pricingExpressionBuilder_.mergeFrom(value);
1220       }
1221       bitField0_ |= 0x00000004;
1222       onChanged();
1223       return this;
1224     }
1225     /**
1226      *
1227      *
1228      * <pre>
1229      * Expresses the pricing formula. See `PricingExpression` for an example.
1230      * </pre>
1231      *
1232      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1233      */
clearPricingExpression()1234     public Builder clearPricingExpression() {
1235       bitField0_ = (bitField0_ & ~0x00000004);
1236       pricingExpression_ = null;
1237       if (pricingExpressionBuilder_ != null) {
1238         pricingExpressionBuilder_.dispose();
1239         pricingExpressionBuilder_ = null;
1240       }
1241       onChanged();
1242       return this;
1243     }
1244     /**
1245      *
1246      *
1247      * <pre>
1248      * Expresses the pricing formula. See `PricingExpression` for an example.
1249      * </pre>
1250      *
1251      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1252      */
getPricingExpressionBuilder()1253     public com.google.cloud.billing.v1.PricingExpression.Builder getPricingExpressionBuilder() {
1254       bitField0_ |= 0x00000004;
1255       onChanged();
1256       return getPricingExpressionFieldBuilder().getBuilder();
1257     }
1258     /**
1259      *
1260      *
1261      * <pre>
1262      * Expresses the pricing formula. See `PricingExpression` for an example.
1263      * </pre>
1264      *
1265      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1266      */
getPricingExpressionOrBuilder()1267     public com.google.cloud.billing.v1.PricingExpressionOrBuilder getPricingExpressionOrBuilder() {
1268       if (pricingExpressionBuilder_ != null) {
1269         return pricingExpressionBuilder_.getMessageOrBuilder();
1270       } else {
1271         return pricingExpression_ == null
1272             ? com.google.cloud.billing.v1.PricingExpression.getDefaultInstance()
1273             : pricingExpression_;
1274       }
1275     }
1276     /**
1277      *
1278      *
1279      * <pre>
1280      * Expresses the pricing formula. See `PricingExpression` for an example.
1281      * </pre>
1282      *
1283      * <code>.google.cloud.billing.v1.PricingExpression pricing_expression = 3;</code>
1284      */
1285     private com.google.protobuf.SingleFieldBuilderV3<
1286             com.google.cloud.billing.v1.PricingExpression,
1287             com.google.cloud.billing.v1.PricingExpression.Builder,
1288             com.google.cloud.billing.v1.PricingExpressionOrBuilder>
getPricingExpressionFieldBuilder()1289         getPricingExpressionFieldBuilder() {
1290       if (pricingExpressionBuilder_ == null) {
1291         pricingExpressionBuilder_ =
1292             new com.google.protobuf.SingleFieldBuilderV3<
1293                 com.google.cloud.billing.v1.PricingExpression,
1294                 com.google.cloud.billing.v1.PricingExpression.Builder,
1295                 com.google.cloud.billing.v1.PricingExpressionOrBuilder>(
1296                 getPricingExpression(), getParentForChildren(), isClean());
1297         pricingExpression_ = null;
1298       }
1299       return pricingExpressionBuilder_;
1300     }
1301 
1302     private com.google.cloud.billing.v1.AggregationInfo aggregationInfo_;
1303     private com.google.protobuf.SingleFieldBuilderV3<
1304             com.google.cloud.billing.v1.AggregationInfo,
1305             com.google.cloud.billing.v1.AggregationInfo.Builder,
1306             com.google.cloud.billing.v1.AggregationInfoOrBuilder>
1307         aggregationInfoBuilder_;
1308     /**
1309      *
1310      *
1311      * <pre>
1312      * Aggregation Info. This can be left unspecified if the pricing expression
1313      * doesn't require aggregation.
1314      * </pre>
1315      *
1316      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1317      *
1318      * @return Whether the aggregationInfo field is set.
1319      */
hasAggregationInfo()1320     public boolean hasAggregationInfo() {
1321       return ((bitField0_ & 0x00000008) != 0);
1322     }
1323     /**
1324      *
1325      *
1326      * <pre>
1327      * Aggregation Info. This can be left unspecified if the pricing expression
1328      * doesn't require aggregation.
1329      * </pre>
1330      *
1331      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1332      *
1333      * @return The aggregationInfo.
1334      */
getAggregationInfo()1335     public com.google.cloud.billing.v1.AggregationInfo getAggregationInfo() {
1336       if (aggregationInfoBuilder_ == null) {
1337         return aggregationInfo_ == null
1338             ? com.google.cloud.billing.v1.AggregationInfo.getDefaultInstance()
1339             : aggregationInfo_;
1340       } else {
1341         return aggregationInfoBuilder_.getMessage();
1342       }
1343     }
1344     /**
1345      *
1346      *
1347      * <pre>
1348      * Aggregation Info. This can be left unspecified if the pricing expression
1349      * doesn't require aggregation.
1350      * </pre>
1351      *
1352      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1353      */
setAggregationInfo(com.google.cloud.billing.v1.AggregationInfo value)1354     public Builder setAggregationInfo(com.google.cloud.billing.v1.AggregationInfo value) {
1355       if (aggregationInfoBuilder_ == null) {
1356         if (value == null) {
1357           throw new NullPointerException();
1358         }
1359         aggregationInfo_ = value;
1360       } else {
1361         aggregationInfoBuilder_.setMessage(value);
1362       }
1363       bitField0_ |= 0x00000008;
1364       onChanged();
1365       return this;
1366     }
1367     /**
1368      *
1369      *
1370      * <pre>
1371      * Aggregation Info. This can be left unspecified if the pricing expression
1372      * doesn't require aggregation.
1373      * </pre>
1374      *
1375      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1376      */
setAggregationInfo( com.google.cloud.billing.v1.AggregationInfo.Builder builderForValue)1377     public Builder setAggregationInfo(
1378         com.google.cloud.billing.v1.AggregationInfo.Builder builderForValue) {
1379       if (aggregationInfoBuilder_ == null) {
1380         aggregationInfo_ = builderForValue.build();
1381       } else {
1382         aggregationInfoBuilder_.setMessage(builderForValue.build());
1383       }
1384       bitField0_ |= 0x00000008;
1385       onChanged();
1386       return this;
1387     }
1388     /**
1389      *
1390      *
1391      * <pre>
1392      * Aggregation Info. This can be left unspecified if the pricing expression
1393      * doesn't require aggregation.
1394      * </pre>
1395      *
1396      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1397      */
mergeAggregationInfo(com.google.cloud.billing.v1.AggregationInfo value)1398     public Builder mergeAggregationInfo(com.google.cloud.billing.v1.AggregationInfo value) {
1399       if (aggregationInfoBuilder_ == null) {
1400         if (((bitField0_ & 0x00000008) != 0)
1401             && aggregationInfo_ != null
1402             && aggregationInfo_
1403                 != com.google.cloud.billing.v1.AggregationInfo.getDefaultInstance()) {
1404           getAggregationInfoBuilder().mergeFrom(value);
1405         } else {
1406           aggregationInfo_ = value;
1407         }
1408       } else {
1409         aggregationInfoBuilder_.mergeFrom(value);
1410       }
1411       bitField0_ |= 0x00000008;
1412       onChanged();
1413       return this;
1414     }
1415     /**
1416      *
1417      *
1418      * <pre>
1419      * Aggregation Info. This can be left unspecified if the pricing expression
1420      * doesn't require aggregation.
1421      * </pre>
1422      *
1423      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1424      */
clearAggregationInfo()1425     public Builder clearAggregationInfo() {
1426       bitField0_ = (bitField0_ & ~0x00000008);
1427       aggregationInfo_ = null;
1428       if (aggregationInfoBuilder_ != null) {
1429         aggregationInfoBuilder_.dispose();
1430         aggregationInfoBuilder_ = null;
1431       }
1432       onChanged();
1433       return this;
1434     }
1435     /**
1436      *
1437      *
1438      * <pre>
1439      * Aggregation Info. This can be left unspecified if the pricing expression
1440      * doesn't require aggregation.
1441      * </pre>
1442      *
1443      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1444      */
getAggregationInfoBuilder()1445     public com.google.cloud.billing.v1.AggregationInfo.Builder getAggregationInfoBuilder() {
1446       bitField0_ |= 0x00000008;
1447       onChanged();
1448       return getAggregationInfoFieldBuilder().getBuilder();
1449     }
1450     /**
1451      *
1452      *
1453      * <pre>
1454      * Aggregation Info. This can be left unspecified if the pricing expression
1455      * doesn't require aggregation.
1456      * </pre>
1457      *
1458      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1459      */
getAggregationInfoOrBuilder()1460     public com.google.cloud.billing.v1.AggregationInfoOrBuilder getAggregationInfoOrBuilder() {
1461       if (aggregationInfoBuilder_ != null) {
1462         return aggregationInfoBuilder_.getMessageOrBuilder();
1463       } else {
1464         return aggregationInfo_ == null
1465             ? com.google.cloud.billing.v1.AggregationInfo.getDefaultInstance()
1466             : aggregationInfo_;
1467       }
1468     }
1469     /**
1470      *
1471      *
1472      * <pre>
1473      * Aggregation Info. This can be left unspecified if the pricing expression
1474      * doesn't require aggregation.
1475      * </pre>
1476      *
1477      * <code>.google.cloud.billing.v1.AggregationInfo aggregation_info = 4;</code>
1478      */
1479     private com.google.protobuf.SingleFieldBuilderV3<
1480             com.google.cloud.billing.v1.AggregationInfo,
1481             com.google.cloud.billing.v1.AggregationInfo.Builder,
1482             com.google.cloud.billing.v1.AggregationInfoOrBuilder>
getAggregationInfoFieldBuilder()1483         getAggregationInfoFieldBuilder() {
1484       if (aggregationInfoBuilder_ == null) {
1485         aggregationInfoBuilder_ =
1486             new com.google.protobuf.SingleFieldBuilderV3<
1487                 com.google.cloud.billing.v1.AggregationInfo,
1488                 com.google.cloud.billing.v1.AggregationInfo.Builder,
1489                 com.google.cloud.billing.v1.AggregationInfoOrBuilder>(
1490                 getAggregationInfo(), getParentForChildren(), isClean());
1491         aggregationInfo_ = null;
1492       }
1493       return aggregationInfoBuilder_;
1494     }
1495 
1496     private double currencyConversionRate_;
1497     /**
1498      *
1499      *
1500      * <pre>
1501      * Conversion rate used for currency conversion, from USD to the currency
1502      * specified in the request. This includes any surcharge collected for billing
1503      * in non USD currency. If a currency is not specified in the request this
1504      * defaults to 1.0.
1505      * Example: USD * currency_conversion_rate = JPY
1506      * </pre>
1507      *
1508      * <code>double currency_conversion_rate = 5;</code>
1509      *
1510      * @return The currencyConversionRate.
1511      */
1512     @java.lang.Override
getCurrencyConversionRate()1513     public double getCurrencyConversionRate() {
1514       return currencyConversionRate_;
1515     }
1516     /**
1517      *
1518      *
1519      * <pre>
1520      * Conversion rate used for currency conversion, from USD to the currency
1521      * specified in the request. This includes any surcharge collected for billing
1522      * in non USD currency. If a currency is not specified in the request this
1523      * defaults to 1.0.
1524      * Example: USD * currency_conversion_rate = JPY
1525      * </pre>
1526      *
1527      * <code>double currency_conversion_rate = 5;</code>
1528      *
1529      * @param value The currencyConversionRate to set.
1530      * @return This builder for chaining.
1531      */
setCurrencyConversionRate(double value)1532     public Builder setCurrencyConversionRate(double value) {
1533 
1534       currencyConversionRate_ = value;
1535       bitField0_ |= 0x00000010;
1536       onChanged();
1537       return this;
1538     }
1539     /**
1540      *
1541      *
1542      * <pre>
1543      * Conversion rate used for currency conversion, from USD to the currency
1544      * specified in the request. This includes any surcharge collected for billing
1545      * in non USD currency. If a currency is not specified in the request this
1546      * defaults to 1.0.
1547      * Example: USD * currency_conversion_rate = JPY
1548      * </pre>
1549      *
1550      * <code>double currency_conversion_rate = 5;</code>
1551      *
1552      * @return This builder for chaining.
1553      */
clearCurrencyConversionRate()1554     public Builder clearCurrencyConversionRate() {
1555       bitField0_ = (bitField0_ & ~0x00000010);
1556       currencyConversionRate_ = 0D;
1557       onChanged();
1558       return this;
1559     }
1560 
1561     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1562     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1563       return super.setUnknownFields(unknownFields);
1564     }
1565 
1566     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1567     public final Builder mergeUnknownFields(
1568         final com.google.protobuf.UnknownFieldSet unknownFields) {
1569       return super.mergeUnknownFields(unknownFields);
1570     }
1571 
1572     // @@protoc_insertion_point(builder_scope:google.cloud.billing.v1.PricingInfo)
1573   }
1574 
1575   // @@protoc_insertion_point(class_scope:google.cloud.billing.v1.PricingInfo)
1576   private static final com.google.cloud.billing.v1.PricingInfo DEFAULT_INSTANCE;
1577 
1578   static {
1579     DEFAULT_INSTANCE = new com.google.cloud.billing.v1.PricingInfo();
1580   }
1581 
getDefaultInstance()1582   public static com.google.cloud.billing.v1.PricingInfo getDefaultInstance() {
1583     return DEFAULT_INSTANCE;
1584   }
1585 
1586   private static final com.google.protobuf.Parser<PricingInfo> PARSER =
1587       new com.google.protobuf.AbstractParser<PricingInfo>() {
1588         @java.lang.Override
1589         public PricingInfo parsePartialFrom(
1590             com.google.protobuf.CodedInputStream input,
1591             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1592             throws com.google.protobuf.InvalidProtocolBufferException {
1593           Builder builder = newBuilder();
1594           try {
1595             builder.mergeFrom(input, extensionRegistry);
1596           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1597             throw e.setUnfinishedMessage(builder.buildPartial());
1598           } catch (com.google.protobuf.UninitializedMessageException e) {
1599             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1600           } catch (java.io.IOException e) {
1601             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1602                 .setUnfinishedMessage(builder.buildPartial());
1603           }
1604           return builder.buildPartial();
1605         }
1606       };
1607 
parser()1608   public static com.google.protobuf.Parser<PricingInfo> parser() {
1609     return PARSER;
1610   }
1611 
1612   @java.lang.Override
getParserForType()1613   public com.google.protobuf.Parser<PricingInfo> getParserForType() {
1614     return PARSER;
1615   }
1616 
1617   @java.lang.Override
getDefaultInstanceForType()1618   public com.google.cloud.billing.v1.PricingInfo getDefaultInstanceForType() {
1619     return DEFAULT_INSTANCE;
1620   }
1621 }
1622