code: def __field_to_parameter_type_and_format(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.')
  
      # Note that the 64-bit integers are marked as strings -- this is to
      # accommodate JavaScript, which would otherwise demote them to 32-bit
      # integers.
  
      custom_variant_map = {
          messages.Variant.DOUBLE: ('number', 'double'),
          messages.Variant.FLOAT: ('number', 'float'),
          messages.Variant.INT64: ('string', 'int64'),
          messages.Variant.SINT64: ('string', 'int64'),
          messages.Variant.UINT64: ('string', 'uint64'),
          messages.Variant.INT32: ('integer', 'int32'),
          messages.Variant.SINT32: ('integer', 'int32'),
          messages.Variant.UINT32: ('integer', 'uint32'),
          messages.Variant.BOOL: ('boolean', None),
          messages.Variant.STRING: ('string', None),
          messages.Variant.BYTES: ('string', 'byte'),
          messages.Variant.ENUM: ('string', None),
      }
      return custom_variant_map.get(variant) or (variant.name.lower(), None)
docs: Converts the field variant type into a tuple describing the parameter.
  
      Args:
        field: An instance of a subclass of messages.Field.
  
      Returns:
        A tuple with the type and format of the field, respectively.
  
      Raises:
        TypeError: if the field variant is a message variant.