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