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/asset/v1p7beta1/assets.proto 18 19 package com.google.cloud.asset.v1p7beta1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A representation of a Google Cloud resource. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.asset.v1p7beta1.Resource} 29 */ 30 public final class Resource extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.Resource) 33 ResourceOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use Resource.newBuilder() to construct. Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 Resource()40 private Resource() { 41 version_ = ""; 42 discoveryDocumentUri_ = ""; 43 discoveryName_ = ""; 44 resourceUrl_ = ""; 45 parent_ = ""; 46 location_ = ""; 47 } 48 49 @java.lang.Override 50 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)51 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 52 return new Resource(); 53 } 54 55 @java.lang.Override getUnknownFields()56 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 57 return this.unknownFields; 58 } 59 getDescriptor()60 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 61 return com.google.cloud.asset.v1p7beta1.AssetProto 62 .internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; 63 } 64 65 @java.lang.Override 66 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()67 internalGetFieldAccessorTable() { 68 return com.google.cloud.asset.v1p7beta1.AssetProto 69 .internal_static_google_cloud_asset_v1p7beta1_Resource_fieldAccessorTable 70 .ensureFieldAccessorsInitialized( 71 com.google.cloud.asset.v1p7beta1.Resource.class, 72 com.google.cloud.asset.v1p7beta1.Resource.Builder.class); 73 } 74 75 public static final int VERSION_FIELD_NUMBER = 1; 76 77 @SuppressWarnings("serial") 78 private volatile java.lang.Object version_ = ""; 79 /** 80 * 81 * 82 * <pre> 83 * The API version. Example: `v1` 84 * </pre> 85 * 86 * <code>string version = 1;</code> 87 * 88 * @return The version. 89 */ 90 @java.lang.Override getVersion()91 public java.lang.String getVersion() { 92 java.lang.Object ref = version_; 93 if (ref instanceof java.lang.String) { 94 return (java.lang.String) ref; 95 } else { 96 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 97 java.lang.String s = bs.toStringUtf8(); 98 version_ = s; 99 return s; 100 } 101 } 102 /** 103 * 104 * 105 * <pre> 106 * The API version. Example: `v1` 107 * </pre> 108 * 109 * <code>string version = 1;</code> 110 * 111 * @return The bytes for version. 112 */ 113 @java.lang.Override getVersionBytes()114 public com.google.protobuf.ByteString getVersionBytes() { 115 java.lang.Object ref = version_; 116 if (ref instanceof java.lang.String) { 117 com.google.protobuf.ByteString b = 118 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 119 version_ = b; 120 return b; 121 } else { 122 return (com.google.protobuf.ByteString) ref; 123 } 124 } 125 126 public static final int DISCOVERY_DOCUMENT_URI_FIELD_NUMBER = 2; 127 128 @SuppressWarnings("serial") 129 private volatile java.lang.Object discoveryDocumentUri_ = ""; 130 /** 131 * 132 * 133 * <pre> 134 * The URL of the discovery document containing the resource's JSON schema. 135 * Example: 136 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 137 * This value is unspecified for resources that do not have an API based on a 138 * discovery document, such as Cloud Bigtable. 139 * </pre> 140 * 141 * <code>string discovery_document_uri = 2;</code> 142 * 143 * @return The discoveryDocumentUri. 144 */ 145 @java.lang.Override getDiscoveryDocumentUri()146 public java.lang.String getDiscoveryDocumentUri() { 147 java.lang.Object ref = discoveryDocumentUri_; 148 if (ref instanceof java.lang.String) { 149 return (java.lang.String) ref; 150 } else { 151 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 152 java.lang.String s = bs.toStringUtf8(); 153 discoveryDocumentUri_ = s; 154 return s; 155 } 156 } 157 /** 158 * 159 * 160 * <pre> 161 * The URL of the discovery document containing the resource's JSON schema. 162 * Example: 163 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 164 * This value is unspecified for resources that do not have an API based on a 165 * discovery document, such as Cloud Bigtable. 166 * </pre> 167 * 168 * <code>string discovery_document_uri = 2;</code> 169 * 170 * @return The bytes for discoveryDocumentUri. 171 */ 172 @java.lang.Override getDiscoveryDocumentUriBytes()173 public com.google.protobuf.ByteString getDiscoveryDocumentUriBytes() { 174 java.lang.Object ref = discoveryDocumentUri_; 175 if (ref instanceof java.lang.String) { 176 com.google.protobuf.ByteString b = 177 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 178 discoveryDocumentUri_ = b; 179 return b; 180 } else { 181 return (com.google.protobuf.ByteString) ref; 182 } 183 } 184 185 public static final int DISCOVERY_NAME_FIELD_NUMBER = 3; 186 187 @SuppressWarnings("serial") 188 private volatile java.lang.Object discoveryName_ = ""; 189 /** 190 * 191 * 192 * <pre> 193 * The JSON schema name listed in the discovery document. Example: 194 * `Project` 195 * This value is unspecified for resources that do not have an API based on a 196 * discovery document, such as Cloud Bigtable. 197 * </pre> 198 * 199 * <code>string discovery_name = 3;</code> 200 * 201 * @return The discoveryName. 202 */ 203 @java.lang.Override getDiscoveryName()204 public java.lang.String getDiscoveryName() { 205 java.lang.Object ref = discoveryName_; 206 if (ref instanceof java.lang.String) { 207 return (java.lang.String) ref; 208 } else { 209 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 210 java.lang.String s = bs.toStringUtf8(); 211 discoveryName_ = s; 212 return s; 213 } 214 } 215 /** 216 * 217 * 218 * <pre> 219 * The JSON schema name listed in the discovery document. Example: 220 * `Project` 221 * This value is unspecified for resources that do not have an API based on a 222 * discovery document, such as Cloud Bigtable. 223 * </pre> 224 * 225 * <code>string discovery_name = 3;</code> 226 * 227 * @return The bytes for discoveryName. 228 */ 229 @java.lang.Override getDiscoveryNameBytes()230 public com.google.protobuf.ByteString getDiscoveryNameBytes() { 231 java.lang.Object ref = discoveryName_; 232 if (ref instanceof java.lang.String) { 233 com.google.protobuf.ByteString b = 234 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 235 discoveryName_ = b; 236 return b; 237 } else { 238 return (com.google.protobuf.ByteString) ref; 239 } 240 } 241 242 public static final int RESOURCE_URL_FIELD_NUMBER = 4; 243 244 @SuppressWarnings("serial") 245 private volatile java.lang.Object resourceUrl_ = ""; 246 /** 247 * 248 * 249 * <pre> 250 * The REST URL for accessing the resource. An HTTP `GET` request using this 251 * URL returns the resource itself. Example: 252 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 253 * This value is unspecified for resources without a REST API. 254 * </pre> 255 * 256 * <code>string resource_url = 4;</code> 257 * 258 * @return The resourceUrl. 259 */ 260 @java.lang.Override getResourceUrl()261 public java.lang.String getResourceUrl() { 262 java.lang.Object ref = resourceUrl_; 263 if (ref instanceof java.lang.String) { 264 return (java.lang.String) ref; 265 } else { 266 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 267 java.lang.String s = bs.toStringUtf8(); 268 resourceUrl_ = s; 269 return s; 270 } 271 } 272 /** 273 * 274 * 275 * <pre> 276 * The REST URL for accessing the resource. An HTTP `GET` request using this 277 * URL returns the resource itself. Example: 278 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 279 * This value is unspecified for resources without a REST API. 280 * </pre> 281 * 282 * <code>string resource_url = 4;</code> 283 * 284 * @return The bytes for resourceUrl. 285 */ 286 @java.lang.Override getResourceUrlBytes()287 public com.google.protobuf.ByteString getResourceUrlBytes() { 288 java.lang.Object ref = resourceUrl_; 289 if (ref instanceof java.lang.String) { 290 com.google.protobuf.ByteString b = 291 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 292 resourceUrl_ = b; 293 return b; 294 } else { 295 return (com.google.protobuf.ByteString) ref; 296 } 297 } 298 299 public static final int PARENT_FIELD_NUMBER = 5; 300 301 @SuppressWarnings("serial") 302 private volatile java.lang.Object parent_ = ""; 303 /** 304 * 305 * 306 * <pre> 307 * The full name of the immediate parent of this resource. See 308 * [Resource 309 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 310 * for more information. 311 * For Google Cloud assets, this value is the parent resource defined in the 312 * [IAM policy 313 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 314 * Example: 315 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 316 * For third-party assets, this field may be set differently. 317 * </pre> 318 * 319 * <code>string parent = 5;</code> 320 * 321 * @return The parent. 322 */ 323 @java.lang.Override getParent()324 public java.lang.String getParent() { 325 java.lang.Object ref = parent_; 326 if (ref instanceof java.lang.String) { 327 return (java.lang.String) ref; 328 } else { 329 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 330 java.lang.String s = bs.toStringUtf8(); 331 parent_ = s; 332 return s; 333 } 334 } 335 /** 336 * 337 * 338 * <pre> 339 * The full name of the immediate parent of this resource. See 340 * [Resource 341 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 342 * for more information. 343 * For Google Cloud assets, this value is the parent resource defined in the 344 * [IAM policy 345 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 346 * Example: 347 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 348 * For third-party assets, this field may be set differently. 349 * </pre> 350 * 351 * <code>string parent = 5;</code> 352 * 353 * @return The bytes for parent. 354 */ 355 @java.lang.Override getParentBytes()356 public com.google.protobuf.ByteString getParentBytes() { 357 java.lang.Object ref = parent_; 358 if (ref instanceof java.lang.String) { 359 com.google.protobuf.ByteString b = 360 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 361 parent_ = b; 362 return b; 363 } else { 364 return (com.google.protobuf.ByteString) ref; 365 } 366 } 367 368 public static final int DATA_FIELD_NUMBER = 6; 369 private com.google.protobuf.Struct data_; 370 /** 371 * 372 * 373 * <pre> 374 * The content of the resource, in which some sensitive fields are removed 375 * and may not be present. 376 * </pre> 377 * 378 * <code>.google.protobuf.Struct data = 6;</code> 379 * 380 * @return Whether the data field is set. 381 */ 382 @java.lang.Override hasData()383 public boolean hasData() { 384 return data_ != null; 385 } 386 /** 387 * 388 * 389 * <pre> 390 * The content of the resource, in which some sensitive fields are removed 391 * and may not be present. 392 * </pre> 393 * 394 * <code>.google.protobuf.Struct data = 6;</code> 395 * 396 * @return The data. 397 */ 398 @java.lang.Override getData()399 public com.google.protobuf.Struct getData() { 400 return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; 401 } 402 /** 403 * 404 * 405 * <pre> 406 * The content of the resource, in which some sensitive fields are removed 407 * and may not be present. 408 * </pre> 409 * 410 * <code>.google.protobuf.Struct data = 6;</code> 411 */ 412 @java.lang.Override getDataOrBuilder()413 public com.google.protobuf.StructOrBuilder getDataOrBuilder() { 414 return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; 415 } 416 417 public static final int LOCATION_FIELD_NUMBER = 8; 418 419 @SuppressWarnings("serial") 420 private volatile java.lang.Object location_ = ""; 421 /** 422 * 423 * 424 * <pre> 425 * The location of the resource in Google Cloud, such as its zone and region. 426 * For more information, see https://cloud.google.com/about/locations/. 427 * </pre> 428 * 429 * <code>string location = 8;</code> 430 * 431 * @return The location. 432 */ 433 @java.lang.Override getLocation()434 public java.lang.String getLocation() { 435 java.lang.Object ref = location_; 436 if (ref instanceof java.lang.String) { 437 return (java.lang.String) ref; 438 } else { 439 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 440 java.lang.String s = bs.toStringUtf8(); 441 location_ = s; 442 return s; 443 } 444 } 445 /** 446 * 447 * 448 * <pre> 449 * The location of the resource in Google Cloud, such as its zone and region. 450 * For more information, see https://cloud.google.com/about/locations/. 451 * </pre> 452 * 453 * <code>string location = 8;</code> 454 * 455 * @return The bytes for location. 456 */ 457 @java.lang.Override getLocationBytes()458 public com.google.protobuf.ByteString getLocationBytes() { 459 java.lang.Object ref = location_; 460 if (ref instanceof java.lang.String) { 461 com.google.protobuf.ByteString b = 462 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 463 location_ = b; 464 return b; 465 } else { 466 return (com.google.protobuf.ByteString) ref; 467 } 468 } 469 470 private byte memoizedIsInitialized = -1; 471 472 @java.lang.Override isInitialized()473 public final boolean isInitialized() { 474 byte isInitialized = memoizedIsInitialized; 475 if (isInitialized == 1) return true; 476 if (isInitialized == 0) return false; 477 478 memoizedIsInitialized = 1; 479 return true; 480 } 481 482 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)483 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 484 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { 485 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); 486 } 487 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(discoveryDocumentUri_)) { 488 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, discoveryDocumentUri_); 489 } 490 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(discoveryName_)) { 491 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, discoveryName_); 492 } 493 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUrl_)) { 494 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resourceUrl_); 495 } 496 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { 497 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); 498 } 499 if (data_ != null) { 500 output.writeMessage(6, getData()); 501 } 502 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { 503 com.google.protobuf.GeneratedMessageV3.writeString(output, 8, location_); 504 } 505 getUnknownFields().writeTo(output); 506 } 507 508 @java.lang.Override getSerializedSize()509 public int getSerializedSize() { 510 int size = memoizedSize; 511 if (size != -1) return size; 512 513 size = 0; 514 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { 515 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); 516 } 517 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(discoveryDocumentUri_)) { 518 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, discoveryDocumentUri_); 519 } 520 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(discoveryName_)) { 521 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, discoveryName_); 522 } 523 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUrl_)) { 524 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resourceUrl_); 525 } 526 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { 527 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); 528 } 529 if (data_ != null) { 530 size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getData()); 531 } 532 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { 533 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, location_); 534 } 535 size += getUnknownFields().getSerializedSize(); 536 memoizedSize = size; 537 return size; 538 } 539 540 @java.lang.Override equals(final java.lang.Object obj)541 public boolean equals(final java.lang.Object obj) { 542 if (obj == this) { 543 return true; 544 } 545 if (!(obj instanceof com.google.cloud.asset.v1p7beta1.Resource)) { 546 return super.equals(obj); 547 } 548 com.google.cloud.asset.v1p7beta1.Resource other = 549 (com.google.cloud.asset.v1p7beta1.Resource) obj; 550 551 if (!getVersion().equals(other.getVersion())) return false; 552 if (!getDiscoveryDocumentUri().equals(other.getDiscoveryDocumentUri())) return false; 553 if (!getDiscoveryName().equals(other.getDiscoveryName())) return false; 554 if (!getResourceUrl().equals(other.getResourceUrl())) return false; 555 if (!getParent().equals(other.getParent())) return false; 556 if (hasData() != other.hasData()) return false; 557 if (hasData()) { 558 if (!getData().equals(other.getData())) return false; 559 } 560 if (!getLocation().equals(other.getLocation())) return false; 561 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 562 return true; 563 } 564 565 @java.lang.Override hashCode()566 public int hashCode() { 567 if (memoizedHashCode != 0) { 568 return memoizedHashCode; 569 } 570 int hash = 41; 571 hash = (19 * hash) + getDescriptor().hashCode(); 572 hash = (37 * hash) + VERSION_FIELD_NUMBER; 573 hash = (53 * hash) + getVersion().hashCode(); 574 hash = (37 * hash) + DISCOVERY_DOCUMENT_URI_FIELD_NUMBER; 575 hash = (53 * hash) + getDiscoveryDocumentUri().hashCode(); 576 hash = (37 * hash) + DISCOVERY_NAME_FIELD_NUMBER; 577 hash = (53 * hash) + getDiscoveryName().hashCode(); 578 hash = (37 * hash) + RESOURCE_URL_FIELD_NUMBER; 579 hash = (53 * hash) + getResourceUrl().hashCode(); 580 hash = (37 * hash) + PARENT_FIELD_NUMBER; 581 hash = (53 * hash) + getParent().hashCode(); 582 if (hasData()) { 583 hash = (37 * hash) + DATA_FIELD_NUMBER; 584 hash = (53 * hash) + getData().hashCode(); 585 } 586 hash = (37 * hash) + LOCATION_FIELD_NUMBER; 587 hash = (53 * hash) + getLocation().hashCode(); 588 hash = (29 * hash) + getUnknownFields().hashCode(); 589 memoizedHashCode = hash; 590 return hash; 591 } 592 parseFrom(java.nio.ByteBuffer data)593 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom(java.nio.ByteBuffer data) 594 throws com.google.protobuf.InvalidProtocolBufferException { 595 return PARSER.parseFrom(data); 596 } 597 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)598 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 599 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 600 throws com.google.protobuf.InvalidProtocolBufferException { 601 return PARSER.parseFrom(data, extensionRegistry); 602 } 603 parseFrom( com.google.protobuf.ByteString data)604 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 605 com.google.protobuf.ByteString data) 606 throws com.google.protobuf.InvalidProtocolBufferException { 607 return PARSER.parseFrom(data); 608 } 609 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)610 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 611 com.google.protobuf.ByteString data, 612 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 613 throws com.google.protobuf.InvalidProtocolBufferException { 614 return PARSER.parseFrom(data, extensionRegistry); 615 } 616 parseFrom(byte[] data)617 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom(byte[] data) 618 throws com.google.protobuf.InvalidProtocolBufferException { 619 return PARSER.parseFrom(data); 620 } 621 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)622 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 623 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 624 throws com.google.protobuf.InvalidProtocolBufferException { 625 return PARSER.parseFrom(data, extensionRegistry); 626 } 627 parseFrom(java.io.InputStream input)628 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom(java.io.InputStream input) 629 throws java.io.IOException { 630 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 631 } 632 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)633 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 634 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 635 throws java.io.IOException { 636 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 637 PARSER, input, extensionRegistry); 638 } 639 parseDelimitedFrom( java.io.InputStream input)640 public static com.google.cloud.asset.v1p7beta1.Resource parseDelimitedFrom( 641 java.io.InputStream input) throws java.io.IOException { 642 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 643 } 644 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)645 public static com.google.cloud.asset.v1p7beta1.Resource parseDelimitedFrom( 646 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 647 throws java.io.IOException { 648 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 649 PARSER, input, extensionRegistry); 650 } 651 parseFrom( com.google.protobuf.CodedInputStream input)652 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 653 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 654 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 655 } 656 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)657 public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( 658 com.google.protobuf.CodedInputStream input, 659 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 660 throws java.io.IOException { 661 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 662 PARSER, input, extensionRegistry); 663 } 664 665 @java.lang.Override newBuilderForType()666 public Builder newBuilderForType() { 667 return newBuilder(); 668 } 669 newBuilder()670 public static Builder newBuilder() { 671 return DEFAULT_INSTANCE.toBuilder(); 672 } 673 newBuilder(com.google.cloud.asset.v1p7beta1.Resource prototype)674 public static Builder newBuilder(com.google.cloud.asset.v1p7beta1.Resource prototype) { 675 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 676 } 677 678 @java.lang.Override toBuilder()679 public Builder toBuilder() { 680 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 681 } 682 683 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)684 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 685 Builder builder = new Builder(parent); 686 return builder; 687 } 688 /** 689 * 690 * 691 * <pre> 692 * A representation of a Google Cloud resource. 693 * </pre> 694 * 695 * Protobuf type {@code google.cloud.asset.v1p7beta1.Resource} 696 */ 697 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 698 implements 699 // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.Resource) 700 com.google.cloud.asset.v1p7beta1.ResourceOrBuilder { getDescriptor()701 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 702 return com.google.cloud.asset.v1p7beta1.AssetProto 703 .internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; 704 } 705 706 @java.lang.Override 707 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()708 internalGetFieldAccessorTable() { 709 return com.google.cloud.asset.v1p7beta1.AssetProto 710 .internal_static_google_cloud_asset_v1p7beta1_Resource_fieldAccessorTable 711 .ensureFieldAccessorsInitialized( 712 com.google.cloud.asset.v1p7beta1.Resource.class, 713 com.google.cloud.asset.v1p7beta1.Resource.Builder.class); 714 } 715 716 // Construct using com.google.cloud.asset.v1p7beta1.Resource.newBuilder() Builder()717 private Builder() {} 718 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)719 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 720 super(parent); 721 } 722 723 @java.lang.Override clear()724 public Builder clear() { 725 super.clear(); 726 bitField0_ = 0; 727 version_ = ""; 728 discoveryDocumentUri_ = ""; 729 discoveryName_ = ""; 730 resourceUrl_ = ""; 731 parent_ = ""; 732 data_ = null; 733 if (dataBuilder_ != null) { 734 dataBuilder_.dispose(); 735 dataBuilder_ = null; 736 } 737 location_ = ""; 738 return this; 739 } 740 741 @java.lang.Override getDescriptorForType()742 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 743 return com.google.cloud.asset.v1p7beta1.AssetProto 744 .internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; 745 } 746 747 @java.lang.Override getDefaultInstanceForType()748 public com.google.cloud.asset.v1p7beta1.Resource getDefaultInstanceForType() { 749 return com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance(); 750 } 751 752 @java.lang.Override build()753 public com.google.cloud.asset.v1p7beta1.Resource build() { 754 com.google.cloud.asset.v1p7beta1.Resource result = buildPartial(); 755 if (!result.isInitialized()) { 756 throw newUninitializedMessageException(result); 757 } 758 return result; 759 } 760 761 @java.lang.Override buildPartial()762 public com.google.cloud.asset.v1p7beta1.Resource buildPartial() { 763 com.google.cloud.asset.v1p7beta1.Resource result = 764 new com.google.cloud.asset.v1p7beta1.Resource(this); 765 if (bitField0_ != 0) { 766 buildPartial0(result); 767 } 768 onBuilt(); 769 return result; 770 } 771 buildPartial0(com.google.cloud.asset.v1p7beta1.Resource result)772 private void buildPartial0(com.google.cloud.asset.v1p7beta1.Resource result) { 773 int from_bitField0_ = bitField0_; 774 if (((from_bitField0_ & 0x00000001) != 0)) { 775 result.version_ = version_; 776 } 777 if (((from_bitField0_ & 0x00000002) != 0)) { 778 result.discoveryDocumentUri_ = discoveryDocumentUri_; 779 } 780 if (((from_bitField0_ & 0x00000004) != 0)) { 781 result.discoveryName_ = discoveryName_; 782 } 783 if (((from_bitField0_ & 0x00000008) != 0)) { 784 result.resourceUrl_ = resourceUrl_; 785 } 786 if (((from_bitField0_ & 0x00000010) != 0)) { 787 result.parent_ = parent_; 788 } 789 if (((from_bitField0_ & 0x00000020) != 0)) { 790 result.data_ = dataBuilder_ == null ? data_ : dataBuilder_.build(); 791 } 792 if (((from_bitField0_ & 0x00000040) != 0)) { 793 result.location_ = location_; 794 } 795 } 796 797 @java.lang.Override clone()798 public Builder clone() { 799 return super.clone(); 800 } 801 802 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)803 public Builder setField( 804 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 805 return super.setField(field, value); 806 } 807 808 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)809 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 810 return super.clearField(field); 811 } 812 813 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)814 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 815 return super.clearOneof(oneof); 816 } 817 818 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)819 public Builder setRepeatedField( 820 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 821 return super.setRepeatedField(field, index, value); 822 } 823 824 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)825 public Builder addRepeatedField( 826 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 827 return super.addRepeatedField(field, value); 828 } 829 830 @java.lang.Override mergeFrom(com.google.protobuf.Message other)831 public Builder mergeFrom(com.google.protobuf.Message other) { 832 if (other instanceof com.google.cloud.asset.v1p7beta1.Resource) { 833 return mergeFrom((com.google.cloud.asset.v1p7beta1.Resource) other); 834 } else { 835 super.mergeFrom(other); 836 return this; 837 } 838 } 839 mergeFrom(com.google.cloud.asset.v1p7beta1.Resource other)840 public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.Resource other) { 841 if (other == com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance()) return this; 842 if (!other.getVersion().isEmpty()) { 843 version_ = other.version_; 844 bitField0_ |= 0x00000001; 845 onChanged(); 846 } 847 if (!other.getDiscoveryDocumentUri().isEmpty()) { 848 discoveryDocumentUri_ = other.discoveryDocumentUri_; 849 bitField0_ |= 0x00000002; 850 onChanged(); 851 } 852 if (!other.getDiscoveryName().isEmpty()) { 853 discoveryName_ = other.discoveryName_; 854 bitField0_ |= 0x00000004; 855 onChanged(); 856 } 857 if (!other.getResourceUrl().isEmpty()) { 858 resourceUrl_ = other.resourceUrl_; 859 bitField0_ |= 0x00000008; 860 onChanged(); 861 } 862 if (!other.getParent().isEmpty()) { 863 parent_ = other.parent_; 864 bitField0_ |= 0x00000010; 865 onChanged(); 866 } 867 if (other.hasData()) { 868 mergeData(other.getData()); 869 } 870 if (!other.getLocation().isEmpty()) { 871 location_ = other.location_; 872 bitField0_ |= 0x00000040; 873 onChanged(); 874 } 875 this.mergeUnknownFields(other.getUnknownFields()); 876 onChanged(); 877 return this; 878 } 879 880 @java.lang.Override isInitialized()881 public final boolean isInitialized() { 882 return true; 883 } 884 885 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)886 public Builder mergeFrom( 887 com.google.protobuf.CodedInputStream input, 888 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 889 throws java.io.IOException { 890 if (extensionRegistry == null) { 891 throw new java.lang.NullPointerException(); 892 } 893 try { 894 boolean done = false; 895 while (!done) { 896 int tag = input.readTag(); 897 switch (tag) { 898 case 0: 899 done = true; 900 break; 901 case 10: 902 { 903 version_ = input.readStringRequireUtf8(); 904 bitField0_ |= 0x00000001; 905 break; 906 } // case 10 907 case 18: 908 { 909 discoveryDocumentUri_ = input.readStringRequireUtf8(); 910 bitField0_ |= 0x00000002; 911 break; 912 } // case 18 913 case 26: 914 { 915 discoveryName_ = input.readStringRequireUtf8(); 916 bitField0_ |= 0x00000004; 917 break; 918 } // case 26 919 case 34: 920 { 921 resourceUrl_ = input.readStringRequireUtf8(); 922 bitField0_ |= 0x00000008; 923 break; 924 } // case 34 925 case 42: 926 { 927 parent_ = input.readStringRequireUtf8(); 928 bitField0_ |= 0x00000010; 929 break; 930 } // case 42 931 case 50: 932 { 933 input.readMessage(getDataFieldBuilder().getBuilder(), extensionRegistry); 934 bitField0_ |= 0x00000020; 935 break; 936 } // case 50 937 case 66: 938 { 939 location_ = input.readStringRequireUtf8(); 940 bitField0_ |= 0x00000040; 941 break; 942 } // case 66 943 default: 944 { 945 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 946 done = true; // was an endgroup tag 947 } 948 break; 949 } // default: 950 } // switch (tag) 951 } // while (!done) 952 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 953 throw e.unwrapIOException(); 954 } finally { 955 onChanged(); 956 } // finally 957 return this; 958 } 959 960 private int bitField0_; 961 962 private java.lang.Object version_ = ""; 963 /** 964 * 965 * 966 * <pre> 967 * The API version. Example: `v1` 968 * </pre> 969 * 970 * <code>string version = 1;</code> 971 * 972 * @return The version. 973 */ getVersion()974 public java.lang.String getVersion() { 975 java.lang.Object ref = version_; 976 if (!(ref instanceof java.lang.String)) { 977 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 978 java.lang.String s = bs.toStringUtf8(); 979 version_ = s; 980 return s; 981 } else { 982 return (java.lang.String) ref; 983 } 984 } 985 /** 986 * 987 * 988 * <pre> 989 * The API version. Example: `v1` 990 * </pre> 991 * 992 * <code>string version = 1;</code> 993 * 994 * @return The bytes for version. 995 */ getVersionBytes()996 public com.google.protobuf.ByteString getVersionBytes() { 997 java.lang.Object ref = version_; 998 if (ref instanceof String) { 999 com.google.protobuf.ByteString b = 1000 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1001 version_ = b; 1002 return b; 1003 } else { 1004 return (com.google.protobuf.ByteString) ref; 1005 } 1006 } 1007 /** 1008 * 1009 * 1010 * <pre> 1011 * The API version. Example: `v1` 1012 * </pre> 1013 * 1014 * <code>string version = 1;</code> 1015 * 1016 * @param value The version to set. 1017 * @return This builder for chaining. 1018 */ setVersion(java.lang.String value)1019 public Builder setVersion(java.lang.String value) { 1020 if (value == null) { 1021 throw new NullPointerException(); 1022 } 1023 version_ = value; 1024 bitField0_ |= 0x00000001; 1025 onChanged(); 1026 return this; 1027 } 1028 /** 1029 * 1030 * 1031 * <pre> 1032 * The API version. Example: `v1` 1033 * </pre> 1034 * 1035 * <code>string version = 1;</code> 1036 * 1037 * @return This builder for chaining. 1038 */ clearVersion()1039 public Builder clearVersion() { 1040 version_ = getDefaultInstance().getVersion(); 1041 bitField0_ = (bitField0_ & ~0x00000001); 1042 onChanged(); 1043 return this; 1044 } 1045 /** 1046 * 1047 * 1048 * <pre> 1049 * The API version. Example: `v1` 1050 * </pre> 1051 * 1052 * <code>string version = 1;</code> 1053 * 1054 * @param value The bytes for version to set. 1055 * @return This builder for chaining. 1056 */ setVersionBytes(com.google.protobuf.ByteString value)1057 public Builder setVersionBytes(com.google.protobuf.ByteString value) { 1058 if (value == null) { 1059 throw new NullPointerException(); 1060 } 1061 checkByteStringIsUtf8(value); 1062 version_ = value; 1063 bitField0_ |= 0x00000001; 1064 onChanged(); 1065 return this; 1066 } 1067 1068 private java.lang.Object discoveryDocumentUri_ = ""; 1069 /** 1070 * 1071 * 1072 * <pre> 1073 * The URL of the discovery document containing the resource's JSON schema. 1074 * Example: 1075 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 1076 * This value is unspecified for resources that do not have an API based on a 1077 * discovery document, such as Cloud Bigtable. 1078 * </pre> 1079 * 1080 * <code>string discovery_document_uri = 2;</code> 1081 * 1082 * @return The discoveryDocumentUri. 1083 */ getDiscoveryDocumentUri()1084 public java.lang.String getDiscoveryDocumentUri() { 1085 java.lang.Object ref = discoveryDocumentUri_; 1086 if (!(ref instanceof java.lang.String)) { 1087 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1088 java.lang.String s = bs.toStringUtf8(); 1089 discoveryDocumentUri_ = s; 1090 return s; 1091 } else { 1092 return (java.lang.String) ref; 1093 } 1094 } 1095 /** 1096 * 1097 * 1098 * <pre> 1099 * The URL of the discovery document containing the resource's JSON schema. 1100 * Example: 1101 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 1102 * This value is unspecified for resources that do not have an API based on a 1103 * discovery document, such as Cloud Bigtable. 1104 * </pre> 1105 * 1106 * <code>string discovery_document_uri = 2;</code> 1107 * 1108 * @return The bytes for discoveryDocumentUri. 1109 */ getDiscoveryDocumentUriBytes()1110 public com.google.protobuf.ByteString getDiscoveryDocumentUriBytes() { 1111 java.lang.Object ref = discoveryDocumentUri_; 1112 if (ref instanceof String) { 1113 com.google.protobuf.ByteString b = 1114 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1115 discoveryDocumentUri_ = b; 1116 return b; 1117 } else { 1118 return (com.google.protobuf.ByteString) ref; 1119 } 1120 } 1121 /** 1122 * 1123 * 1124 * <pre> 1125 * The URL of the discovery document containing the resource's JSON schema. 1126 * Example: 1127 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 1128 * This value is unspecified for resources that do not have an API based on a 1129 * discovery document, such as Cloud Bigtable. 1130 * </pre> 1131 * 1132 * <code>string discovery_document_uri = 2;</code> 1133 * 1134 * @param value The discoveryDocumentUri to set. 1135 * @return This builder for chaining. 1136 */ setDiscoveryDocumentUri(java.lang.String value)1137 public Builder setDiscoveryDocumentUri(java.lang.String value) { 1138 if (value == null) { 1139 throw new NullPointerException(); 1140 } 1141 discoveryDocumentUri_ = value; 1142 bitField0_ |= 0x00000002; 1143 onChanged(); 1144 return this; 1145 } 1146 /** 1147 * 1148 * 1149 * <pre> 1150 * The URL of the discovery document containing the resource's JSON schema. 1151 * Example: 1152 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 1153 * This value is unspecified for resources that do not have an API based on a 1154 * discovery document, such as Cloud Bigtable. 1155 * </pre> 1156 * 1157 * <code>string discovery_document_uri = 2;</code> 1158 * 1159 * @return This builder for chaining. 1160 */ clearDiscoveryDocumentUri()1161 public Builder clearDiscoveryDocumentUri() { 1162 discoveryDocumentUri_ = getDefaultInstance().getDiscoveryDocumentUri(); 1163 bitField0_ = (bitField0_ & ~0x00000002); 1164 onChanged(); 1165 return this; 1166 } 1167 /** 1168 * 1169 * 1170 * <pre> 1171 * The URL of the discovery document containing the resource's JSON schema. 1172 * Example: 1173 * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` 1174 * This value is unspecified for resources that do not have an API based on a 1175 * discovery document, such as Cloud Bigtable. 1176 * </pre> 1177 * 1178 * <code>string discovery_document_uri = 2;</code> 1179 * 1180 * @param value The bytes for discoveryDocumentUri to set. 1181 * @return This builder for chaining. 1182 */ setDiscoveryDocumentUriBytes(com.google.protobuf.ByteString value)1183 public Builder setDiscoveryDocumentUriBytes(com.google.protobuf.ByteString value) { 1184 if (value == null) { 1185 throw new NullPointerException(); 1186 } 1187 checkByteStringIsUtf8(value); 1188 discoveryDocumentUri_ = value; 1189 bitField0_ |= 0x00000002; 1190 onChanged(); 1191 return this; 1192 } 1193 1194 private java.lang.Object discoveryName_ = ""; 1195 /** 1196 * 1197 * 1198 * <pre> 1199 * The JSON schema name listed in the discovery document. Example: 1200 * `Project` 1201 * This value is unspecified for resources that do not have an API based on a 1202 * discovery document, such as Cloud Bigtable. 1203 * </pre> 1204 * 1205 * <code>string discovery_name = 3;</code> 1206 * 1207 * @return The discoveryName. 1208 */ getDiscoveryName()1209 public java.lang.String getDiscoveryName() { 1210 java.lang.Object ref = discoveryName_; 1211 if (!(ref instanceof java.lang.String)) { 1212 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1213 java.lang.String s = bs.toStringUtf8(); 1214 discoveryName_ = s; 1215 return s; 1216 } else { 1217 return (java.lang.String) ref; 1218 } 1219 } 1220 /** 1221 * 1222 * 1223 * <pre> 1224 * The JSON schema name listed in the discovery document. Example: 1225 * `Project` 1226 * This value is unspecified for resources that do not have an API based on a 1227 * discovery document, such as Cloud Bigtable. 1228 * </pre> 1229 * 1230 * <code>string discovery_name = 3;</code> 1231 * 1232 * @return The bytes for discoveryName. 1233 */ getDiscoveryNameBytes()1234 public com.google.protobuf.ByteString getDiscoveryNameBytes() { 1235 java.lang.Object ref = discoveryName_; 1236 if (ref instanceof String) { 1237 com.google.protobuf.ByteString b = 1238 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1239 discoveryName_ = b; 1240 return b; 1241 } else { 1242 return (com.google.protobuf.ByteString) ref; 1243 } 1244 } 1245 /** 1246 * 1247 * 1248 * <pre> 1249 * The JSON schema name listed in the discovery document. Example: 1250 * `Project` 1251 * This value is unspecified for resources that do not have an API based on a 1252 * discovery document, such as Cloud Bigtable. 1253 * </pre> 1254 * 1255 * <code>string discovery_name = 3;</code> 1256 * 1257 * @param value The discoveryName to set. 1258 * @return This builder for chaining. 1259 */ setDiscoveryName(java.lang.String value)1260 public Builder setDiscoveryName(java.lang.String value) { 1261 if (value == null) { 1262 throw new NullPointerException(); 1263 } 1264 discoveryName_ = value; 1265 bitField0_ |= 0x00000004; 1266 onChanged(); 1267 return this; 1268 } 1269 /** 1270 * 1271 * 1272 * <pre> 1273 * The JSON schema name listed in the discovery document. Example: 1274 * `Project` 1275 * This value is unspecified for resources that do not have an API based on a 1276 * discovery document, such as Cloud Bigtable. 1277 * </pre> 1278 * 1279 * <code>string discovery_name = 3;</code> 1280 * 1281 * @return This builder for chaining. 1282 */ clearDiscoveryName()1283 public Builder clearDiscoveryName() { 1284 discoveryName_ = getDefaultInstance().getDiscoveryName(); 1285 bitField0_ = (bitField0_ & ~0x00000004); 1286 onChanged(); 1287 return this; 1288 } 1289 /** 1290 * 1291 * 1292 * <pre> 1293 * The JSON schema name listed in the discovery document. Example: 1294 * `Project` 1295 * This value is unspecified for resources that do not have an API based on a 1296 * discovery document, such as Cloud Bigtable. 1297 * </pre> 1298 * 1299 * <code>string discovery_name = 3;</code> 1300 * 1301 * @param value The bytes for discoveryName to set. 1302 * @return This builder for chaining. 1303 */ setDiscoveryNameBytes(com.google.protobuf.ByteString value)1304 public Builder setDiscoveryNameBytes(com.google.protobuf.ByteString value) { 1305 if (value == null) { 1306 throw new NullPointerException(); 1307 } 1308 checkByteStringIsUtf8(value); 1309 discoveryName_ = value; 1310 bitField0_ |= 0x00000004; 1311 onChanged(); 1312 return this; 1313 } 1314 1315 private java.lang.Object resourceUrl_ = ""; 1316 /** 1317 * 1318 * 1319 * <pre> 1320 * The REST URL for accessing the resource. An HTTP `GET` request using this 1321 * URL returns the resource itself. Example: 1322 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 1323 * This value is unspecified for resources without a REST API. 1324 * </pre> 1325 * 1326 * <code>string resource_url = 4;</code> 1327 * 1328 * @return The resourceUrl. 1329 */ getResourceUrl()1330 public java.lang.String getResourceUrl() { 1331 java.lang.Object ref = resourceUrl_; 1332 if (!(ref instanceof java.lang.String)) { 1333 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1334 java.lang.String s = bs.toStringUtf8(); 1335 resourceUrl_ = s; 1336 return s; 1337 } else { 1338 return (java.lang.String) ref; 1339 } 1340 } 1341 /** 1342 * 1343 * 1344 * <pre> 1345 * The REST URL for accessing the resource. An HTTP `GET` request using this 1346 * URL returns the resource itself. Example: 1347 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 1348 * This value is unspecified for resources without a REST API. 1349 * </pre> 1350 * 1351 * <code>string resource_url = 4;</code> 1352 * 1353 * @return The bytes for resourceUrl. 1354 */ getResourceUrlBytes()1355 public com.google.protobuf.ByteString getResourceUrlBytes() { 1356 java.lang.Object ref = resourceUrl_; 1357 if (ref instanceof String) { 1358 com.google.protobuf.ByteString b = 1359 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1360 resourceUrl_ = b; 1361 return b; 1362 } else { 1363 return (com.google.protobuf.ByteString) ref; 1364 } 1365 } 1366 /** 1367 * 1368 * 1369 * <pre> 1370 * The REST URL for accessing the resource. An HTTP `GET` request using this 1371 * URL returns the resource itself. Example: 1372 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 1373 * This value is unspecified for resources without a REST API. 1374 * </pre> 1375 * 1376 * <code>string resource_url = 4;</code> 1377 * 1378 * @param value The resourceUrl to set. 1379 * @return This builder for chaining. 1380 */ setResourceUrl(java.lang.String value)1381 public Builder setResourceUrl(java.lang.String value) { 1382 if (value == null) { 1383 throw new NullPointerException(); 1384 } 1385 resourceUrl_ = value; 1386 bitField0_ |= 0x00000008; 1387 onChanged(); 1388 return this; 1389 } 1390 /** 1391 * 1392 * 1393 * <pre> 1394 * The REST URL for accessing the resource. An HTTP `GET` request using this 1395 * URL returns the resource itself. Example: 1396 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 1397 * This value is unspecified for resources without a REST API. 1398 * </pre> 1399 * 1400 * <code>string resource_url = 4;</code> 1401 * 1402 * @return This builder for chaining. 1403 */ clearResourceUrl()1404 public Builder clearResourceUrl() { 1405 resourceUrl_ = getDefaultInstance().getResourceUrl(); 1406 bitField0_ = (bitField0_ & ~0x00000008); 1407 onChanged(); 1408 return this; 1409 } 1410 /** 1411 * 1412 * 1413 * <pre> 1414 * The REST URL for accessing the resource. An HTTP `GET` request using this 1415 * URL returns the resource itself. Example: 1416 * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` 1417 * This value is unspecified for resources without a REST API. 1418 * </pre> 1419 * 1420 * <code>string resource_url = 4;</code> 1421 * 1422 * @param value The bytes for resourceUrl to set. 1423 * @return This builder for chaining. 1424 */ setResourceUrlBytes(com.google.protobuf.ByteString value)1425 public Builder setResourceUrlBytes(com.google.protobuf.ByteString value) { 1426 if (value == null) { 1427 throw new NullPointerException(); 1428 } 1429 checkByteStringIsUtf8(value); 1430 resourceUrl_ = value; 1431 bitField0_ |= 0x00000008; 1432 onChanged(); 1433 return this; 1434 } 1435 1436 private java.lang.Object parent_ = ""; 1437 /** 1438 * 1439 * 1440 * <pre> 1441 * The full name of the immediate parent of this resource. See 1442 * [Resource 1443 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 1444 * for more information. 1445 * For Google Cloud assets, this value is the parent resource defined in the 1446 * [IAM policy 1447 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 1448 * Example: 1449 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 1450 * For third-party assets, this field may be set differently. 1451 * </pre> 1452 * 1453 * <code>string parent = 5;</code> 1454 * 1455 * @return The parent. 1456 */ getParent()1457 public java.lang.String getParent() { 1458 java.lang.Object ref = parent_; 1459 if (!(ref instanceof java.lang.String)) { 1460 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1461 java.lang.String s = bs.toStringUtf8(); 1462 parent_ = s; 1463 return s; 1464 } else { 1465 return (java.lang.String) ref; 1466 } 1467 } 1468 /** 1469 * 1470 * 1471 * <pre> 1472 * The full name of the immediate parent of this resource. See 1473 * [Resource 1474 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 1475 * for more information. 1476 * For Google Cloud assets, this value is the parent resource defined in the 1477 * [IAM policy 1478 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 1479 * Example: 1480 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 1481 * For third-party assets, this field may be set differently. 1482 * </pre> 1483 * 1484 * <code>string parent = 5;</code> 1485 * 1486 * @return The bytes for parent. 1487 */ getParentBytes()1488 public com.google.protobuf.ByteString getParentBytes() { 1489 java.lang.Object ref = parent_; 1490 if (ref instanceof String) { 1491 com.google.protobuf.ByteString b = 1492 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1493 parent_ = b; 1494 return b; 1495 } else { 1496 return (com.google.protobuf.ByteString) ref; 1497 } 1498 } 1499 /** 1500 * 1501 * 1502 * <pre> 1503 * The full name of the immediate parent of this resource. See 1504 * [Resource 1505 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 1506 * for more information. 1507 * For Google Cloud assets, this value is the parent resource defined in the 1508 * [IAM policy 1509 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 1510 * Example: 1511 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 1512 * For third-party assets, this field may be set differently. 1513 * </pre> 1514 * 1515 * <code>string parent = 5;</code> 1516 * 1517 * @param value The parent to set. 1518 * @return This builder for chaining. 1519 */ setParent(java.lang.String value)1520 public Builder setParent(java.lang.String value) { 1521 if (value == null) { 1522 throw new NullPointerException(); 1523 } 1524 parent_ = value; 1525 bitField0_ |= 0x00000010; 1526 onChanged(); 1527 return this; 1528 } 1529 /** 1530 * 1531 * 1532 * <pre> 1533 * The full name of the immediate parent of this resource. See 1534 * [Resource 1535 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 1536 * for more information. 1537 * For Google Cloud assets, this value is the parent resource defined in the 1538 * [IAM policy 1539 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 1540 * Example: 1541 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 1542 * For third-party assets, this field may be set differently. 1543 * </pre> 1544 * 1545 * <code>string parent = 5;</code> 1546 * 1547 * @return This builder for chaining. 1548 */ clearParent()1549 public Builder clearParent() { 1550 parent_ = getDefaultInstance().getParent(); 1551 bitField0_ = (bitField0_ & ~0x00000010); 1552 onChanged(); 1553 return this; 1554 } 1555 /** 1556 * 1557 * 1558 * <pre> 1559 * The full name of the immediate parent of this resource. See 1560 * [Resource 1561 * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) 1562 * for more information. 1563 * For Google Cloud assets, this value is the parent resource defined in the 1564 * [IAM policy 1565 * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). 1566 * Example: 1567 * `//cloudresourcemanager.googleapis.com/projects/my_project_123` 1568 * For third-party assets, this field may be set differently. 1569 * </pre> 1570 * 1571 * <code>string parent = 5;</code> 1572 * 1573 * @param value The bytes for parent to set. 1574 * @return This builder for chaining. 1575 */ setParentBytes(com.google.protobuf.ByteString value)1576 public Builder setParentBytes(com.google.protobuf.ByteString value) { 1577 if (value == null) { 1578 throw new NullPointerException(); 1579 } 1580 checkByteStringIsUtf8(value); 1581 parent_ = value; 1582 bitField0_ |= 0x00000010; 1583 onChanged(); 1584 return this; 1585 } 1586 1587 private com.google.protobuf.Struct data_; 1588 private com.google.protobuf.SingleFieldBuilderV3< 1589 com.google.protobuf.Struct, 1590 com.google.protobuf.Struct.Builder, 1591 com.google.protobuf.StructOrBuilder> 1592 dataBuilder_; 1593 /** 1594 * 1595 * 1596 * <pre> 1597 * The content of the resource, in which some sensitive fields are removed 1598 * and may not be present. 1599 * </pre> 1600 * 1601 * <code>.google.protobuf.Struct data = 6;</code> 1602 * 1603 * @return Whether the data field is set. 1604 */ hasData()1605 public boolean hasData() { 1606 return ((bitField0_ & 0x00000020) != 0); 1607 } 1608 /** 1609 * 1610 * 1611 * <pre> 1612 * The content of the resource, in which some sensitive fields are removed 1613 * and may not be present. 1614 * </pre> 1615 * 1616 * <code>.google.protobuf.Struct data = 6;</code> 1617 * 1618 * @return The data. 1619 */ getData()1620 public com.google.protobuf.Struct getData() { 1621 if (dataBuilder_ == null) { 1622 return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; 1623 } else { 1624 return dataBuilder_.getMessage(); 1625 } 1626 } 1627 /** 1628 * 1629 * 1630 * <pre> 1631 * The content of the resource, in which some sensitive fields are removed 1632 * and may not be present. 1633 * </pre> 1634 * 1635 * <code>.google.protobuf.Struct data = 6;</code> 1636 */ setData(com.google.protobuf.Struct value)1637 public Builder setData(com.google.protobuf.Struct value) { 1638 if (dataBuilder_ == null) { 1639 if (value == null) { 1640 throw new NullPointerException(); 1641 } 1642 data_ = value; 1643 } else { 1644 dataBuilder_.setMessage(value); 1645 } 1646 bitField0_ |= 0x00000020; 1647 onChanged(); 1648 return this; 1649 } 1650 /** 1651 * 1652 * 1653 * <pre> 1654 * The content of the resource, in which some sensitive fields are removed 1655 * and may not be present. 1656 * </pre> 1657 * 1658 * <code>.google.protobuf.Struct data = 6;</code> 1659 */ setData(com.google.protobuf.Struct.Builder builderForValue)1660 public Builder setData(com.google.protobuf.Struct.Builder builderForValue) { 1661 if (dataBuilder_ == null) { 1662 data_ = builderForValue.build(); 1663 } else { 1664 dataBuilder_.setMessage(builderForValue.build()); 1665 } 1666 bitField0_ |= 0x00000020; 1667 onChanged(); 1668 return this; 1669 } 1670 /** 1671 * 1672 * 1673 * <pre> 1674 * The content of the resource, in which some sensitive fields are removed 1675 * and may not be present. 1676 * </pre> 1677 * 1678 * <code>.google.protobuf.Struct data = 6;</code> 1679 */ mergeData(com.google.protobuf.Struct value)1680 public Builder mergeData(com.google.protobuf.Struct value) { 1681 if (dataBuilder_ == null) { 1682 if (((bitField0_ & 0x00000020) != 0) 1683 && data_ != null 1684 && data_ != com.google.protobuf.Struct.getDefaultInstance()) { 1685 getDataBuilder().mergeFrom(value); 1686 } else { 1687 data_ = value; 1688 } 1689 } else { 1690 dataBuilder_.mergeFrom(value); 1691 } 1692 bitField0_ |= 0x00000020; 1693 onChanged(); 1694 return this; 1695 } 1696 /** 1697 * 1698 * 1699 * <pre> 1700 * The content of the resource, in which some sensitive fields are removed 1701 * and may not be present. 1702 * </pre> 1703 * 1704 * <code>.google.protobuf.Struct data = 6;</code> 1705 */ clearData()1706 public Builder clearData() { 1707 bitField0_ = (bitField0_ & ~0x00000020); 1708 data_ = null; 1709 if (dataBuilder_ != null) { 1710 dataBuilder_.dispose(); 1711 dataBuilder_ = null; 1712 } 1713 onChanged(); 1714 return this; 1715 } 1716 /** 1717 * 1718 * 1719 * <pre> 1720 * The content of the resource, in which some sensitive fields are removed 1721 * and may not be present. 1722 * </pre> 1723 * 1724 * <code>.google.protobuf.Struct data = 6;</code> 1725 */ getDataBuilder()1726 public com.google.protobuf.Struct.Builder getDataBuilder() { 1727 bitField0_ |= 0x00000020; 1728 onChanged(); 1729 return getDataFieldBuilder().getBuilder(); 1730 } 1731 /** 1732 * 1733 * 1734 * <pre> 1735 * The content of the resource, in which some sensitive fields are removed 1736 * and may not be present. 1737 * </pre> 1738 * 1739 * <code>.google.protobuf.Struct data = 6;</code> 1740 */ getDataOrBuilder()1741 public com.google.protobuf.StructOrBuilder getDataOrBuilder() { 1742 if (dataBuilder_ != null) { 1743 return dataBuilder_.getMessageOrBuilder(); 1744 } else { 1745 return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; 1746 } 1747 } 1748 /** 1749 * 1750 * 1751 * <pre> 1752 * The content of the resource, in which some sensitive fields are removed 1753 * and may not be present. 1754 * </pre> 1755 * 1756 * <code>.google.protobuf.Struct data = 6;</code> 1757 */ 1758 private com.google.protobuf.SingleFieldBuilderV3< 1759 com.google.protobuf.Struct, 1760 com.google.protobuf.Struct.Builder, 1761 com.google.protobuf.StructOrBuilder> getDataFieldBuilder()1762 getDataFieldBuilder() { 1763 if (dataBuilder_ == null) { 1764 dataBuilder_ = 1765 new com.google.protobuf.SingleFieldBuilderV3< 1766 com.google.protobuf.Struct, 1767 com.google.protobuf.Struct.Builder, 1768 com.google.protobuf.StructOrBuilder>(getData(), getParentForChildren(), isClean()); 1769 data_ = null; 1770 } 1771 return dataBuilder_; 1772 } 1773 1774 private java.lang.Object location_ = ""; 1775 /** 1776 * 1777 * 1778 * <pre> 1779 * The location of the resource in Google Cloud, such as its zone and region. 1780 * For more information, see https://cloud.google.com/about/locations/. 1781 * </pre> 1782 * 1783 * <code>string location = 8;</code> 1784 * 1785 * @return The location. 1786 */ getLocation()1787 public java.lang.String getLocation() { 1788 java.lang.Object ref = location_; 1789 if (!(ref instanceof java.lang.String)) { 1790 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1791 java.lang.String s = bs.toStringUtf8(); 1792 location_ = s; 1793 return s; 1794 } else { 1795 return (java.lang.String) ref; 1796 } 1797 } 1798 /** 1799 * 1800 * 1801 * <pre> 1802 * The location of the resource in Google Cloud, such as its zone and region. 1803 * For more information, see https://cloud.google.com/about/locations/. 1804 * </pre> 1805 * 1806 * <code>string location = 8;</code> 1807 * 1808 * @return The bytes for location. 1809 */ getLocationBytes()1810 public com.google.protobuf.ByteString getLocationBytes() { 1811 java.lang.Object ref = location_; 1812 if (ref instanceof String) { 1813 com.google.protobuf.ByteString b = 1814 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1815 location_ = b; 1816 return b; 1817 } else { 1818 return (com.google.protobuf.ByteString) ref; 1819 } 1820 } 1821 /** 1822 * 1823 * 1824 * <pre> 1825 * The location of the resource in Google Cloud, such as its zone and region. 1826 * For more information, see https://cloud.google.com/about/locations/. 1827 * </pre> 1828 * 1829 * <code>string location = 8;</code> 1830 * 1831 * @param value The location to set. 1832 * @return This builder for chaining. 1833 */ setLocation(java.lang.String value)1834 public Builder setLocation(java.lang.String value) { 1835 if (value == null) { 1836 throw new NullPointerException(); 1837 } 1838 location_ = value; 1839 bitField0_ |= 0x00000040; 1840 onChanged(); 1841 return this; 1842 } 1843 /** 1844 * 1845 * 1846 * <pre> 1847 * The location of the resource in Google Cloud, such as its zone and region. 1848 * For more information, see https://cloud.google.com/about/locations/. 1849 * </pre> 1850 * 1851 * <code>string location = 8;</code> 1852 * 1853 * @return This builder for chaining. 1854 */ clearLocation()1855 public Builder clearLocation() { 1856 location_ = getDefaultInstance().getLocation(); 1857 bitField0_ = (bitField0_ & ~0x00000040); 1858 onChanged(); 1859 return this; 1860 } 1861 /** 1862 * 1863 * 1864 * <pre> 1865 * The location of the resource in Google Cloud, such as its zone and region. 1866 * For more information, see https://cloud.google.com/about/locations/. 1867 * </pre> 1868 * 1869 * <code>string location = 8;</code> 1870 * 1871 * @param value The bytes for location to set. 1872 * @return This builder for chaining. 1873 */ setLocationBytes(com.google.protobuf.ByteString value)1874 public Builder setLocationBytes(com.google.protobuf.ByteString value) { 1875 if (value == null) { 1876 throw new NullPointerException(); 1877 } 1878 checkByteStringIsUtf8(value); 1879 location_ = value; 1880 bitField0_ |= 0x00000040; 1881 onChanged(); 1882 return this; 1883 } 1884 1885 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1886 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1887 return super.setUnknownFields(unknownFields); 1888 } 1889 1890 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1891 public final Builder mergeUnknownFields( 1892 final com.google.protobuf.UnknownFieldSet unknownFields) { 1893 return super.mergeUnknownFields(unknownFields); 1894 } 1895 1896 // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p7beta1.Resource) 1897 } 1898 1899 // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.Resource) 1900 private static final com.google.cloud.asset.v1p7beta1.Resource DEFAULT_INSTANCE; 1901 1902 static { 1903 DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.Resource(); 1904 } 1905 getDefaultInstance()1906 public static com.google.cloud.asset.v1p7beta1.Resource getDefaultInstance() { 1907 return DEFAULT_INSTANCE; 1908 } 1909 1910 private static final com.google.protobuf.Parser<Resource> PARSER = 1911 new com.google.protobuf.AbstractParser<Resource>() { 1912 @java.lang.Override 1913 public Resource parsePartialFrom( 1914 com.google.protobuf.CodedInputStream input, 1915 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1916 throws com.google.protobuf.InvalidProtocolBufferException { 1917 Builder builder = newBuilder(); 1918 try { 1919 builder.mergeFrom(input, extensionRegistry); 1920 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1921 throw e.setUnfinishedMessage(builder.buildPartial()); 1922 } catch (com.google.protobuf.UninitializedMessageException e) { 1923 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1924 } catch (java.io.IOException e) { 1925 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1926 .setUnfinishedMessage(builder.buildPartial()); 1927 } 1928 return builder.buildPartial(); 1929 } 1930 }; 1931 parser()1932 public static com.google.protobuf.Parser<Resource> parser() { 1933 return PARSER; 1934 } 1935 1936 @java.lang.Override getParserForType()1937 public com.google.protobuf.Parser<Resource> getParserForType() { 1938 return PARSER; 1939 } 1940 1941 @java.lang.Override getDefaultInstanceForType()1942 public com.google.cloud.asset.v1p7beta1.Resource getDefaultInstanceForType() { 1943 return DEFAULT_INSTANCE; 1944 } 1945 } 1946