docs: updated a whole bunch of stuff
This commit is contained in:
parent
b4d255e227
commit
0a315a6a9c
4 changed files with 28 additions and 24 deletions
|
@ -6,4 +6,4 @@ These functions are meant for use in other parts of the module. You *probably* s
|
||||||
If there's a feature missing from the main [ZiplineApi](zipline.md) class, you should open an [issue](https://coastalcommits.com/SeaswimmerTheFsh/PyZipline/issues) (or a [pull request](https://coastalcommits.com/SeaswimmerTheFsh/PyZipline/pulls)).
|
If there's a feature missing from the main [ZiplineApi](zipline.md) class, you should open an [issue](https://coastalcommits.com/SeaswimmerTheFsh/PyZipline/issues) (or a [pull request](https://coastalcommits.com/SeaswimmerTheFsh/PyZipline/pulls)).
|
||||||
///
|
///
|
||||||
|
|
||||||
::: pyzipline.rest_adapter.RestAdapter
|
::: pyzipline.rest_adapter
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# ZiplineApi
|
# ZiplineApi
|
||||||
|
|
||||||
::: pyzipline.zipline.ZiplineApi
|
::: pyzipline.zipline
|
||||||
|
|
|
@ -36,6 +36,7 @@ plugins:
|
||||||
docstring_options:
|
docstring_options:
|
||||||
ignore_imit_summary: true
|
ignore_imit_summary: true
|
||||||
summary: true
|
summary: true
|
||||||
|
show_root_toc_entry: false
|
||||||
filters:
|
filters:
|
||||||
- "!^___"
|
- "!^___"
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
"""This is a list of all the models used in PyZipline. They are used to represent the data returned from the Zipline API."""
|
"""This is a list of all the models used in PyZipline. They are used to represent the data returned from the Zipline API."""
|
||||||
from typing import List, Dict, Union
|
from typing import List, Dict, Optional, Union
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
class Embed:
|
class Embed:
|
||||||
"""Embed object used for checking embeds
|
"""Embed object used for checking embeds
|
||||||
|
|
||||||
Args:
|
Attributes:
|
||||||
color (str): String of the embed's color
|
color (Optional[str]): String of the embed's color
|
||||||
title (str): String of the embed's title
|
title (Optional[str]): String of the embed's title
|
||||||
siteName (str): String of the embed's site name
|
siteName (Optional[str]): String of the embed's site name
|
||||||
description (str): String of the embed's description
|
description (Optional[str]): String of the embed's description
|
||||||
"""
|
"""
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -30,7 +30,7 @@ class Embed:
|
||||||
class File:
|
class File:
|
||||||
"""File object used for uploading files to Zipline
|
"""File object used for uploading files to Zipline
|
||||||
|
|
||||||
Args:
|
Attributes:
|
||||||
createdAt (datetime.datetime): Datetime object of when the file was created
|
createdAt (datetime.datetime): Datetime object of when the file was created
|
||||||
id (int): ID of the file
|
id (int): ID of the file
|
||||||
mimetype (str): String of the file's mimetype
|
mimetype (str): String of the file's mimetype
|
||||||
|
@ -81,7 +81,7 @@ class File:
|
||||||
class Result:
|
class Result:
|
||||||
"""Result returned from low-level RestAdapter
|
"""Result returned from low-level RestAdapter
|
||||||
|
|
||||||
Args:
|
Attributes:
|
||||||
success (bool): Boolean of whether the request was successful
|
success (bool): Boolean of whether the request was successful
|
||||||
status_code (int): Standard HTTP Status code
|
status_code (int): Standard HTTP Status code
|
||||||
message (str = ''): Human readable result
|
message (str = ''): Human readable result
|
||||||
|
@ -97,7 +97,7 @@ class Result:
|
||||||
class Invite:
|
class Invite:
|
||||||
"""Invite object used for managing invites
|
"""Invite object used for managing invites
|
||||||
|
|
||||||
Args:
|
Attributes:
|
||||||
id (int): Integer ID of the invite
|
id (int): Integer ID of the invite
|
||||||
code (str): String of the invite's code
|
code (str): String of the invite's code
|
||||||
createdAt (datetime): Datetime object of when the invite was created
|
createdAt (datetime): Datetime object of when the invite was created
|
||||||
|
@ -127,14 +127,14 @@ class Invite:
|
||||||
class OAuth:
|
class OAuth:
|
||||||
"""OAuth object used for managing OAuth
|
"""OAuth object used for managing OAuth
|
||||||
|
|
||||||
Args:
|
Attributes:
|
||||||
id (int): Integer ID of the OAuth
|
id (int): Integer ID of the OAuth
|
||||||
provider (str): String of the OAuth's provider, one of 'DISCORD', 'GITHUB', 'GOOGLE'
|
provider (str): String of the OAuth's provider, one of 'DISCORD', 'GITHUB', 'GOOGLE'
|
||||||
userId (int): Integer ID of the user who owns the OAuth
|
userId (int): Integer ID of the user who owns the OAuth
|
||||||
providerId (str): String of the OAuth's provider ID
|
providerId (str): String of the OAuth's provider ID
|
||||||
username (str): String of the OAuth's connected account's username
|
username (str): String of the OAuth's connected account's username
|
||||||
token (str): String of the OAuth's access token
|
token (str): String of the OAuth's access token
|
||||||
refresh (str): String of the OAuth's refresh token
|
refresh (Optional[str]): String of the OAuth's refresh token
|
||||||
"""
|
"""
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -144,7 +144,7 @@ class OAuth:
|
||||||
providerId: str,
|
providerId: str,
|
||||||
username: str,
|
username: str,
|
||||||
token: str,
|
token: str,
|
||||||
refresh: str,
|
refresh: Optional[str],
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
self.id = id
|
self.id = id
|
||||||
|
@ -160,36 +160,36 @@ class OAuth:
|
||||||
class User:
|
class User:
|
||||||
"""User object used for managing users
|
"""User object used for managing users
|
||||||
|
|
||||||
Args:
|
Attributes:
|
||||||
id (int): Integer ID of the user
|
id (int): Integer ID of the user
|
||||||
uuid (str): String of the user's UUID
|
uuid (str): String of the user's UUID
|
||||||
username (str): String of the user's username
|
username (str): String of the user's username
|
||||||
avatar (str): String of the user's avatar, base64 encoded
|
avatar (Optional[str]): String of the user's avatar, base64 encoded
|
||||||
token (str): String of the user's token
|
token (str): String of the user's token
|
||||||
administrator (bool): Boolean of whether the user is an administrator
|
administrator (bool): Boolean of whether the user is an administrator
|
||||||
superAdmin (bool): Boolean of whether the user is a super administrator
|
superAdmin (bool): Boolean of whether the user is a super administrator
|
||||||
systemTheme (str): String of the user's system theme
|
systemTheme (str): String of the user's system theme
|
||||||
embed (Embed): Embed object of the user's embed
|
embed (Embed): Embed object of the user's embed
|
||||||
totpSecret (str): String of the user's TOTP secret
|
totpSecret (Optional[str]): String of the user's TOTP secret
|
||||||
domains (List[str]): List of Strings of the user's domains
|
domains (List[str]): List of Strings of the user's domains
|
||||||
oauth (List[OAuth] = None): (optional) List of OAuth objects
|
oauth (Optional[List[OAuth]] = None): (optional) List of OAuth objects
|
||||||
ratelimit (datetime = None): (optional) Datetime object of when the user's ratelimit expires
|
ratelimit (Optional[datetime] = None): (optional) Datetime object of when the user's ratelimit expires
|
||||||
"""
|
"""
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
id: int,
|
id: int,
|
||||||
uuid: str,
|
uuid: str,
|
||||||
username: str,
|
username: str,
|
||||||
avatar: str,
|
avatar: Optional[str],
|
||||||
token: str,
|
token: str,
|
||||||
administrator: bool,
|
administrator: bool,
|
||||||
superAdmin: bool,
|
superAdmin: bool,
|
||||||
systemTheme: str,
|
systemTheme: str,
|
||||||
embed: Embed,
|
embed: Embed,
|
||||||
totpSecret: str,
|
totpSecret: Optional[str],
|
||||||
domains: List[str],
|
domains: List[str],
|
||||||
oauth: Union[List['OAuth'], None] = None,
|
oauth: Optional[List['OAuth']] = [],
|
||||||
ratelimit: [datetime, None] = None,
|
ratelimit: Optional[datetime] = None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
self.id = id
|
self.id = id
|
||||||
|
@ -200,9 +200,12 @@ class User:
|
||||||
self.administrator = administrator
|
self.administrator = administrator
|
||||||
self.superAdmin = superAdmin
|
self.superAdmin = superAdmin
|
||||||
self.systemTheme = systemTheme
|
self.systemTheme = systemTheme
|
||||||
self.embed = embed
|
self.embed = Embed(**embed)
|
||||||
self.totpSecret = totpSecret
|
self.totpSecret = totpSecret
|
||||||
self.domains = domains
|
self.domains = domains
|
||||||
self.oauth = oauth
|
self.oauth = oauth
|
||||||
self.ratelimit = ratelimit
|
self.ratelimit = ratelimit
|
||||||
self.__dict__.update(kwargs)
|
self.__dict__.update(kwargs)
|
||||||
|
for oauth_entry in self.oauth:
|
||||||
|
OAuth(**oauth_entry)
|
||||||
|
self.oauth.append(oauth_entry)
|
||||||
|
|
Loading…
Reference in a new issue