示例#1
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["id"] = from_union([from_int, from_none], self.id)
     result["symbol"] = from_union([from_str, from_none], self.symbol)
     result["partner_symbol"] = from_union([from_str, from_none], self.partner_symbol)
     result["data_available_from"] = from_union([from_int, from_none], self.data_available_from)
     return result
示例#2
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Points"] = from_union([from_int, from_none], self.points)
     result["Name"] = from_union([from_str, from_none], self.name)
     result["CoinName"] = from_union([from_str, from_none], self.coin_name)
     result["Type"] = from_union([from_str, from_none], self.type)
     return result
示例#3
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Name"] = from_union([from_str, from_none], self.name)
     result["Url"] = from_union([from_str, from_none], self.url)
     result["InternalId"] = from_union([from_int, from_none], self.internal_id)
     result["InternalData"] = self.internal_data
     return result
示例#4
0
 def from_dict(obj: dict) -> 'AvailableCoin':
     assert isinstance(obj, dict)
     id = from_union([from_int, from_none], obj.get("id"))
     symbol = from_union([from_str, from_none], obj.get("symbol"))
     partner_symbol = from_union([from_str, from_none], obj.get("partner_symbol"))
     data_available_from = from_union([from_int, from_none], obj.get("data_available_from"))
     return AvailableCoin(id, symbol, partner_symbol, data_available_from)
示例#5
0
 def from_dict(obj: Any) -> 'Parent':
     assert isinstance(obj, dict)
     name = from_union([from_str, from_none], obj.get("Name"))
     url = from_union([from_str, from_none], obj.get("Url"))
     internal_id = from_union([from_int, from_none], obj.get("InternalId"))
     internal_data = from_union([from_plain_dict, from_none], obj.get("InternalData"))
     return Parent(name, url, internal_id, internal_data)
示例#6
0
 def from_dict(obj: Any) -> 'General':
     assert isinstance(obj, dict)
     points = from_union([from_int, from_none], obj.get("Points"))
     name = from_union([from_str, from_none], obj.get("Name"))
     coin_name = from_union([from_str, from_none], obj.get("CoinName"))
     type = from_union([from_str, from_none], obj.get("Type"))
     return General(points, name, coin_name, type)
示例#7
0
 def from_dict(obj: Any) -> 'Data':
     assert isinstance(obj, dict)
     aggregated = from_union([from_bool, from_none], obj.get("Aggregated"))
     time_from = from_union([from_int, from_none], obj.get("TimeFrom"))
     time_to = from_union([from_int, from_none], obj.get("TimeTo"))
     data = from_union(
         [lambda x: from_list(HistoryRecord.from_dict, x), from_none],
         obj.get("Data"))
     return Data(aggregated, time_from, time_to, data)
示例#8
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Aggregated"] = from_union([from_bool, from_none],
                                       self.aggregated)
     result["TimeFrom"] = from_union([from_int, from_none], self.time_from)
     result["TimeTo"] = from_union([from_int, from_none], self.time_to)
     result["Data"] = from_union([
         lambda x: from_list(lambda x: to_class(BlockchainHistoryRecord, x),
                             x), from_none
     ], self.data)
     return result
示例#9
0
 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
示例#10
0
 def from_dict(obj: Any) -> 'Reddit':
     assert isinstance(obj, dict)
     points = from_union([from_int, from_none], obj.get("Points"))
     posts_per_hour = from_union([from_float, from_none], obj.get("posts_per_hour"))
     comments_per_hour = from_union([from_float, from_none], obj.get("comments_per_hour"))
     comments_per_day = from_union([from_float, from_none], obj.get("comments_per_day"))
     active_users = from_union([from_int, from_none], obj.get("active_users"))
     link = from_union([from_str, from_none], obj.get("link"))
     community_creation = from_union([from_none, lambda x: int(from_str(x)), from_int], obj.get("community_creation"))
     posts_per_day = from_union([from_float, from_none], obj.get("posts_per_day"))
     name = from_union([from_str, from_none], obj.get("name"))
     subscribers = from_union([from_int, from_none], obj.get("subscribers"))
     return Reddit(points, posts_per_hour, comments_per_hour, comments_per_day, active_users, link, community_creation, posts_per_day, name, subscribers)
示例#11
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Overview"] = from_union([from_int, from_none], self.overview)
     result["Markets"] = from_union([from_int, from_none], self.markets)
     result["Analysis"] = from_union([from_int, from_none], self.analysis)
     result["Charts"] = from_union([from_int, from_none], self.charts)
     result["Trades"] = from_union([from_int, from_none], self.trades)
     result["Orderbook"] = from_union([from_int, from_none], self.orderbook)
     result["Forum"] = from_union([from_int, from_none], self.forum)
     result["Influence"] = from_union([from_int, from_none], self.influence)
     result["News"] = from_union([from_int, from_none], self.news)
     result["Timeline"] = from_union([from_int, from_none], self.timeline)
     return result
示例#12
0
 def from_dict(obj: Any) -> 'PageViewsSplit':
     assert isinstance(obj, dict)
     overview = from_union([from_int, from_none], obj.get("Overview"))
     markets = from_union([from_int, from_none], obj.get("Markets"))
     analysis = from_union([from_int, from_none], obj.get("Analysis"))
     charts = from_union([from_int, from_none], obj.get("Charts"))
     trades = from_union([from_int, from_none], obj.get("Trades"))
     orderbook = from_union([from_int, from_none], obj.get("Orderbook"))
     forum = from_union([from_int, from_none], obj.get("Forum"))
     influence = from_union([from_int, from_none], obj.get("Influence"))
     news = from_union([from_int, from_none], obj.get("News"))
     timeline = from_union([from_int, from_none], obj.get("Timeline"))
     return PageViewsSplit(overview, markets, analysis, charts, trades, orderbook, forum, influence, news, timeline)
示例#13
0
 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
示例#14
0
 def from_dict(obj: Any) -> 'Twitter':
     assert isinstance(obj, dict)
     points = from_union([from_int, from_none], obj.get("Points"))
     account_creation = from_union([from_none, lambda x: int(from_str(x))], obj.get("account_creation"))
     followers = from_union([from_int, from_none], obj.get("followers"))
     statuses = from_union([from_int, from_none], obj.get("statuses"))
     link = from_union([from_str, from_none], obj.get("link"))
     lists = from_union([from_int, from_none], obj.get("lists"))
     favourites = from_union([from_int, from_none], obj.get("favourites"))
     following = from_union([from_int, from_none], obj.get("following"))
     name = from_union([from_str, from_none], obj.get("name"))
     return Twitter(points, account_creation, followers, statuses, link, lists, favourites, following, name)
示例#15
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Response"] = from_union([from_str, from_none], self.response)
     result["Message"] = from_union([from_str, from_none], self.message)
     result["Data"] = from_union([lambda x: from_dict(lambda x: to_class(Coin, x), x), from_none], self.data)
     result["BaseImageUrl"] = from_union([from_str, from_none], self.base_image_url)
     result["BaseLinkUrl"] = from_union([from_str, from_none], self.base_link_url)
     result["RateLimit"] = from_union([lambda x: to_class(RateLimit, x), from_none], self.rate_limit)
     result["HasWarning"] = from_union([from_bool, from_none], self.has_warning)
     result["Type"] = from_union([from_int, from_none], self.type)
     return result
示例#16
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Points"] = from_union([from_int, from_none], self.points)
     result["Followers"] = from_union([from_int, from_none], self.followers)
     result["Posts"] = from_union([from_int, from_none], self.posts)
     result["SimilarItems"] = from_union([lambda x: from_list(lambda x: to_class(SimilarItem, x), x), from_none], self.similar_items)
     result["Comments"] = from_union([from_int, from_none], self.comments)
     result["PageViewsSplit"] = from_union([lambda x: to_class(PageViewsSplit, x), from_none], self.page_views_split)
     result["PageViews"] = from_union([from_int, from_none], self.page_views)
     result["CryptopianFollowers"] = from_union([lambda x: from_list(lambda x: x, x), from_none], self.cryptopian_followers)
     return result
示例#17
0
 def from_dict(obj: Any) -> 'CryptoCompare':
     assert isinstance(obj, dict)
     points = from_union([from_int, from_none], obj.get("Points"))
     followers = from_union([from_int, from_none], obj.get("Followers"))
     posts = from_union([from_int, from_none], obj.get("Posts"))
     similar_items = from_union([lambda x: from_list(SimilarItem.from_dict, x), from_none], obj.get("SimilarItems"))
     comments = from_union([from_int, from_none], obj.get("Comments"))
     page_views_split = from_union([PageViewsSplit.from_dict, from_none], obj.get("PageViewsSplit"))
     page_views = from_union([from_int, from_none], obj.get("PageViews"))
     cryptopian_followers = from_union([lambda x: from_list(lambda x: x, x), from_none], obj.get("CryptopianFollowers"))
     return CryptoCompare(points, followers, posts, similar_items, comments, page_views_split, page_views, cryptopian_followers)
示例#18
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Access"] = from_union([from_str, from_none], self.access)
     result["FCA"] = from_union([from_str, from_none], self.fca)
     result["FINMA"] = from_union([from_str, from_none], self.finma)
     result["Industry"] = from_union([from_str, from_none], self.industry)
     result["CollateralizedAsset"] = from_union([from_str, from_none], self.collateralized_asset)
     result["CollateralizedAssetType"] = from_union([from_str, from_none], self.collateralized_asset_type)
     result["CollateralType"] = from_union([from_str, from_none], self.collateral_type)
     result["CollateralInfo"] = from_union([from_str, from_none], self.collateral_info)
     return result
示例#19
0
 def from_dict(obj: Any) -> 'Coins':
     assert isinstance(obj, dict)
     response = from_union([from_str, from_none], obj.get("Response"))
     message = from_union([from_str, from_none], obj.get("Message"))
     data = from_union([lambda x: from_dict(Coin.from_dict, x), from_none], obj.get("Data"))
     base_image_url = from_union([from_str, from_none], obj.get("BaseImageUrl"))
     base_link_url = from_union([from_str, from_none], obj.get("BaseLinkUrl"))
     rate_limit = from_union([RateLimit.from_dict, from_none], obj.get("RateLimit"))
     has_warning = from_union([from_bool, from_none], obj.get("HasWarning"))
     type = from_union([from_int, from_none], obj.get("Type"))
     return Coins(response, message, data, base_image_url, base_link_url, rate_limit, has_warning, type)
示例#20
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["time"] = from_union([from_int, from_none], self.time)
     result["high"] = from_union([to_float, from_none], self.high)
     result["low"] = from_union([to_float, from_none], self.low)
     result["open"] = from_union([to_float, from_none], self.open)
     result["volumefrom"] = from_union([to_float, from_none],
                                       self.volumefrom)
     result["volumeto"] = from_union([to_float, from_none], self.volumeto)
     result["close"] = from_union([to_float, from_none], self.close)
     result["conversionType"] = from_union([from_str, from_none],
                                           self.conversion_type)
     result["conversionSymbol"] = from_union([from_str, from_none],
                                             self.conversion_symbol)
     return result
示例#21
0
 def from_dict(obj: Any) -> 'HistoryRecord':
     assert isinstance(obj, dict)
     time = from_union([from_int, from_none], obj.get("time"))
     high = from_union([from_float, from_none], obj.get("high"))
     low = from_union([from_float, from_none], obj.get("low"))
     open = from_union([from_float, from_none], obj.get("open"))
     volumefrom = from_union([from_float, from_none], obj.get("volumefrom"))
     volumeto = from_union([from_float, from_none], obj.get("volumeto"))
     close = from_union([from_float, from_none], obj.get("close"))
     conversion_type = from_union([from_str, from_none],
                                  obj.get("conversionType"))
     conversion_symbol = from_union([from_str, from_none],
                                    obj.get("conversionSymbol"))
     return HistoryRecord(time, high, low, open, volumefrom, volumeto,
                          close, conversion_type, conversion_symbol)
示例#22
0
 def from_dict(obj: Any) -> 'Taxonomy':
     assert isinstance(obj, dict)
     access = from_union([from_str, from_none], obj.get("Access"))
     fca = from_union([from_str, from_none], obj.get("FCA"))
     finma = from_union([from_str, from_none], obj.get("FINMA"))
     industry = from_union([from_str, from_none], obj.get("Industry"))
     collateralized_asset = from_union([from_str, from_none], obj.get("CollateralizedAsset"))
     collateralized_asset_type = from_union([from_str, from_none], obj.get("CollateralizedAssetType"))
     collateral_type = from_union([from_str, from_none], obj.get("CollateralType"))
     collateral_info = from_union([from_str, from_none], obj.get("CollateralInfo"))
     return Taxonomy(access, fca, finma, industry, collateralized_asset, collateralized_asset_type, collateral_type,
                     collateral_info)
示例#23
0
 def from_dict(obj: Any) -> 'Rating':
     assert isinstance(obj, dict)
     one = from_union([from_int, from_none], obj.get("One"))
     two = from_union([from_int, from_none], obj.get("Two"))
     three = from_union([from_int, from_none], obj.get("Three"))
     four = from_union([from_int, from_none], obj.get("Four"))
     five = from_union([from_int, from_none], obj.get("Five"))
     avg = from_union([from_float, from_none], obj.get("Avg"))
     total_users = from_union([from_int, from_none], obj.get("TotalUsers"))
     return Rating(one, two, three, four, five, avg, total_users)
示例#24
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["One"] = from_union([from_int, from_none], self.one)
     result["Two"] = from_union([from_int, from_none], self.two)
     result["Three"] = from_union([from_int, from_none], self.three)
     result["Four"] = from_union([from_int, from_none], self.four)
     result["Five"] = from_union([from_int, from_none], self.five)
     result["Avg"] = from_union([to_float, from_none], self.avg)
     result["TotalUsers"] = from_union([from_int, from_none],
                                       self.total_users)
     return result
示例#25
0
 def from_dict(obj: dict) -> 'BlockchainAvailableCoins':
     assert isinstance(obj, dict)
     response = from_union([from_str, from_none], obj.get("Response"))
     message = from_union([from_str, from_none], obj.get("Message"))
     has_warning = from_union([from_bool, from_none], obj.get("HasWarning"))
     type = from_union([from_int, from_none], obj.get("Type"))
     rate_limit = from_union([RateLimit.from_dict, from_none], obj.get("RateLimit"))
     data = from_union([lambda x: from_dict(AvailableCoin.from_dict, x), from_none], obj.get("Data"))
     return BlockchainAvailableCoins(data, response, message, has_warning, type, rate_limit)
示例#26
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["General"] = from_union([lambda x: to_class(General, x), from_none], self.general)
     result["CryptoCompare"] = from_union([lambda x: to_class(CryptoCompare, x), from_none], self.crypto_compare)
     result["Twitter"] = from_union([lambda x: to_class(Twitter, x), from_none], self.twitter)
     result["Reddit"] = from_union([lambda x: to_class(Reddit, x), from_none], self.reddit)
     result["Facebook"] = from_union([lambda x: to_class(Facebook, x), from_none], self.facebook)
     result["CodeRepository"] = from_union([lambda x: to_class(CodeRepositories, x), from_none], self.code_repository)
     return result
示例#27
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Type"] = from_union([from_int, from_none], self.type)
     result["Message"] = from_union([from_str, from_none], self.message)
     result["Promoted"] = from_union([lambda x: from_list(lambda x: x, x), from_none], self.promoted)
     result["Data"] = from_union([lambda x: from_list(lambda x: to_class(NewsRecord, x), x), from_none], self.data)
     result["RateLimit"] = from_union([lambda x: to_class(RateLimit, x), from_none], self.rate_limit)
     result["HasWarning"] = from_union([from_bool, from_none], self.has_warning)
     return result
示例#28
0
 def from_dict(obj: Any) -> 'NewsData':
     assert isinstance(obj, dict)
     type = from_union([from_int, from_none], obj.get("Type"))
     message = from_union([from_str, from_none], obj.get("Message"))
     promoted = from_union([lambda x: from_list(lambda x: x, x), from_none], obj.get("Promoted"))
     data = from_union([lambda x: from_list(NewsRecord.from_dict, x), from_none], obj.get("Data"))
     rate_limit = from_union([RateLimit.from_dict, from_none], obj.get("RateLimit"))
     has_warning = from_union([from_bool, from_none], obj.get("HasWarning"))
     return NewsData(type, message, promoted, data, rate_limit, has_warning)
示例#29
0
 def from_dict(obj: Any) -> 'SocialLatest':
     assert isinstance(obj, dict)
     response = from_union([from_str, from_none], obj.get("Response"))
     message = from_union([from_str, from_none], obj.get("Message"))
     has_warning = from_union([from_bool, from_none], obj.get("HasWarning"))
     type = from_union([from_int, from_none], obj.get("Type"))
     rate_limit = from_union([RateLimit.from_dict, from_none], obj.get("RateLimit"))
     data = from_union([SocialData.from_dict, from_none], obj.get("Data"))
     return SocialLatest(response, message, has_warning, type, rate_limit, data)
示例#30
0
 def to_dict(self) -> dict:
     result: dict = {}
     result["Response"] = from_union([from_str, from_none], self.response)
     result["Message"] = from_union([from_str, from_none], self.message)
     result["HasWarning"] = from_union([from_bool, from_none], self.has_warning)
     result["Type"] = from_union([from_int, from_none], self.type)
     result["RateLimit"] = from_union([lambda x: to_class(RateLimit, x), from_none], self.rate_limit)
     result["Data"] = from_union([lambda x: to_class(SocialData, x), from_none], self.data)
     return result