@classmethod
def from_json(cls, json):
    """Builds a MediaAttachment object from JSON provided by the API.

        Args:
            json: A dict containing the JSON representation that is converted
                  into the MediaAttachment object.

        Returns:
            A MediaAttachment object.

        """
    return cls(json['type'], json['payload']['url'])
