View Source GoogleApi.ContentWarehouse.V1.Model.AppsPeopleOzExternalMergedpeopleapiGender (google_api_content_warehouse v0.3.0)

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.

Attributes

  • addressMeAs (type: String.t, default: nil) - Preferred pronoun choice. It's unclear whether this value is constrained to a finite domain by UIs. address_me_as may be populated regardless of whether type is "male", "female", or "other", although most writers only set it if type is "other".
  • customType (type: String.t, default: nil) - A free-form string indicating what the user entered as their gender. custom_type may exist even if the type is "male" or "female", although most writers do not set it unless type is "other".
  • formattedType (type: String.t, default: nil) - The type translated and formatted in the request locale. See go/people-api-howto/localization for details on how to usage.
  • metadata (type: GoogleApi.ContentWarehouse.V1.Model.AppsPeopleOzExternalMergedpeopleapiPersonFieldMetadata.t, default: nil) -
  • type (type: String.t, default: nil) - The gender. "male", "female", or "other". If "other", typically, additional fields will have additional information.

Summary

Functions

Unwrap a decoded JSON object into its complex fields.

Types

@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
  }

Functions

@spec decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.