def size(self) -> None:
"""
Get the size of data for an attachment if it does not exist.
Raises:
googleapiclient.errors.HttpError: There was an error executing the
HTTP request.
"""
if self.data is not None:
return
res = self._service.users().messages().attachments().get(
userId=self.user_id, messageId=self.msg_id, id=self.id, fields='size'
).execute()
return res['size']