| 1 |
# Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 |
# sources: google/api/field_behavior.proto |
| 3 |
# plugin: python-betterproto |
| 4 |
# This file has been @generated |
| 5 |
|
| 6 |
from typing import TYPE_CHECKING |
| 7 |
|
| 8 |
if TYPE_CHECKING: |
| 9 |
from dataclasses import dataclass |
| 10 |
else: |
| 11 |
from pydantic.dataclasses import dataclass |
| 12 |
|
| 13 |
import betterproto |
| 14 |
from pydantic.dataclasses import rebuild_dataclass |
| 15 |
|
| 16 |
|
| 17 |
class FieldBehavior(betterproto.Enum): |
| 18 |
""" |
| 19 |
An indicator of the behavior of a given field (for example, that a field |
| 20 |
is required in requests, or given as output but ignored as input). |
| 21 |
This **does not** change the behavior in protocol buffers itself; it only |
| 22 |
denotes the behavior and may affect how API tooling handles the field. |
| 23 |
|
| 24 |
Note: This enum **may** receive new values in the future. |
| 25 |
""" |
| 26 |
|
| 27 |
UNSPECIFIED = 0 |
| 28 |
"""Conventional default for enums. Do not use this.""" |
| 29 |
|
| 30 |
OPTIONAL = 1 |
| 31 |
""" |
| 32 |
Specifically denotes a field as optional. |
| 33 |
While all fields in protocol buffers are optional, this may be specified |
| 34 |
for emphasis if appropriate. |
| 35 |
""" |
| 36 |
|
| 37 |
REQUIRED = 2 |
| 38 |
""" |
| 39 |
Denotes a field as required. |
| 40 |
This indicates that the field **must** be provided as part of the request, |
| 41 |
and failure to do so will cause an error (usually `INVALID_ARGUMENT`). |
| 42 |
""" |
| 43 |
|
| 44 |
OUTPUT_ONLY = 3 |
| 45 |
""" |
| 46 |
Denotes a field as output only. |
| 47 |
This indicates that the field is provided in responses, but including the |
| 48 |
field in a request does nothing (the server *must* ignore it and |
| 49 |
*must not* throw an error as a result of the field's presence). |
| 50 |
""" |
| 51 |
|
| 52 |
INPUT_ONLY = 4 |
| 53 |
""" |
| 54 |
Denotes a field as input only. |
| 55 |
This indicates that the field is provided in requests, and the |
| 56 |
corresponding field is not included in output. |
| 57 |
""" |
| 58 |
|
| 59 |
IMMUTABLE = 5 |
| 60 |
""" |
| 61 |
Denotes a field as immutable. |
| 62 |
This indicates that the field may be set once in a request to create a |
| 63 |
resource, but may not be changed thereafter. |
| 64 |
""" |
| 65 |
|
| 66 |
UNORDERED_LIST = 6 |
| 67 |
""" |
| 68 |
Denotes that a (repeated) field is an unordered list. |
| 69 |
This indicates that the service may provide the elements of the list |
| 70 |
in any arbitrary order, rather than the order the user originally |
| 71 |
provided. Additionally, the list's order may or may not be stable. |
| 72 |
""" |
| 73 |
|
| 74 |
NON_EMPTY_DEFAULT = 7 |
| 75 |
""" |
| 76 |
Denotes that this field returns a non-empty default value if not set. |
| 77 |
This indicates that if the user provides the empty value in a request, |
| 78 |
a non-empty value will be returned. The user will not be aware of what |
| 79 |
non-empty value to expect. |
| 80 |
""" |
| 81 |
|
| 82 |
IDENTIFIER = 8 |
| 83 |
""" |
| 84 |
Denotes that the field in a resource (a message annotated with |
| 85 |
google.api.resource) is used in the resource name to uniquely identify the |
| 86 |
resource. For AIP-compliant APIs, this should only be applied to the |
| 87 |
`name` field on the resource. |
| 88 |
|
| 89 |
This behavior should not be applied to references to other resources within |
| 90 |
the message. |
| 91 |
|
| 92 |
The identifier field of resources often have different field behavior |
| 93 |
depending on the request it is embedded in (e.g. for Create methods name |
| 94 |
is optional and unused, while for Update methods it is required). Instead |
| 95 |
of method-specific annotations, only `IDENTIFIER` is required. |
| 96 |
""" |
| 97 |
|
| 98 |
@classmethod |
| 99 |
def __get_pydantic_core_schema__(cls, _source_type, _handler): |
| 100 |
from pydantic_core import core_schema |
| 101 |
|
| 102 |
return core_schema.int_schema(ge=0) |