Models Reference
This is a list of all the models used in PyZipline. They are used to represent the data returned from the Zipline API.
Classes:
Name | Description |
---|---|
CountByUserItem |
Model used in StatsData for storing the number of files uploaded by a user |
Embed |
Object containing a user's embed settings |
File |
File object used for uploading files to Zipline |
Invite |
Invite object used for managing invites |
Result |
Result returned from low-level RestAdapter |
Stats |
Stats model |
StatsData |
Stats data model |
TypesCountItem |
Model used in StatsData for storing the number of files with a specific mimetype |
User |
Object containing user information |
Version |
Model containing the current, stable, and upstream versions of Zipline |
Versions |
Object containing the current, stable, and upstream versions of Zipline |
ZiplineApiConfig |
Represents a configuration instance for the ZiplineApi/RestAdapter class. |
CountByUserItem
pydantic-model
Bases: BaseModel
Model used in StatsData for storing the number of files uploaded by a user
Attributes:
Name | Type | Description |
---|---|---|
username |
str
|
String of the username |
count |
int
|
Integer of the number of files uploaded by this user |
Fields:
Source code in pyzipline/models.py
Embed
pydantic-model
Bases: BaseModel
Object containing a user's embed settings
Attributes:
Name | Type | Description |
---|---|---|
color |
Optional[str]
|
String of the embed's color |
title |
Optional[str]
|
String of the embed's title |
site_name |
Optional[str]
|
String of the embed's site name |
description |
Optional[str]
|
String of the embed's description |
Fields:
Source code in pyzipline/models.py
File
pydantic-model
Bases: BaseModel
File object used for uploading files to Zipline
Attributes:
Name | Type | Description |
---|---|---|
createdAt |
datetime
|
Datetime object of when the file was created |
id |
int
|
ID of the file |
mimetype |
str
|
String of the file's mimetype |
views |
int
|
Integer of the number of views the file has |
name |
str
|
String of the file's name |
size |
int
|
Integer of the file's size in bytes |
favorite |
bool
|
Boolean of whether the file is favorited |
originalName |
Optional[str]
|
String of the file's original name |
url |
Optional[str]
|
String of the file's URL |
maxViews |
Optional[int]
|
Integer of the file's maximum number of views |
expiredAt |
Optional[datetime]
|
Datetime object of when the file will expire |
thumbnail |
Optional[str]
|
String of the file's thumbnail URL |
folderId |
Optional[int]
|
Integer of the file's folder ID |
Fields:
-
createdAt
(datetime
) -
id
(int
) -
mimetype
(str
) -
views
(int
) -
name
(str
) -
size
(int
) -
favorite
(bool
) -
originalName
(Optional[str]
) -
url
(Optional[str]
) -
maxViews
(Optional[int]
) -
expiredAt
(Optional[datetime]
) -
thumbnail
(Optional[str]
) -
folderId
(Optional[int]
)
Source code in pyzipline/models.py
Invite
pydantic-model
Bases: BaseModel
Invite object used for managing invites
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
Integer ID of the invite |
code |
str
|
String of the invite's code |
createdAt |
datetime
|
Datetime object of when the invite was created |
expiresAt |
datetime
|
Datetime object of when the invite will expire |
used |
bool
|
Boolean of whether the invite has been used |
createdById |
int
|
Integer ID of the user who created the invite |
Fields:
Source code in pyzipline/models.py
Result
pydantic-model
Bases: BaseModel
Result returned from low-level RestAdapter
Attributes:
Name | Type | Description |
---|---|---|
success |
bool
|
Boolean of whether the request was successful |
status_code |
int
|
Standard HTTP Status code |
message |
str = ''
|
Human readable result |
data |
Union[List[Dict], Dict]
|
Python List of Dictionaries (or maybe just a single Dictionary on error) |
Fields:
Source code in pyzipline/models.py
Stats
pydantic-model
Bases: BaseModel
Stats model
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
Integer ID of the stats |
createdAt |
datetime
|
Datetime object of when the stats were created |
data |
StatsData
|
StatsData object of the stats data |
max_timestamp |
Optional[datetime]
|
Datetime object of the maximum timestamp of the stats |
Fields:
Source code in pyzipline/models.py
StatsData
pydantic-model
Bases: BaseModel
Stats data model
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
Integer ID of the stats |
createdAt |
datetime
|
Datetime object of when the stats were created |
max_timestamp |
Optional[datetime]
|
Datetime object of the maximum timestamp of the stats |
size |
str
|
String of the size of the files |
size_num |
int
|
Integer of the size of the files in bytes |
count |
int
|
Integer of the number of files |
count_users |
int
|
Integer of the number of users |
views_count |
int
|
Integer of the number of views |
types_count |
Optional[List[Mimetype]]
|
List of Mimetype objects |
count_by_user |
Optional[List[CountByUser]]
|
List of CountByUser objects |
Fields:
-
size
(str
) -
count
(int
) -
size_num
(int
) -
count_users
(int
) -
types_count
(List[TypesCountItem]
) -
views_count
(int
) -
count_by_user
(List[CountByUserItem]
)
Source code in pyzipline/models.py
TypesCountItem
pydantic-model
Bases: BaseModel
Model used in StatsData for storing the number of files with a specific mimetype
Attributes:
Name | Type | Description |
---|---|---|
mimetype |
str
|
String of the mimetype |
count |
int
|
Integer of the number of files with this mimetype |
Fields:
Source code in pyzipline/models.py
User
pydantic-model
Bases: BaseModel
Object containing user information
Contains Sensitive Information
Please be mindful of how you use/store this object, as it contains sensitive information such as the user's token and TOTP information.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
Integer ID of the user |
uuid |
str
|
String of the user's UUID |
username |
str
|
String of the user's username |
avatar |
Optional[str]
|
String of the user's avatar, base64 encoded |
token |
str
|
String of the user's token |
administrator |
bool
|
Boolean of whether the user is an administrator |
super_admin |
bool
|
Boolean of whether the user is a super administrator |
system_theme |
str
|
String of the user's system theme |
embed |
Embed
|
Embed object of the user's embed |
totp_secret |
Optional[str]
|
String of the user's TOTP secret |
domains |
List[str]
|
List of Strings of the user's domains |
oauth |
Optional[List[OAuth]]
|
List of OAuth objects |
ratelimit |
Optional[datetime]
|
Datetime object of when the user's ratelimit expires |
Fields:
-
id
(int
) -
uuid
(str
) -
username
(str
) -
avatar
(Optional[str]
) -
token
(str
) -
administrator
(bool
) -
superAdmin
(bool
) -
systemTheme
(str
) -
embed
(Embed
) -
ratelimit
(None
) -
totpSecret
(Optional[str]
) -
domains
(List[str]
)
Source code in pyzipline/models.py
Version
pydantic-model
Bases: BaseModel
Model containing the current, stable, and upstream versions of Zipline
Attributes:
Name | Type | Description |
---|---|---|
is_upstream |
bool
|
Boolean of whether the current version is upstream ( |
update_to_type |
str
|
String of the type of update available, one of 'stable' or 'upstream' |
versions |
Versions
|
Versions object containing the current, stable, and upstream versions |
Fields:
Source code in pyzipline/models.py
Versions
pydantic-model
ZiplineApiConfig
pydantic-model
Bases: BaseModel
Represents a configuration instance for the ZiplineApi/RestAdapter class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname
|
str
|
The hostname of your Zipline instance, WITHOUT https or http. |
required |
token
|
str
|
String used for authentication when making requests. |
required |
ssl
|
bool
|
Normally set to True, but if your Zipline instance doesn't use SSL/TLS, set this to False. |
required |
enforced_signing
|
bool
|
Normally set to True, but if having SSL/TLS cert validation issues, can turn off with False. |
required |
logger
|
Logger
|
If your app has a logger, pass it in here. |
required |
Config:
arbitrary_types_allowed
:True
Fields: