def fetch_avatar(self, id): ''' Used to get avatar via id id, string AvatarId of the avatar Returns Avatar object ''' resp = self.api.call("/avatars/"+id) return objects.Avatar(self, resp["data"])
def fetch_avatar(self, avatar_id): """ Used to get avatar via id :param avatar_id: AvatarId of the avatar :type avatar_id: str :return: Avatar object :rtype: objects.Avatar """ resp = self.api.call(f'/avatars/{avatar_id}') return objects.Avatar(self, resp['data'])
def list_avatars(self, user: oString = None, featured: oBoolean = None, tag: oString = None,\ userId: oString = None, n: oInteger = None, offset: oInteger = None, order: oString = None,\ releaseStatus: oString = None, sort: oString = None, maxUnityVersion: oString = None,\ minUnityVersion: oString = None, maxAssetVersion: oString = None, minAssetVersion: oString = None,\ platform: oString = None): ''' Used to get list of avatars user, string Type of user (me, friends) featured, boolean If the avatars are featured tag, string list List of tags the avatars have userId, string ID of the user that made the avatars n, integer Number of avatars to return offset, integer Skip first <offset> avatars order, string Sort <sort> by "descending" or "ascending" order releaseStatus, string ReleaseStatus of avatars sort, string Sort by "created", "updated", "order", "_created_at", "_updated_at" maxUnityVersion, string Max version of unity the avatars were uploaded from minUnityVersion, string Min version of unity the avatars were uploaded from maxAssetVersion, string Max of 'asset version' of the avatars minAssetVersion, string Min of 'asset version' of the avatars platform, string Unity platform avatars were uploaded from Returns list of Avatar objects ''' p = {} if user: p["user"] = user if featured: p["featured"] = featured if tag: p["tag"] = tag if userId: p["userId"] = userId if n: p["n"] = n if offset: p["offset"] = offset if order: p["order"] = order if releaseStatus: p["releaseStatus"] = releaseStatus if sort: p["sort"] = sort if maxUnityVersion: p["maxUnityVersion"] = maxUnityVersion if minUnityVersion: p["minUnityVersion"] = minUnityVersion if maxAssetVersion: p["maxAssetVersion"] = maxAssetVersion if minAssetVersion: p["minAssetVersion"] = minAssetVersion if platform: p["platform"] = platform resp = self.api.call("/avatars", params=p) avatars = [] for avatar in resp["data"]: avatars.append(objects.Avatar(self, avatar)) return avatars
def list_avatars(self, user=None, featured=None, tag=None, userId=None, n=None, offset=None, order=None, releaseStatus=None, sort=None, maxUnityVersion=None, minUnityVersion=None, maxAssetVersion=None, minAssetVersion=None, platform=None): """ Used to get list of avatars :param user: Type of user (me, friends) :type user: str :param featured: If the avatars are featured :type featured: bool :param tag: List of tags the avatars have :type tag: str list :param userId: ID of the user that made the avatars :type userId: str :param n: Number of avatars to return :type n: int :param offset: Skip first <offset> avatars :type offset: int :param order: Sort <sort> by "descending" or "ascending" order :type order: str :param releaseStatus: ReleaseStatus of avatars :type releaseStatus: str :param sort: Sort by "created", "updated", "order", "_created_at", "_updated_at" :type sort: str :param maxUnityVersion: Max version of unity the avatars were uploaded from :type maxUnityVersion: str :param minUnityVersion: Min version of unity the avatars were uploaded from :type minUnityVersion: str :param maxAssetVersion: Max of 'asset version' of the avatars :type maxAssetVersion: str :param minAssetVersion: Min of 'asset version' of the avatars :type minAssetVersion: str :param platform: Unity platform avatars were uploaded from :type platform: str :return: list of Avatar objects :rtype: List[objects.Avatar] """ p = {} if user: p['user'] = user if featured: p['featured'] = featured if tag: p['tag'] = tag if userId: p['userId'] = userId if n: p['n'] = n if offset: p['offset'] = offset if order: p['order'] = order if releaseStatus: p['releaseStatus'] = releaseStatus if sort: p['sort'] = sort if maxUnityVersion: p['maxUnityVersion'] = maxUnityVersion if minUnityVersion: p['minUnityVersion'] = minUnityVersion if maxAssetVersion: p['maxAssetVersion'] = maxAssetVersion if minAssetVersion: p['minAssetVersion'] = minAssetVersion if platform: p['platform'] = platform resp = self.api.call('/avatars', params=p) avatars = [] for avatar in resp['data']: avatars.append(objects.Avatar(self, avatar)) return avatars