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