code: def __field_to_parameter_type(self, field):
      
      # We use lowercase values for types (e.g. 'string' instead of 'STRING').
      variant = field.variant
      if variant == messages.Variant.MESSAGE:
        raise TypeError('A message variant can\'t be used in a parameter.')
  
      custom_variant_map = {
          messages.Variant.SINT32: 'int32',
          messages.Variant.SINT64: 'int64',
          messages.Variant.BOOL: 'boolean',
          messages.Variant.ENUM: 'string',
      }
      return custom_variant_map.get(variant) or variant.name.lower()
docs: Converts the field variant type into a string describing the parameter.
  
      Args:
        field: An instance of a subclass of messages.Field.
  
      Returns:
        A string corresponding to the variant enum of the field, with a few
          exceptions. In the case of signed ints, the 's' is dropped; for the BOOL
          variant, 'boolean' is used; and for the ENUM variant, 'string' is used.
  
      Raises:
        TypeError: if the field variant is a message variant.