Added abstraction for resources transformation.

Review: https://reviews.apache.org/r/29018