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/api/field_behavior.proto 18 19 package com.google.api; 20 21 /** 22 * 23 * 24 * <pre> 25 * An indicator of the behavior of a given field (for example, that a field 26 * is required in requests, or given as output but ignored as input). 27 * This **does not** change the behavior in protocol buffers itself; it only 28 * denotes the behavior and may affect how API tooling handles the field. 29 * Note: This enum **may** receive new values in the future. 30 * </pre> 31 * 32 * Protobuf enum {@code google.api.FieldBehavior} 33 */ 34 public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { 35 /** 36 * 37 * 38 * <pre> 39 * Conventional default for enums. Do not use this. 40 * </pre> 41 * 42 * <code>FIELD_BEHAVIOR_UNSPECIFIED = 0;</code> 43 */ 44 FIELD_BEHAVIOR_UNSPECIFIED(0), 45 /** 46 * 47 * 48 * <pre> 49 * Specifically denotes a field as optional. 50 * While all fields in protocol buffers are optional, this may be specified 51 * for emphasis if appropriate. 52 * </pre> 53 * 54 * <code>OPTIONAL = 1;</code> 55 */ 56 OPTIONAL(1), 57 /** 58 * 59 * 60 * <pre> 61 * Denotes a field as required. 62 * This indicates that the field **must** be provided as part of the request, 63 * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). 64 * </pre> 65 * 66 * <code>REQUIRED = 2;</code> 67 */ 68 REQUIRED(2), 69 /** 70 * 71 * 72 * <pre> 73 * Denotes a field as output only. 74 * This indicates that the field is provided in responses, but including the 75 * field in a request does nothing (the server *must* ignore it and 76 * *must not* throw an error as a result of the field's presence). 77 * </pre> 78 * 79 * <code>OUTPUT_ONLY = 3;</code> 80 */ 81 OUTPUT_ONLY(3), 82 /** 83 * 84 * 85 * <pre> 86 * Denotes a field as input only. 87 * This indicates that the field is provided in requests, and the 88 * corresponding field is not included in output. 89 * </pre> 90 * 91 * <code>INPUT_ONLY = 4;</code> 92 */ 93 INPUT_ONLY(4), 94 /** 95 * 96 * 97 * <pre> 98 * Denotes a field as immutable. 99 * This indicates that the field may be set once in a request to create a 100 * resource, but may not be changed thereafter. 101 * </pre> 102 * 103 * <code>IMMUTABLE = 5;</code> 104 */ 105 IMMUTABLE(5), 106 /** 107 * 108 * 109 * <pre> 110 * Denotes that a (repeated) field is an unordered list. 111 * This indicates that the service may provide the elements of the list 112 * in any arbitrary order, rather than the order the user originally 113 * provided. Additionally, the list's order may or may not be stable. 114 * </pre> 115 * 116 * <code>UNORDERED_LIST = 6;</code> 117 */ 118 UNORDERED_LIST(6), 119 /** 120 * 121 * 122 * <pre> 123 * Denotes that this field returns a non-empty default value if not set. 124 * This indicates that if the user provides the empty value in a request, 125 * a non-empty value will be returned. The user will not be aware of what 126 * non-empty value to expect. 127 * </pre> 128 * 129 * <code>NON_EMPTY_DEFAULT = 7;</code> 130 */ 131 NON_EMPTY_DEFAULT(7), 132 UNRECOGNIZED(-1), 133 ; 134 135 /** 136 * 137 * 138 * <pre> 139 * Conventional default for enums. Do not use this. 140 * </pre> 141 * 142 * <code>FIELD_BEHAVIOR_UNSPECIFIED = 0;</code> 143 */ 144 public static final int FIELD_BEHAVIOR_UNSPECIFIED_VALUE = 0; 145 /** 146 * 147 * 148 * <pre> 149 * Specifically denotes a field as optional. 150 * While all fields in protocol buffers are optional, this may be specified 151 * for emphasis if appropriate. 152 * </pre> 153 * 154 * <code>OPTIONAL = 1;</code> 155 */ 156 public static final int OPTIONAL_VALUE = 1; 157 /** 158 * 159 * 160 * <pre> 161 * Denotes a field as required. 162 * This indicates that the field **must** be provided as part of the request, 163 * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). 164 * </pre> 165 * 166 * <code>REQUIRED = 2;</code> 167 */ 168 public static final int REQUIRED_VALUE = 2; 169 /** 170 * 171 * 172 * <pre> 173 * Denotes a field as output only. 174 * This indicates that the field is provided in responses, but including the 175 * field in a request does nothing (the server *must* ignore it and 176 * *must not* throw an error as a result of the field's presence). 177 * </pre> 178 * 179 * <code>OUTPUT_ONLY = 3;</code> 180 */ 181 public static final int OUTPUT_ONLY_VALUE = 3; 182 /** 183 * 184 * 185 * <pre> 186 * Denotes a field as input only. 187 * This indicates that the field is provided in requests, and the 188 * corresponding field is not included in output. 189 * </pre> 190 * 191 * <code>INPUT_ONLY = 4;</code> 192 */ 193 public static final int INPUT_ONLY_VALUE = 4; 194 /** 195 * 196 * 197 * <pre> 198 * Denotes a field as immutable. 199 * This indicates that the field may be set once in a request to create a 200 * resource, but may not be changed thereafter. 201 * </pre> 202 * 203 * <code>IMMUTABLE = 5;</code> 204 */ 205 public static final int IMMUTABLE_VALUE = 5; 206 /** 207 * 208 * 209 * <pre> 210 * Denotes that a (repeated) field is an unordered list. 211 * This indicates that the service may provide the elements of the list 212 * in any arbitrary order, rather than the order the user originally 213 * provided. Additionally, the list's order may or may not be stable. 214 * </pre> 215 * 216 * <code>UNORDERED_LIST = 6;</code> 217 */ 218 public static final int UNORDERED_LIST_VALUE = 6; 219 /** 220 * 221 * 222 * <pre> 223 * Denotes that this field returns a non-empty default value if not set. 224 * This indicates that if the user provides the empty value in a request, 225 * a non-empty value will be returned. The user will not be aware of what 226 * non-empty value to expect. 227 * </pre> 228 * 229 * <code>NON_EMPTY_DEFAULT = 7;</code> 230 */ 231 public static final int NON_EMPTY_DEFAULT_VALUE = 7; 232 getNumber()233 public final int getNumber() { 234 if (this == UNRECOGNIZED) { 235 throw new java.lang.IllegalArgumentException( 236 "Can't get the number of an unknown enum value."); 237 } 238 return value; 239 } 240 241 /** 242 * @param value The numeric wire value of the corresponding enum entry. 243 * @return The enum associated with the given numeric wire value. 244 * @deprecated Use {@link #forNumber(int)} instead. 245 */ 246 @java.lang.Deprecated valueOf(int value)247 public static FieldBehavior valueOf(int value) { 248 return forNumber(value); 249 } 250 251 /** 252 * @param value The numeric wire value of the corresponding enum entry. 253 * @return The enum associated with the given numeric wire value. 254 */ forNumber(int value)255 public static FieldBehavior forNumber(int value) { 256 switch (value) { 257 case 0: 258 return FIELD_BEHAVIOR_UNSPECIFIED; 259 case 1: 260 return OPTIONAL; 261 case 2: 262 return REQUIRED; 263 case 3: 264 return OUTPUT_ONLY; 265 case 4: 266 return INPUT_ONLY; 267 case 5: 268 return IMMUTABLE; 269 case 6: 270 return UNORDERED_LIST; 271 case 7: 272 return NON_EMPTY_DEFAULT; 273 default: 274 return null; 275 } 276 } 277 internalGetValueMap()278 public static com.google.protobuf.Internal.EnumLiteMap<FieldBehavior> internalGetValueMap() { 279 return internalValueMap; 280 } 281 282 private static final com.google.protobuf.Internal.EnumLiteMap<FieldBehavior> internalValueMap = 283 new com.google.protobuf.Internal.EnumLiteMap<FieldBehavior>() { 284 public FieldBehavior findValueByNumber(int number) { 285 return FieldBehavior.forNumber(number); 286 } 287 }; 288 getValueDescriptor()289 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 290 if (this == UNRECOGNIZED) { 291 throw new java.lang.IllegalStateException( 292 "Can't get the descriptor of an unrecognized enum value."); 293 } 294 return getDescriptor().getValues().get(ordinal()); 295 } 296 getDescriptorForType()297 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 298 return getDescriptor(); 299 } 300 getDescriptor()301 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 302 return com.google.api.FieldBehaviorProto.getDescriptor().getEnumTypes().get(0); 303 } 304 305 private static final FieldBehavior[] VALUES = values(); 306 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)307 public static FieldBehavior valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 308 if (desc.getType() != getDescriptor()) { 309 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 310 } 311 if (desc.getIndex() == -1) { 312 return UNRECOGNIZED; 313 } 314 return VALUES[desc.getIndex()]; 315 } 316 317 private final int value; 318 FieldBehavior(int value)319 private FieldBehavior(int value) { 320 this.value = value; 321 } 322 323 // @@protoc_insertion_point(enum_scope:google.api.FieldBehavior) 324 } 325