<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_id_header(resource):
 """ Generate a header for a newly created resource. Assume `id` attribute convention. """

    if not hasattr(resource, "id"):
        return {}

    return {
        "X-{}-Id".format(
            camelize(name_for(resource))
        ): str(resource.id),
    }