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