• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/asset/v1/assets.proto
18 
19 package com.google.cloud.asset.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * A representation of a Google Cloud resource.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.asset.v1.Resource}
29  */
30 public final class Resource extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.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.v1.AssetProto
62         .internal_static_google_cloud_asset_v1_Resource_descriptor;
63   }
64 
65   @java.lang.Override
66   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()67       internalGetFieldAccessorTable() {
68     return com.google.cloud.asset.v1.AssetProto
69         .internal_static_google_cloud_asset_v1_Resource_fieldAccessorTable
70         .ensureFieldAccessorsInitialized(
71             com.google.cloud.asset.v1.Resource.class,
72             com.google.cloud.asset.v1.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.v1.Resource)) {
546       return super.equals(obj);
547     }
548     com.google.cloud.asset.v1.Resource other = (com.google.cloud.asset.v1.Resource) obj;
549 
550     if (!getVersion().equals(other.getVersion())) return false;
551     if (!getDiscoveryDocumentUri().equals(other.getDiscoveryDocumentUri())) return false;
552     if (!getDiscoveryName().equals(other.getDiscoveryName())) return false;
553     if (!getResourceUrl().equals(other.getResourceUrl())) return false;
554     if (!getParent().equals(other.getParent())) return false;
555     if (hasData() != other.hasData()) return false;
556     if (hasData()) {
557       if (!getData().equals(other.getData())) return false;
558     }
559     if (!getLocation().equals(other.getLocation())) return false;
560     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
561     return true;
562   }
563 
564   @java.lang.Override
hashCode()565   public int hashCode() {
566     if (memoizedHashCode != 0) {
567       return memoizedHashCode;
568     }
569     int hash = 41;
570     hash = (19 * hash) + getDescriptor().hashCode();
571     hash = (37 * hash) + VERSION_FIELD_NUMBER;
572     hash = (53 * hash) + getVersion().hashCode();
573     hash = (37 * hash) + DISCOVERY_DOCUMENT_URI_FIELD_NUMBER;
574     hash = (53 * hash) + getDiscoveryDocumentUri().hashCode();
575     hash = (37 * hash) + DISCOVERY_NAME_FIELD_NUMBER;
576     hash = (53 * hash) + getDiscoveryName().hashCode();
577     hash = (37 * hash) + RESOURCE_URL_FIELD_NUMBER;
578     hash = (53 * hash) + getResourceUrl().hashCode();
579     hash = (37 * hash) + PARENT_FIELD_NUMBER;
580     hash = (53 * hash) + getParent().hashCode();
581     if (hasData()) {
582       hash = (37 * hash) + DATA_FIELD_NUMBER;
583       hash = (53 * hash) + getData().hashCode();
584     }
585     hash = (37 * hash) + LOCATION_FIELD_NUMBER;
586     hash = (53 * hash) + getLocation().hashCode();
587     hash = (29 * hash) + getUnknownFields().hashCode();
588     memoizedHashCode = hash;
589     return hash;
590   }
591 
parseFrom(java.nio.ByteBuffer data)592   public static com.google.cloud.asset.v1.Resource parseFrom(java.nio.ByteBuffer data)
593       throws com.google.protobuf.InvalidProtocolBufferException {
594     return PARSER.parseFrom(data);
595   }
596 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)597   public static com.google.cloud.asset.v1.Resource parseFrom(
598       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
599       throws com.google.protobuf.InvalidProtocolBufferException {
600     return PARSER.parseFrom(data, extensionRegistry);
601   }
602 
parseFrom(com.google.protobuf.ByteString data)603   public static com.google.cloud.asset.v1.Resource parseFrom(com.google.protobuf.ByteString data)
604       throws com.google.protobuf.InvalidProtocolBufferException {
605     return PARSER.parseFrom(data);
606   }
607 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)608   public static com.google.cloud.asset.v1.Resource parseFrom(
609       com.google.protobuf.ByteString data,
610       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
611       throws com.google.protobuf.InvalidProtocolBufferException {
612     return PARSER.parseFrom(data, extensionRegistry);
613   }
614 
parseFrom(byte[] data)615   public static com.google.cloud.asset.v1.Resource parseFrom(byte[] data)
616       throws com.google.protobuf.InvalidProtocolBufferException {
617     return PARSER.parseFrom(data);
618   }
619 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)620   public static com.google.cloud.asset.v1.Resource parseFrom(
621       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
622       throws com.google.protobuf.InvalidProtocolBufferException {
623     return PARSER.parseFrom(data, extensionRegistry);
624   }
625 
parseFrom(java.io.InputStream input)626   public static com.google.cloud.asset.v1.Resource parseFrom(java.io.InputStream input)
627       throws java.io.IOException {
628     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
629   }
630 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)631   public static com.google.cloud.asset.v1.Resource parseFrom(
632       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
633       throws java.io.IOException {
634     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
635         PARSER, input, extensionRegistry);
636   }
637 
parseDelimitedFrom(java.io.InputStream input)638   public static com.google.cloud.asset.v1.Resource parseDelimitedFrom(java.io.InputStream input)
639       throws java.io.IOException {
640     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
641   }
642 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)643   public static com.google.cloud.asset.v1.Resource parseDelimitedFrom(
644       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
645       throws java.io.IOException {
646     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
647         PARSER, input, extensionRegistry);
648   }
649 
parseFrom( com.google.protobuf.CodedInputStream input)650   public static com.google.cloud.asset.v1.Resource parseFrom(
651       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
652     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
653   }
654 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)655   public static com.google.cloud.asset.v1.Resource parseFrom(
656       com.google.protobuf.CodedInputStream input,
657       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
658       throws java.io.IOException {
659     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
660         PARSER, input, extensionRegistry);
661   }
662 
663   @java.lang.Override
newBuilderForType()664   public Builder newBuilderForType() {
665     return newBuilder();
666   }
667 
newBuilder()668   public static Builder newBuilder() {
669     return DEFAULT_INSTANCE.toBuilder();
670   }
671 
newBuilder(com.google.cloud.asset.v1.Resource prototype)672   public static Builder newBuilder(com.google.cloud.asset.v1.Resource prototype) {
673     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
674   }
675 
676   @java.lang.Override
toBuilder()677   public Builder toBuilder() {
678     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
679   }
680 
681   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)682   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
683     Builder builder = new Builder(parent);
684     return builder;
685   }
686   /**
687    *
688    *
689    * <pre>
690    * A representation of a Google Cloud resource.
691    * </pre>
692    *
693    * Protobuf type {@code google.cloud.asset.v1.Resource}
694    */
695   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
696       implements
697       // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.Resource)
698       com.google.cloud.asset.v1.ResourceOrBuilder {
getDescriptor()699     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
700       return com.google.cloud.asset.v1.AssetProto
701           .internal_static_google_cloud_asset_v1_Resource_descriptor;
702     }
703 
704     @java.lang.Override
705     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()706         internalGetFieldAccessorTable() {
707       return com.google.cloud.asset.v1.AssetProto
708           .internal_static_google_cloud_asset_v1_Resource_fieldAccessorTable
709           .ensureFieldAccessorsInitialized(
710               com.google.cloud.asset.v1.Resource.class,
711               com.google.cloud.asset.v1.Resource.Builder.class);
712     }
713 
714     // Construct using com.google.cloud.asset.v1.Resource.newBuilder()
Builder()715     private Builder() {}
716 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)717     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
718       super(parent);
719     }
720 
721     @java.lang.Override
clear()722     public Builder clear() {
723       super.clear();
724       bitField0_ = 0;
725       version_ = "";
726       discoveryDocumentUri_ = "";
727       discoveryName_ = "";
728       resourceUrl_ = "";
729       parent_ = "";
730       data_ = null;
731       if (dataBuilder_ != null) {
732         dataBuilder_.dispose();
733         dataBuilder_ = null;
734       }
735       location_ = "";
736       return this;
737     }
738 
739     @java.lang.Override
getDescriptorForType()740     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
741       return com.google.cloud.asset.v1.AssetProto
742           .internal_static_google_cloud_asset_v1_Resource_descriptor;
743     }
744 
745     @java.lang.Override
getDefaultInstanceForType()746     public com.google.cloud.asset.v1.Resource getDefaultInstanceForType() {
747       return com.google.cloud.asset.v1.Resource.getDefaultInstance();
748     }
749 
750     @java.lang.Override
build()751     public com.google.cloud.asset.v1.Resource build() {
752       com.google.cloud.asset.v1.Resource result = buildPartial();
753       if (!result.isInitialized()) {
754         throw newUninitializedMessageException(result);
755       }
756       return result;
757     }
758 
759     @java.lang.Override
buildPartial()760     public com.google.cloud.asset.v1.Resource buildPartial() {
761       com.google.cloud.asset.v1.Resource result = new com.google.cloud.asset.v1.Resource(this);
762       if (bitField0_ != 0) {
763         buildPartial0(result);
764       }
765       onBuilt();
766       return result;
767     }
768 
buildPartial0(com.google.cloud.asset.v1.Resource result)769     private void buildPartial0(com.google.cloud.asset.v1.Resource result) {
770       int from_bitField0_ = bitField0_;
771       if (((from_bitField0_ & 0x00000001) != 0)) {
772         result.version_ = version_;
773       }
774       if (((from_bitField0_ & 0x00000002) != 0)) {
775         result.discoveryDocumentUri_ = discoveryDocumentUri_;
776       }
777       if (((from_bitField0_ & 0x00000004) != 0)) {
778         result.discoveryName_ = discoveryName_;
779       }
780       if (((from_bitField0_ & 0x00000008) != 0)) {
781         result.resourceUrl_ = resourceUrl_;
782       }
783       if (((from_bitField0_ & 0x00000010) != 0)) {
784         result.parent_ = parent_;
785       }
786       if (((from_bitField0_ & 0x00000020) != 0)) {
787         result.data_ = dataBuilder_ == null ? data_ : dataBuilder_.build();
788       }
789       if (((from_bitField0_ & 0x00000040) != 0)) {
790         result.location_ = location_;
791       }
792     }
793 
794     @java.lang.Override
clone()795     public Builder clone() {
796       return super.clone();
797     }
798 
799     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)800     public Builder setField(
801         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
802       return super.setField(field, value);
803     }
804 
805     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)806     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
807       return super.clearField(field);
808     }
809 
810     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)811     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
812       return super.clearOneof(oneof);
813     }
814 
815     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)816     public Builder setRepeatedField(
817         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
818       return super.setRepeatedField(field, index, value);
819     }
820 
821     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)822     public Builder addRepeatedField(
823         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
824       return super.addRepeatedField(field, value);
825     }
826 
827     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)828     public Builder mergeFrom(com.google.protobuf.Message other) {
829       if (other instanceof com.google.cloud.asset.v1.Resource) {
830         return mergeFrom((com.google.cloud.asset.v1.Resource) other);
831       } else {
832         super.mergeFrom(other);
833         return this;
834       }
835     }
836 
mergeFrom(com.google.cloud.asset.v1.Resource other)837     public Builder mergeFrom(com.google.cloud.asset.v1.Resource other) {
838       if (other == com.google.cloud.asset.v1.Resource.getDefaultInstance()) return this;
839       if (!other.getVersion().isEmpty()) {
840         version_ = other.version_;
841         bitField0_ |= 0x00000001;
842         onChanged();
843       }
844       if (!other.getDiscoveryDocumentUri().isEmpty()) {
845         discoveryDocumentUri_ = other.discoveryDocumentUri_;
846         bitField0_ |= 0x00000002;
847         onChanged();
848       }
849       if (!other.getDiscoveryName().isEmpty()) {
850         discoveryName_ = other.discoveryName_;
851         bitField0_ |= 0x00000004;
852         onChanged();
853       }
854       if (!other.getResourceUrl().isEmpty()) {
855         resourceUrl_ = other.resourceUrl_;
856         bitField0_ |= 0x00000008;
857         onChanged();
858       }
859       if (!other.getParent().isEmpty()) {
860         parent_ = other.parent_;
861         bitField0_ |= 0x00000010;
862         onChanged();
863       }
864       if (other.hasData()) {
865         mergeData(other.getData());
866       }
867       if (!other.getLocation().isEmpty()) {
868         location_ = other.location_;
869         bitField0_ |= 0x00000040;
870         onChanged();
871       }
872       this.mergeUnknownFields(other.getUnknownFields());
873       onChanged();
874       return this;
875     }
876 
877     @java.lang.Override
isInitialized()878     public final boolean isInitialized() {
879       return true;
880     }
881 
882     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)883     public Builder mergeFrom(
884         com.google.protobuf.CodedInputStream input,
885         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
886         throws java.io.IOException {
887       if (extensionRegistry == null) {
888         throw new java.lang.NullPointerException();
889       }
890       try {
891         boolean done = false;
892         while (!done) {
893           int tag = input.readTag();
894           switch (tag) {
895             case 0:
896               done = true;
897               break;
898             case 10:
899               {
900                 version_ = input.readStringRequireUtf8();
901                 bitField0_ |= 0x00000001;
902                 break;
903               } // case 10
904             case 18:
905               {
906                 discoveryDocumentUri_ = input.readStringRequireUtf8();
907                 bitField0_ |= 0x00000002;
908                 break;
909               } // case 18
910             case 26:
911               {
912                 discoveryName_ = input.readStringRequireUtf8();
913                 bitField0_ |= 0x00000004;
914                 break;
915               } // case 26
916             case 34:
917               {
918                 resourceUrl_ = input.readStringRequireUtf8();
919                 bitField0_ |= 0x00000008;
920                 break;
921               } // case 34
922             case 42:
923               {
924                 parent_ = input.readStringRequireUtf8();
925                 bitField0_ |= 0x00000010;
926                 break;
927               } // case 42
928             case 50:
929               {
930                 input.readMessage(getDataFieldBuilder().getBuilder(), extensionRegistry);
931                 bitField0_ |= 0x00000020;
932                 break;
933               } // case 50
934             case 66:
935               {
936                 location_ = input.readStringRequireUtf8();
937                 bitField0_ |= 0x00000040;
938                 break;
939               } // case 66
940             default:
941               {
942                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
943                   done = true; // was an endgroup tag
944                 }
945                 break;
946               } // default:
947           } // switch (tag)
948         } // while (!done)
949       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
950         throw e.unwrapIOException();
951       } finally {
952         onChanged();
953       } // finally
954       return this;
955     }
956 
957     private int bitField0_;
958 
959     private java.lang.Object version_ = "";
960     /**
961      *
962      *
963      * <pre>
964      * The API version. Example: `v1`
965      * </pre>
966      *
967      * <code>string version = 1;</code>
968      *
969      * @return The version.
970      */
getVersion()971     public java.lang.String getVersion() {
972       java.lang.Object ref = version_;
973       if (!(ref instanceof java.lang.String)) {
974         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
975         java.lang.String s = bs.toStringUtf8();
976         version_ = s;
977         return s;
978       } else {
979         return (java.lang.String) ref;
980       }
981     }
982     /**
983      *
984      *
985      * <pre>
986      * The API version. Example: `v1`
987      * </pre>
988      *
989      * <code>string version = 1;</code>
990      *
991      * @return The bytes for version.
992      */
getVersionBytes()993     public com.google.protobuf.ByteString getVersionBytes() {
994       java.lang.Object ref = version_;
995       if (ref instanceof String) {
996         com.google.protobuf.ByteString b =
997             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
998         version_ = b;
999         return b;
1000       } else {
1001         return (com.google.protobuf.ByteString) ref;
1002       }
1003     }
1004     /**
1005      *
1006      *
1007      * <pre>
1008      * The API version. Example: `v1`
1009      * </pre>
1010      *
1011      * <code>string version = 1;</code>
1012      *
1013      * @param value The version to set.
1014      * @return This builder for chaining.
1015      */
setVersion(java.lang.String value)1016     public Builder setVersion(java.lang.String value) {
1017       if (value == null) {
1018         throw new NullPointerException();
1019       }
1020       version_ = value;
1021       bitField0_ |= 0x00000001;
1022       onChanged();
1023       return this;
1024     }
1025     /**
1026      *
1027      *
1028      * <pre>
1029      * The API version. Example: `v1`
1030      * </pre>
1031      *
1032      * <code>string version = 1;</code>
1033      *
1034      * @return This builder for chaining.
1035      */
clearVersion()1036     public Builder clearVersion() {
1037       version_ = getDefaultInstance().getVersion();
1038       bitField0_ = (bitField0_ & ~0x00000001);
1039       onChanged();
1040       return this;
1041     }
1042     /**
1043      *
1044      *
1045      * <pre>
1046      * The API version. Example: `v1`
1047      * </pre>
1048      *
1049      * <code>string version = 1;</code>
1050      *
1051      * @param value The bytes for version to set.
1052      * @return This builder for chaining.
1053      */
setVersionBytes(com.google.protobuf.ByteString value)1054     public Builder setVersionBytes(com.google.protobuf.ByteString value) {
1055       if (value == null) {
1056         throw new NullPointerException();
1057       }
1058       checkByteStringIsUtf8(value);
1059       version_ = value;
1060       bitField0_ |= 0x00000001;
1061       onChanged();
1062       return this;
1063     }
1064 
1065     private java.lang.Object discoveryDocumentUri_ = "";
1066     /**
1067      *
1068      *
1069      * <pre>
1070      * The URL of the discovery document containing the resource's JSON schema.
1071      * Example:
1072      * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
1073      * This value is unspecified for resources that do not have an API based on a
1074      * discovery document, such as Cloud Bigtable.
1075      * </pre>
1076      *
1077      * <code>string discovery_document_uri = 2;</code>
1078      *
1079      * @return The discoveryDocumentUri.
1080      */
getDiscoveryDocumentUri()1081     public java.lang.String getDiscoveryDocumentUri() {
1082       java.lang.Object ref = discoveryDocumentUri_;
1083       if (!(ref instanceof java.lang.String)) {
1084         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1085         java.lang.String s = bs.toStringUtf8();
1086         discoveryDocumentUri_ = s;
1087         return s;
1088       } else {
1089         return (java.lang.String) ref;
1090       }
1091     }
1092     /**
1093      *
1094      *
1095      * <pre>
1096      * The URL of the discovery document containing the resource's JSON schema.
1097      * Example:
1098      * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
1099      * This value is unspecified for resources that do not have an API based on a
1100      * discovery document, such as Cloud Bigtable.
1101      * </pre>
1102      *
1103      * <code>string discovery_document_uri = 2;</code>
1104      *
1105      * @return The bytes for discoveryDocumentUri.
1106      */
getDiscoveryDocumentUriBytes()1107     public com.google.protobuf.ByteString getDiscoveryDocumentUriBytes() {
1108       java.lang.Object ref = discoveryDocumentUri_;
1109       if (ref instanceof String) {
1110         com.google.protobuf.ByteString b =
1111             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1112         discoveryDocumentUri_ = b;
1113         return b;
1114       } else {
1115         return (com.google.protobuf.ByteString) ref;
1116       }
1117     }
1118     /**
1119      *
1120      *
1121      * <pre>
1122      * The URL of the discovery document containing the resource's JSON schema.
1123      * Example:
1124      * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
1125      * This value is unspecified for resources that do not have an API based on a
1126      * discovery document, such as Cloud Bigtable.
1127      * </pre>
1128      *
1129      * <code>string discovery_document_uri = 2;</code>
1130      *
1131      * @param value The discoveryDocumentUri to set.
1132      * @return This builder for chaining.
1133      */
setDiscoveryDocumentUri(java.lang.String value)1134     public Builder setDiscoveryDocumentUri(java.lang.String value) {
1135       if (value == null) {
1136         throw new NullPointerException();
1137       }
1138       discoveryDocumentUri_ = value;
1139       bitField0_ |= 0x00000002;
1140       onChanged();
1141       return this;
1142     }
1143     /**
1144      *
1145      *
1146      * <pre>
1147      * The URL of the discovery document containing the resource's JSON schema.
1148      * Example:
1149      * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
1150      * This value is unspecified for resources that do not have an API based on a
1151      * discovery document, such as Cloud Bigtable.
1152      * </pre>
1153      *
1154      * <code>string discovery_document_uri = 2;</code>
1155      *
1156      * @return This builder for chaining.
1157      */
clearDiscoveryDocumentUri()1158     public Builder clearDiscoveryDocumentUri() {
1159       discoveryDocumentUri_ = getDefaultInstance().getDiscoveryDocumentUri();
1160       bitField0_ = (bitField0_ & ~0x00000002);
1161       onChanged();
1162       return this;
1163     }
1164     /**
1165      *
1166      *
1167      * <pre>
1168      * The URL of the discovery document containing the resource's JSON schema.
1169      * Example:
1170      * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
1171      * This value is unspecified for resources that do not have an API based on a
1172      * discovery document, such as Cloud Bigtable.
1173      * </pre>
1174      *
1175      * <code>string discovery_document_uri = 2;</code>
1176      *
1177      * @param value The bytes for discoveryDocumentUri to set.
1178      * @return This builder for chaining.
1179      */
setDiscoveryDocumentUriBytes(com.google.protobuf.ByteString value)1180     public Builder setDiscoveryDocumentUriBytes(com.google.protobuf.ByteString value) {
1181       if (value == null) {
1182         throw new NullPointerException();
1183       }
1184       checkByteStringIsUtf8(value);
1185       discoveryDocumentUri_ = value;
1186       bitField0_ |= 0x00000002;
1187       onChanged();
1188       return this;
1189     }
1190 
1191     private java.lang.Object discoveryName_ = "";
1192     /**
1193      *
1194      *
1195      * <pre>
1196      * The JSON schema name listed in the discovery document. Example:
1197      * `Project`
1198      * This value is unspecified for resources that do not have an API based on a
1199      * discovery document, such as Cloud Bigtable.
1200      * </pre>
1201      *
1202      * <code>string discovery_name = 3;</code>
1203      *
1204      * @return The discoveryName.
1205      */
getDiscoveryName()1206     public java.lang.String getDiscoveryName() {
1207       java.lang.Object ref = discoveryName_;
1208       if (!(ref instanceof java.lang.String)) {
1209         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1210         java.lang.String s = bs.toStringUtf8();
1211         discoveryName_ = s;
1212         return s;
1213       } else {
1214         return (java.lang.String) ref;
1215       }
1216     }
1217     /**
1218      *
1219      *
1220      * <pre>
1221      * The JSON schema name listed in the discovery document. Example:
1222      * `Project`
1223      * This value is unspecified for resources that do not have an API based on a
1224      * discovery document, such as Cloud Bigtable.
1225      * </pre>
1226      *
1227      * <code>string discovery_name = 3;</code>
1228      *
1229      * @return The bytes for discoveryName.
1230      */
getDiscoveryNameBytes()1231     public com.google.protobuf.ByteString getDiscoveryNameBytes() {
1232       java.lang.Object ref = discoveryName_;
1233       if (ref instanceof String) {
1234         com.google.protobuf.ByteString b =
1235             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1236         discoveryName_ = b;
1237         return b;
1238       } else {
1239         return (com.google.protobuf.ByteString) ref;
1240       }
1241     }
1242     /**
1243      *
1244      *
1245      * <pre>
1246      * The JSON schema name listed in the discovery document. Example:
1247      * `Project`
1248      * This value is unspecified for resources that do not have an API based on a
1249      * discovery document, such as Cloud Bigtable.
1250      * </pre>
1251      *
1252      * <code>string discovery_name = 3;</code>
1253      *
1254      * @param value The discoveryName to set.
1255      * @return This builder for chaining.
1256      */
setDiscoveryName(java.lang.String value)1257     public Builder setDiscoveryName(java.lang.String value) {
1258       if (value == null) {
1259         throw new NullPointerException();
1260       }
1261       discoveryName_ = value;
1262       bitField0_ |= 0x00000004;
1263       onChanged();
1264       return this;
1265     }
1266     /**
1267      *
1268      *
1269      * <pre>
1270      * The JSON schema name listed in the discovery document. Example:
1271      * `Project`
1272      * This value is unspecified for resources that do not have an API based on a
1273      * discovery document, such as Cloud Bigtable.
1274      * </pre>
1275      *
1276      * <code>string discovery_name = 3;</code>
1277      *
1278      * @return This builder for chaining.
1279      */
clearDiscoveryName()1280     public Builder clearDiscoveryName() {
1281       discoveryName_ = getDefaultInstance().getDiscoveryName();
1282       bitField0_ = (bitField0_ & ~0x00000004);
1283       onChanged();
1284       return this;
1285     }
1286     /**
1287      *
1288      *
1289      * <pre>
1290      * The JSON schema name listed in the discovery document. Example:
1291      * `Project`
1292      * This value is unspecified for resources that do not have an API based on a
1293      * discovery document, such as Cloud Bigtable.
1294      * </pre>
1295      *
1296      * <code>string discovery_name = 3;</code>
1297      *
1298      * @param value The bytes for discoveryName to set.
1299      * @return This builder for chaining.
1300      */
setDiscoveryNameBytes(com.google.protobuf.ByteString value)1301     public Builder setDiscoveryNameBytes(com.google.protobuf.ByteString value) {
1302       if (value == null) {
1303         throw new NullPointerException();
1304       }
1305       checkByteStringIsUtf8(value);
1306       discoveryName_ = value;
1307       bitField0_ |= 0x00000004;
1308       onChanged();
1309       return this;
1310     }
1311 
1312     private java.lang.Object resourceUrl_ = "";
1313     /**
1314      *
1315      *
1316      * <pre>
1317      * The REST URL for accessing the resource. An HTTP `GET` request using this
1318      * URL returns the resource itself. Example:
1319      * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
1320      * This value is unspecified for resources without a REST API.
1321      * </pre>
1322      *
1323      * <code>string resource_url = 4;</code>
1324      *
1325      * @return The resourceUrl.
1326      */
getResourceUrl()1327     public java.lang.String getResourceUrl() {
1328       java.lang.Object ref = resourceUrl_;
1329       if (!(ref instanceof java.lang.String)) {
1330         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1331         java.lang.String s = bs.toStringUtf8();
1332         resourceUrl_ = s;
1333         return s;
1334       } else {
1335         return (java.lang.String) ref;
1336       }
1337     }
1338     /**
1339      *
1340      *
1341      * <pre>
1342      * The REST URL for accessing the resource. An HTTP `GET` request using this
1343      * URL returns the resource itself. Example:
1344      * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
1345      * This value is unspecified for resources without a REST API.
1346      * </pre>
1347      *
1348      * <code>string resource_url = 4;</code>
1349      *
1350      * @return The bytes for resourceUrl.
1351      */
getResourceUrlBytes()1352     public com.google.protobuf.ByteString getResourceUrlBytes() {
1353       java.lang.Object ref = resourceUrl_;
1354       if (ref instanceof String) {
1355         com.google.protobuf.ByteString b =
1356             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1357         resourceUrl_ = b;
1358         return b;
1359       } else {
1360         return (com.google.protobuf.ByteString) ref;
1361       }
1362     }
1363     /**
1364      *
1365      *
1366      * <pre>
1367      * The REST URL for accessing the resource. An HTTP `GET` request using this
1368      * URL returns the resource itself. Example:
1369      * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
1370      * This value is unspecified for resources without a REST API.
1371      * </pre>
1372      *
1373      * <code>string resource_url = 4;</code>
1374      *
1375      * @param value The resourceUrl to set.
1376      * @return This builder for chaining.
1377      */
setResourceUrl(java.lang.String value)1378     public Builder setResourceUrl(java.lang.String value) {
1379       if (value == null) {
1380         throw new NullPointerException();
1381       }
1382       resourceUrl_ = value;
1383       bitField0_ |= 0x00000008;
1384       onChanged();
1385       return this;
1386     }
1387     /**
1388      *
1389      *
1390      * <pre>
1391      * The REST URL for accessing the resource. An HTTP `GET` request using this
1392      * URL returns the resource itself. Example:
1393      * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
1394      * This value is unspecified for resources without a REST API.
1395      * </pre>
1396      *
1397      * <code>string resource_url = 4;</code>
1398      *
1399      * @return This builder for chaining.
1400      */
clearResourceUrl()1401     public Builder clearResourceUrl() {
1402       resourceUrl_ = getDefaultInstance().getResourceUrl();
1403       bitField0_ = (bitField0_ & ~0x00000008);
1404       onChanged();
1405       return this;
1406     }
1407     /**
1408      *
1409      *
1410      * <pre>
1411      * The REST URL for accessing the resource. An HTTP `GET` request using this
1412      * URL returns the resource itself. Example:
1413      * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
1414      * This value is unspecified for resources without a REST API.
1415      * </pre>
1416      *
1417      * <code>string resource_url = 4;</code>
1418      *
1419      * @param value The bytes for resourceUrl to set.
1420      * @return This builder for chaining.
1421      */
setResourceUrlBytes(com.google.protobuf.ByteString value)1422     public Builder setResourceUrlBytes(com.google.protobuf.ByteString value) {
1423       if (value == null) {
1424         throw new NullPointerException();
1425       }
1426       checkByteStringIsUtf8(value);
1427       resourceUrl_ = value;
1428       bitField0_ |= 0x00000008;
1429       onChanged();
1430       return this;
1431     }
1432 
1433     private java.lang.Object parent_ = "";
1434     /**
1435      *
1436      *
1437      * <pre>
1438      * The full name of the immediate parent of this resource. See
1439      * [Resource
1440      * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
1441      * for more information.
1442      * For Google Cloud assets, this value is the parent resource defined in the
1443      * [IAM policy
1444      * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
1445      * Example:
1446      * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
1447      * For third-party assets, this field may be set differently.
1448      * </pre>
1449      *
1450      * <code>string parent = 5;</code>
1451      *
1452      * @return The parent.
1453      */
getParent()1454     public java.lang.String getParent() {
1455       java.lang.Object ref = parent_;
1456       if (!(ref instanceof java.lang.String)) {
1457         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1458         java.lang.String s = bs.toStringUtf8();
1459         parent_ = s;
1460         return s;
1461       } else {
1462         return (java.lang.String) ref;
1463       }
1464     }
1465     /**
1466      *
1467      *
1468      * <pre>
1469      * The full name of the immediate parent of this resource. See
1470      * [Resource
1471      * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
1472      * for more information.
1473      * For Google Cloud assets, this value is the parent resource defined in the
1474      * [IAM policy
1475      * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
1476      * Example:
1477      * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
1478      * For third-party assets, this field may be set differently.
1479      * </pre>
1480      *
1481      * <code>string parent = 5;</code>
1482      *
1483      * @return The bytes for parent.
1484      */
getParentBytes()1485     public com.google.protobuf.ByteString getParentBytes() {
1486       java.lang.Object ref = parent_;
1487       if (ref instanceof String) {
1488         com.google.protobuf.ByteString b =
1489             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1490         parent_ = b;
1491         return b;
1492       } else {
1493         return (com.google.protobuf.ByteString) ref;
1494       }
1495     }
1496     /**
1497      *
1498      *
1499      * <pre>
1500      * The full name of the immediate parent of this resource. See
1501      * [Resource
1502      * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
1503      * for more information.
1504      * For Google Cloud assets, this value is the parent resource defined in the
1505      * [IAM policy
1506      * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
1507      * Example:
1508      * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
1509      * For third-party assets, this field may be set differently.
1510      * </pre>
1511      *
1512      * <code>string parent = 5;</code>
1513      *
1514      * @param value The parent to set.
1515      * @return This builder for chaining.
1516      */
setParent(java.lang.String value)1517     public Builder setParent(java.lang.String value) {
1518       if (value == null) {
1519         throw new NullPointerException();
1520       }
1521       parent_ = value;
1522       bitField0_ |= 0x00000010;
1523       onChanged();
1524       return this;
1525     }
1526     /**
1527      *
1528      *
1529      * <pre>
1530      * The full name of the immediate parent of this resource. See
1531      * [Resource
1532      * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
1533      * for more information.
1534      * For Google Cloud assets, this value is the parent resource defined in the
1535      * [IAM policy
1536      * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
1537      * Example:
1538      * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
1539      * For third-party assets, this field may be set differently.
1540      * </pre>
1541      *
1542      * <code>string parent = 5;</code>
1543      *
1544      * @return This builder for chaining.
1545      */
clearParent()1546     public Builder clearParent() {
1547       parent_ = getDefaultInstance().getParent();
1548       bitField0_ = (bitField0_ & ~0x00000010);
1549       onChanged();
1550       return this;
1551     }
1552     /**
1553      *
1554      *
1555      * <pre>
1556      * The full name of the immediate parent of this resource. See
1557      * [Resource
1558      * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
1559      * for more information.
1560      * For Google Cloud assets, this value is the parent resource defined in the
1561      * [IAM policy
1562      * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
1563      * Example:
1564      * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
1565      * For third-party assets, this field may be set differently.
1566      * </pre>
1567      *
1568      * <code>string parent = 5;</code>
1569      *
1570      * @param value The bytes for parent to set.
1571      * @return This builder for chaining.
1572      */
setParentBytes(com.google.protobuf.ByteString value)1573     public Builder setParentBytes(com.google.protobuf.ByteString value) {
1574       if (value == null) {
1575         throw new NullPointerException();
1576       }
1577       checkByteStringIsUtf8(value);
1578       parent_ = value;
1579       bitField0_ |= 0x00000010;
1580       onChanged();
1581       return this;
1582     }
1583 
1584     private com.google.protobuf.Struct data_;
1585     private com.google.protobuf.SingleFieldBuilderV3<
1586             com.google.protobuf.Struct,
1587             com.google.protobuf.Struct.Builder,
1588             com.google.protobuf.StructOrBuilder>
1589         dataBuilder_;
1590     /**
1591      *
1592      *
1593      * <pre>
1594      * The content of the resource, in which some sensitive fields are removed
1595      * and may not be present.
1596      * </pre>
1597      *
1598      * <code>.google.protobuf.Struct data = 6;</code>
1599      *
1600      * @return Whether the data field is set.
1601      */
hasData()1602     public boolean hasData() {
1603       return ((bitField0_ & 0x00000020) != 0);
1604     }
1605     /**
1606      *
1607      *
1608      * <pre>
1609      * The content of the resource, in which some sensitive fields are removed
1610      * and may not be present.
1611      * </pre>
1612      *
1613      * <code>.google.protobuf.Struct data = 6;</code>
1614      *
1615      * @return The data.
1616      */
getData()1617     public com.google.protobuf.Struct getData() {
1618       if (dataBuilder_ == null) {
1619         return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_;
1620       } else {
1621         return dataBuilder_.getMessage();
1622       }
1623     }
1624     /**
1625      *
1626      *
1627      * <pre>
1628      * The content of the resource, in which some sensitive fields are removed
1629      * and may not be present.
1630      * </pre>
1631      *
1632      * <code>.google.protobuf.Struct data = 6;</code>
1633      */
setData(com.google.protobuf.Struct value)1634     public Builder setData(com.google.protobuf.Struct value) {
1635       if (dataBuilder_ == null) {
1636         if (value == null) {
1637           throw new NullPointerException();
1638         }
1639         data_ = value;
1640       } else {
1641         dataBuilder_.setMessage(value);
1642       }
1643       bitField0_ |= 0x00000020;
1644       onChanged();
1645       return this;
1646     }
1647     /**
1648      *
1649      *
1650      * <pre>
1651      * The content of the resource, in which some sensitive fields are removed
1652      * and may not be present.
1653      * </pre>
1654      *
1655      * <code>.google.protobuf.Struct data = 6;</code>
1656      */
setData(com.google.protobuf.Struct.Builder builderForValue)1657     public Builder setData(com.google.protobuf.Struct.Builder builderForValue) {
1658       if (dataBuilder_ == null) {
1659         data_ = builderForValue.build();
1660       } else {
1661         dataBuilder_.setMessage(builderForValue.build());
1662       }
1663       bitField0_ |= 0x00000020;
1664       onChanged();
1665       return this;
1666     }
1667     /**
1668      *
1669      *
1670      * <pre>
1671      * The content of the resource, in which some sensitive fields are removed
1672      * and may not be present.
1673      * </pre>
1674      *
1675      * <code>.google.protobuf.Struct data = 6;</code>
1676      */
mergeData(com.google.protobuf.Struct value)1677     public Builder mergeData(com.google.protobuf.Struct value) {
1678       if (dataBuilder_ == null) {
1679         if (((bitField0_ & 0x00000020) != 0)
1680             && data_ != null
1681             && data_ != com.google.protobuf.Struct.getDefaultInstance()) {
1682           getDataBuilder().mergeFrom(value);
1683         } else {
1684           data_ = value;
1685         }
1686       } else {
1687         dataBuilder_.mergeFrom(value);
1688       }
1689       bitField0_ |= 0x00000020;
1690       onChanged();
1691       return this;
1692     }
1693     /**
1694      *
1695      *
1696      * <pre>
1697      * The content of the resource, in which some sensitive fields are removed
1698      * and may not be present.
1699      * </pre>
1700      *
1701      * <code>.google.protobuf.Struct data = 6;</code>
1702      */
clearData()1703     public Builder clearData() {
1704       bitField0_ = (bitField0_ & ~0x00000020);
1705       data_ = null;
1706       if (dataBuilder_ != null) {
1707         dataBuilder_.dispose();
1708         dataBuilder_ = null;
1709       }
1710       onChanged();
1711       return this;
1712     }
1713     /**
1714      *
1715      *
1716      * <pre>
1717      * The content of the resource, in which some sensitive fields are removed
1718      * and may not be present.
1719      * </pre>
1720      *
1721      * <code>.google.protobuf.Struct data = 6;</code>
1722      */
getDataBuilder()1723     public com.google.protobuf.Struct.Builder getDataBuilder() {
1724       bitField0_ |= 0x00000020;
1725       onChanged();
1726       return getDataFieldBuilder().getBuilder();
1727     }
1728     /**
1729      *
1730      *
1731      * <pre>
1732      * The content of the resource, in which some sensitive fields are removed
1733      * and may not be present.
1734      * </pre>
1735      *
1736      * <code>.google.protobuf.Struct data = 6;</code>
1737      */
getDataOrBuilder()1738     public com.google.protobuf.StructOrBuilder getDataOrBuilder() {
1739       if (dataBuilder_ != null) {
1740         return dataBuilder_.getMessageOrBuilder();
1741       } else {
1742         return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_;
1743       }
1744     }
1745     /**
1746      *
1747      *
1748      * <pre>
1749      * The content of the resource, in which some sensitive fields are removed
1750      * and may not be present.
1751      * </pre>
1752      *
1753      * <code>.google.protobuf.Struct data = 6;</code>
1754      */
1755     private com.google.protobuf.SingleFieldBuilderV3<
1756             com.google.protobuf.Struct,
1757             com.google.protobuf.Struct.Builder,
1758             com.google.protobuf.StructOrBuilder>
getDataFieldBuilder()1759         getDataFieldBuilder() {
1760       if (dataBuilder_ == null) {
1761         dataBuilder_ =
1762             new com.google.protobuf.SingleFieldBuilderV3<
1763                 com.google.protobuf.Struct,
1764                 com.google.protobuf.Struct.Builder,
1765                 com.google.protobuf.StructOrBuilder>(getData(), getParentForChildren(), isClean());
1766         data_ = null;
1767       }
1768       return dataBuilder_;
1769     }
1770 
1771     private java.lang.Object location_ = "";
1772     /**
1773      *
1774      *
1775      * <pre>
1776      * The location of the resource in Google Cloud, such as its zone and region.
1777      * For more information, see https://cloud.google.com/about/locations/.
1778      * </pre>
1779      *
1780      * <code>string location = 8;</code>
1781      *
1782      * @return The location.
1783      */
getLocation()1784     public java.lang.String getLocation() {
1785       java.lang.Object ref = location_;
1786       if (!(ref instanceof java.lang.String)) {
1787         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1788         java.lang.String s = bs.toStringUtf8();
1789         location_ = s;
1790         return s;
1791       } else {
1792         return (java.lang.String) ref;
1793       }
1794     }
1795     /**
1796      *
1797      *
1798      * <pre>
1799      * The location of the resource in Google Cloud, such as its zone and region.
1800      * For more information, see https://cloud.google.com/about/locations/.
1801      * </pre>
1802      *
1803      * <code>string location = 8;</code>
1804      *
1805      * @return The bytes for location.
1806      */
getLocationBytes()1807     public com.google.protobuf.ByteString getLocationBytes() {
1808       java.lang.Object ref = location_;
1809       if (ref instanceof String) {
1810         com.google.protobuf.ByteString b =
1811             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1812         location_ = b;
1813         return b;
1814       } else {
1815         return (com.google.protobuf.ByteString) ref;
1816       }
1817     }
1818     /**
1819      *
1820      *
1821      * <pre>
1822      * The location of the resource in Google Cloud, such as its zone and region.
1823      * For more information, see https://cloud.google.com/about/locations/.
1824      * </pre>
1825      *
1826      * <code>string location = 8;</code>
1827      *
1828      * @param value The location to set.
1829      * @return This builder for chaining.
1830      */
setLocation(java.lang.String value)1831     public Builder setLocation(java.lang.String value) {
1832       if (value == null) {
1833         throw new NullPointerException();
1834       }
1835       location_ = value;
1836       bitField0_ |= 0x00000040;
1837       onChanged();
1838       return this;
1839     }
1840     /**
1841      *
1842      *
1843      * <pre>
1844      * The location of the resource in Google Cloud, such as its zone and region.
1845      * For more information, see https://cloud.google.com/about/locations/.
1846      * </pre>
1847      *
1848      * <code>string location = 8;</code>
1849      *
1850      * @return This builder for chaining.
1851      */
clearLocation()1852     public Builder clearLocation() {
1853       location_ = getDefaultInstance().getLocation();
1854       bitField0_ = (bitField0_ & ~0x00000040);
1855       onChanged();
1856       return this;
1857     }
1858     /**
1859      *
1860      *
1861      * <pre>
1862      * The location of the resource in Google Cloud, such as its zone and region.
1863      * For more information, see https://cloud.google.com/about/locations/.
1864      * </pre>
1865      *
1866      * <code>string location = 8;</code>
1867      *
1868      * @param value The bytes for location to set.
1869      * @return This builder for chaining.
1870      */
setLocationBytes(com.google.protobuf.ByteString value)1871     public Builder setLocationBytes(com.google.protobuf.ByteString value) {
1872       if (value == null) {
1873         throw new NullPointerException();
1874       }
1875       checkByteStringIsUtf8(value);
1876       location_ = value;
1877       bitField0_ |= 0x00000040;
1878       onChanged();
1879       return this;
1880     }
1881 
1882     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1883     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1884       return super.setUnknownFields(unknownFields);
1885     }
1886 
1887     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1888     public final Builder mergeUnknownFields(
1889         final com.google.protobuf.UnknownFieldSet unknownFields) {
1890       return super.mergeUnknownFields(unknownFields);
1891     }
1892 
1893     // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1.Resource)
1894   }
1895 
1896   // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.Resource)
1897   private static final com.google.cloud.asset.v1.Resource DEFAULT_INSTANCE;
1898 
1899   static {
1900     DEFAULT_INSTANCE = new com.google.cloud.asset.v1.Resource();
1901   }
1902 
getDefaultInstance()1903   public static com.google.cloud.asset.v1.Resource getDefaultInstance() {
1904     return DEFAULT_INSTANCE;
1905   }
1906 
1907   private static final com.google.protobuf.Parser<Resource> PARSER =
1908       new com.google.protobuf.AbstractParser<Resource>() {
1909         @java.lang.Override
1910         public Resource parsePartialFrom(
1911             com.google.protobuf.CodedInputStream input,
1912             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1913             throws com.google.protobuf.InvalidProtocolBufferException {
1914           Builder builder = newBuilder();
1915           try {
1916             builder.mergeFrom(input, extensionRegistry);
1917           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1918             throw e.setUnfinishedMessage(builder.buildPartial());
1919           } catch (com.google.protobuf.UninitializedMessageException e) {
1920             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1921           } catch (java.io.IOException e) {
1922             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1923                 .setUnfinishedMessage(builder.buildPartial());
1924           }
1925           return builder.buildPartial();
1926         }
1927       };
1928 
parser()1929   public static com.google.protobuf.Parser<Resource> parser() {
1930     return PARSER;
1931   }
1932 
1933   @java.lang.Override
getParserForType()1934   public com.google.protobuf.Parser<Resource> getParserForType() {
1935     return PARSER;
1936   }
1937 
1938   @java.lang.Override
getDefaultInstanceForType()1939   public com.google.cloud.asset.v1.Resource getDefaultInstanceForType() {
1940     return DEFAULT_INSTANCE;
1941   }
1942 }
1943