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
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 |
Source code in pyzipline/models.py
Embed
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 |
Source code in pyzipline/models.py
File
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 |
Source code in pyzipline/models.py
Invite
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 |
Source code in pyzipline/models.py
Result
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) |
Source code in pyzipline/models.py
Stats
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 |
Source code in pyzipline/models.py
StatsData
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 |
Source code in pyzipline/models.py
TypesCountItem
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 |
Source code in pyzipline/models.py
User
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 |
Source code in pyzipline/models.py
Version
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 |
Source code in pyzipline/models.py
Versions
Bases: BaseModel
Object containing the current, stable, and upstream versions of Zipline
Attributes:
Name | Type | Description |
---|---|---|
stable |
str
|
String of the stable version |
upstream |
str
|
String of the upstream version |
current |
str
|
String of the current version |
Source code in pyzipline/models.py
ZiplineApiConfig
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 |