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