def __init__(self, record=None):
        if record is None:
            record = lbsn.Post()

        self.origin_id = record.pkey.origin.origin_id
        self.guid = record.pkey.id
        self.post_latlng = HF.null_geom_check(record.post_latlng)
        self.place_guid = HF.null_check(record.place_pkey.id)
        self.city_guid = HF.null_check(record.city_pkey.id)
        self.country_guid = HF.null_check(record.country_pkey.id)
        self.post_geoaccuracy = HF.turn_lower(
            HF.null_check(lbsn.Post().PostGeoaccuracy.Name(
                record.post_geoaccuracy)))
        self.user_guid = HF.null_check(record.user_pkey.id)
        self.post_create_date = HF.null_check_datetime(record.post_create_date)
        self.post_publish_date = HF.null_check_datetime(
            record.post_publish_date)
        self.post_body = HF.null_check(record.post_body)
        self.post_language = HF.null_check(record.post_language.language_short)
        self.user_mentions = list(
            set([pkey.id for pkey in record.user_mentions_pkey]))
        self.hashtags = list(set(record.hashtags))
        self.emoji = list(set(record.emoji))
        self.post_like_count = HF.null_check(record.post_like_count)
        self.post_comment_count = HF.null_check(record.post_comment_count)
        self.post_views_count = HF.null_check(record.post_views_count)
        self.post_title = HF.null_check(record.post_title)
        self.post_thumbnail_url = HF.null_check(record.post_thumbnail_url)
        self.post_url = HF.null_check(record.post_url)
        self.post_type = HF.turn_lower(
            HF.null_check(lbsn.Post().PostType.Name(record.post_type)))
        self.post_filter = HF.null_check(record.post_filter)
        self.post_quote_count = HF.null_check(record.post_quote_count)
        self.post_share_count = HF.null_check(record.post_share_count)
        self.input_source = HF.null_check(record.input_source)
        self.post_content_license = HF.null_check(record.post_content_license)
        # optional:
        self.latitude = 0
        self.longitude = 0
 def __init__(self, record=None):
     if record is None:
         record = lbsn.PostReaction()
     self.origin_id = record.pkey.origin.origin_id
     self.guid = record.pkey.id
     self.reaction_latlng = HF.null_geom_check(record.reaction_latlng)
     self.user_guid = HF.null_check(record.user_pkey.id)
     self.referenced_post = HF.null_check(record.referencedPost_pkey.id)
     self.referenced_postreaction = HF.null_check(
         record.referencedPostreaction_pkey.id)
     self.reaction_type = HF.turn_lower(
         HF.null_check(lbsn.PostReaction().ReactionType.Name(
             record.reaction_type)))
     self.reaction_date = HF.null_check_datetime(record.reaction_date)
     self.reaction_content = HF.null_check(record.reaction_content)
     self.reaction_like_count = HF.null_check(record.reaction_like_count)
     self.user_mentions = list(
         set([pkey.id for pkey in record.user_mentions_pkey]))