Voting helps other researchers find interesting modules.
Gender in PeopleApi has some odd semantics about writing and reading that are not obvious from the proto definition. First, the type string, when read, always maps to the constrained domain of "male", "female", and "other", aside from a pathological case that PeopleApi would like to fix. There are two typical patterns: 1. type is either "male" or "female" and custom_type and address_me_as are exactly as specified by an update to PeopleApi, although they are most often absent for "male" and "female" writes. 2. type is "other" and custom_type is set to a freeform string from the request. address_me_as is equal to whatever was provided at write time. When writing, the free-form string for custom_type can come from either custom_type if the field is present on the request, or if custom_type is absent, the string value of type will be copied into it. Any value in type will be coerced to "other" and the free-form value will be copied into custom_type, even if type is exactly "other". Prefer to explicitly set custom_type and set type to "other" instead of setting type to a free-form value. There are weird edge cases when the value is "unknown". Consider the behavior for type == "unknown" unspecified. Clients reading the gender should use the value from formatted_type if type is "male" or "female". If type is "other", formatted_type will be "Other" (or some translation) and clients should read custom_type for more specificity.
type
custom_type
address_me_as
formatted_type
addressMeAs
String.t
nil
customType
formattedType
metadata
GoogleApi.ContentWarehouse.V1.Model.AppsPeopleOzExternalMergedpeopleapiPersonFieldMetadata.t
Unwrap a decoded JSON object into its complex fields.
@type t() :: %GoogleApi.ContentWarehouse.V1.Model.AppsPeopleOzExternalMergedpeopleapiGender{ addressMeAs: String.t() | nil, customType: String.t() | nil, formattedType: String.t() | nil, metadata: GoogleApi.ContentWarehouse.V1.Model.AppsPeopleOzExternalMergedpeopleapiPersonFieldMetadata.t() | nil, type: String.t() | nil }
@spec decode(struct(), keyword()) :: struct()