def check_entity_schema(
    sg, logger, entity_type, field_name, field_types, required_values
):
    """
    Verifies that field_name of field_type exists in entity_type's schema.

    :param sg: An authenticated Shotgun Python API instance.
    :param entity_type: str, a Shotgun entity type.
    :param field_name: str, the name of a field on entity_type.
    :param field_types: list, the Shotgun field types that field_name should be.
    :param required_values: list, values that must exist if the field Shotgun
                            type is a list or status list.
    """

    # Make sure we can read the schema.
    try:
        entity_schema = sg.schema_field_read(entity_type)
    except Exception as e:
        logger.warning('Can\'t read SG schema for entity "%s": %s' % (entity_type, e))
        return

    # Grab the Shotgun field data type, if the field exists.
    sg_type = entity_schema.get(field_name, {}).get("data_type", {}).get("value")

    # Assume the entity doesn't exist in Shotgun and bail if no data_type value
    # was found.
    if not sg_type:
        logger.warning(
            '%s entity %s field "%s" does not exist in Shotgun, please fix.'
            % (
                entity_type,
                field_types,
                field_name,
            )
        )
        return

    # Make sure the field is the correct Shotgun type.
    if sg_type not in field_types:
        logger.warning(
            'SG field "%s" is type "%s" but should be of type(s) "%s," please fix.'
            % (
                field_name,
                sg_type,
                field_types,
            )
        )
        return

    # If we have a list or status_list Shotgun field, make sure any required
    # values exist.
    if sg_type == "list" or sg_type == "status_list":
        schema_list_values = (
            entity_schema.get(field_name, {})
            .get("properties", {})
            .get("valid_values", {})
            .get("value", [])
        )
        missing_values = []
        for value in required_values:
            if value not in schema_list_values:
                missing_values.append(value)
        if missing_values:
            logger.warning(
                'SG field "%s" does not contain required value(s) "%s", please fix.'
                % (
                    field_name,
                    missing_values,
                )
            )
            return

    return True