def to_dict(self) -> dict: result: dict = {} result["Id"] = from_union([ lambda x: from_none((lambda x: is_type(type(None), x)) (x)), lambda x: from_str((lambda x: str( (lambda x: is_type(int, x))(x)))(x)) ], self.id) result["SortOrder"] = from_union([ lambda x: from_none((lambda x: is_type(type(None), x)) (x)), lambda x: from_str((lambda x: str( (lambda x: is_type(int, x))(x)))(x)) ], self.sort_order) result["Name"] = from_union([from_str, from_none], self.name) result["Url"] = from_union([from_str, from_none], self.url) result["LogoUrl"] = from_union([from_str, from_none], self.logo_url) result["ItemType"] = from_union( [lambda x: from_list(from_str, x), from_none], self.item_type) result["CentralizationType"] = from_union([from_str, from_none], self.centralization_type) result["InternalName"] = from_union([from_str, from_none], self.internal_name) result["GradePoints"] = from_union([from_str, from_none], self.grade_points) result["Grade"] = from_union([from_str, from_none], self.grade) result["GradePointsSplit"] = from_union( [lambda x: to_class(GradePointsSplit, x), from_none], self.grade_points_split) result["AffiliateURL"] = from_union([from_str, from_none], self.affiliate_url) result["Country"] = from_union([from_str, from_none], self.country) result["OrderBook"] = from_union([from_bool, from_none], self.order_book) result["Trades"] = from_union([from_bool, from_none], self.trades) result["Description"] = from_union([from_str, from_none], self.description) result["FullAddress"] = from_union([from_str, from_none], self.full_address) result["Fees"] = from_union([from_str, from_none], self.fees) result["DepositMethods"] = from_union([from_str, from_none], self.deposit_methods) result["WithdrawalMethods"] = from_union([from_str, from_none], self.withdrawal_methods) result["Sponsored"] = from_union([from_bool, from_none], self.sponsored) result["Recommended"] = from_union([from_bool, from_none], self.recommended) result["Rating"] = from_union( [lambda x: to_class(Rating, x), from_none], self.rating) result["TOTALVOLUME24H"] = from_union([from_plain_dict, from_none], self.totalvolume24_h) result["DISPLAYTOTALVOLUME24H"] = from_union( [from_plain_dict, from_none], self.displaytotalvolume24_h) return result
def to_dict(self) -> dict: result: dict = {} result["id"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.id) result["guid"] = from_union([from_str, from_none], self.guid) result["published_on"] = from_union([from_int, from_none], self.published_on) result["imageurl"] = from_union([from_str, from_none], self.imageurl) result["title"] = from_union([from_str, from_none], self.title) result["url"] = from_union([from_str, from_none], self.url) result["source"] = from_union([from_str, from_none], self.source) result["body"] = from_union([from_str, from_none], self.body) result["tags"] = from_union([from_str, from_none], self.tags) result["categories"] = from_union([from_str, from_none], self.categories) result["upvotes"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.upvotes) result["downvotes"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.downvotes) result["lang"] = from_union([from_str, from_none], self.lang) result["source_info"] = from_union([lambda x: to_class(SourceInfo, x), from_none], self.source_info) return result
def to_dict(self) -> dict: result: dict = {} result["Points"] = from_union([from_int, from_none], self.points) result["talking_about"] = from_union([from_int, from_none], self.talking_about) result["is_closed"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(bool, x))(x)).lower())(x))], self.is_closed) result["likes"] = from_union([from_int, from_none], self.likes) result["name"] = from_union([from_str, from_none], self.name) result["link"] = from_union([from_str, from_none], self.link) return result
def to_dict(self) -> dict: result: dict = {} result["Id"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.id) result["Name"] = from_union([from_str, from_none], self.name) result["FullName"] = from_union([from_str, from_none], self.full_name) result["ImageUrl"] = from_union([from_str, from_none], self.image_url) result["Url"] = from_union([from_str, from_none], self.url) result["FollowingType"] = from_union([from_int, from_none], self.following_type) return result
def to_dict(self) -> dict: result: dict = {} result["Points"] = from_union([from_int, from_none], self.points) result["account_creation"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.account_creation) result["followers"] = from_union([from_int, from_none], self.followers) result["statuses"] = from_union([from_int, from_none], self.statuses) result["link"] = from_union([from_str, from_none], self.link) result["lists"] = from_union([from_int, from_none], self.lists) result["favourites"] = from_union([from_int, from_none], self.favourites) result["following"] = from_union([from_int, from_none], self.following) result["name"] = from_union([from_str, from_none], self.name) return result
def to_dict(self) -> dict: result: dict = {} result["forks"] = from_union([from_int, from_none], self.forks) result["last_update"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.last_update) result["open_total_issues"] = from_union([from_int, from_none], self.open_total_issues) result["subscribers"] = from_union([from_int, from_none], self.subscribers) result["fork"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(bool, x))(x)).lower())(x))], self.fork) result["closed_pull_issues"] = from_union([from_int, from_none], self.closed_pull_issues) result["parent"] = from_union([lambda x: to_class(Parent, x), from_none], self.parent) result["open_pull_issues"] = from_union([from_int, from_none], self.open_pull_issues) result["stars"] = from_union([from_int, from_none], self.stars) result["closed_issues"] = from_union([from_int, from_none], self.closed_issues) result["url"] = from_union([from_str, from_none], self.url) result["contributors"] = from_union([from_int, from_none], self.contributors) result["created_at"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.created_at) result["open_issues"] = from_union([from_int, from_none], self.open_issues) result["source"] = from_union([lambda x: to_class(Parent, x), from_none], self.source) result["closed_total_issues"] = from_union([from_int, from_none], self.closed_total_issues) result["size"] = from_union([from_int, from_none], self.size) result["last_push"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.last_push) return result
def to_dict(self) -> dict: result: dict = {} result["Points"] = from_union([from_int, from_none], self.points) result["posts_per_hour"] = from_union([to_float, from_none], self.posts_per_hour) result["comments_per_hour"] = from_union([to_float, from_none], self.comments_per_hour) result["comments_per_day"] = from_union([to_float, from_none], self.comments_per_day) result["active_users"] = from_union([from_int, from_none], self.active_users) result["link"] = from_union([from_str, from_none], self.link) result["community_creation"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.community_creation) result["posts_per_day"] = from_union([to_float, from_none], self.posts_per_day) result["name"] = from_union([from_str, from_none], self.name) result["subscribers"] = from_union([from_int, from_none], self.subscribers) return result
def to_dict(self) -> dict: result: dict = {} result["Id"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.id) result["Url"] = from_union([from_str, from_none], self.url) result["ImageUrl"] = from_union([from_str, from_none], self.image_url) result["ContentCreatedOn"] = from_union([from_int, from_none], self.content_created_on) result["Name"] = from_union([from_str, from_none], self.name) result["Symbol"] = from_union([from_str, from_none], self.symbol) result["CoinName"] = from_union([from_str, from_none], self.coin_name) result["FullName"] = from_union([from_str, from_none], self.full_name) result["Algorithm"] = from_union([from_str, from_none], self.algorithm) result["ProofType"] = from_union([from_str, from_none], self.proof_type) result["FullyPremined"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.fully_premined) result["TotalCoinSupply"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), from_int, from_float], self.total_coin_supply) result["BuiltOn"] = from_union([from_str, from_none], self.built_on) result["SmartContractAddress"] = from_union([from_str, from_none], self.smart_contract_address) result["PreMinedValue"] = from_union([from_str, from_none], self.pre_mined_value) result["TotalCoinsFreeFloat"] = from_union([from_str, from_none], self.total_coins_free_float) result["SortOrder"] = from_union([lambda x: from_none((lambda x: is_type(type(None), x))(x)), lambda x: from_str((lambda x: str((lambda x: is_type(int, x))(x)))(x))], self.sort_order) result["Sponsored"] = from_union([from_bool, from_none], self.sponsored) result["Taxonomy"] = from_union([lambda x: to_class(Taxonomy, x), from_none], self.taxonomy) result["IsTrading"] = from_union([from_bool, from_none], self.is_trading) result["TotalCoinsMined"] = from_union([to_float, from_none], self.total_coins_mined) result["BlockNumber"] = from_union([from_int, from_none], self.block_number) result["NetHashesPerSecond"] = from_union([to_float, from_none], self.net_hashes_per_second) result["BlockReward"] = from_union([to_float, from_none], self.block_reward) result["BlockTime"] = from_union([from_float, from_none], self.block_time) return result