OptimizeStorage class final

OptimizeStorage (optimizeStorage) - TDLib function

Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

  • size: Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit.
  • ttl: Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit.
  • count: Limit on the total number of files after deletion. Pass -1 to use the default limit.
  • immunityDelay: The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value.
  • fileTypes: If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.
  • chatIds: If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos).
  • excludeChatIds: If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos).
  • returnDeletedFileStatistics: Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics.
  • chatLimit: Same as in getStorageStatistics. Affects only returned statistics.

StorageStatistics is returned on completion.

Inheritance

Constructors

OptimizeStorage({required int size, required int ttl, required int count, required int immunityDelay, required List<FileType> fileTypes, required List<int> chatIds, required List<int> excludeChatIds, required bool returnDeletedFileStatistics, required int chatLimit})
OptimizeStorage (optimizeStorage) - TDLib function
const

Properties

chatIds → List<int>
If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos)
final
chatLimit → int
Same as in getStorageStatistics. Affects only returned statistics
final
count → int
Limit on the total number of files after deletion. Pass -1 to use the default limit
final
currentObjectId → String
TDLib object type for current class instance
no setteroverride
excludeChatIds → List<int>
If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos)
final
fileTypes → List<FileType>
If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted
final
hashCode → int
The hash code for this object.
no setterinherited
immunityDelay → int
The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value
final
returnDeletedFileStatistics → bool
Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit
final
ttl → int
Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit
final

Methods

copyWith({int? size, int? ttl, int? count, int? immunityDelay, List<FileType>? fileTypes, List<int>? chatIds, List<int>? excludeChatIds, bool? returnDeletedFileStatistics, int? chatLimit}) → OptimizeStorage
Copy model with modified properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson([dynamic extra]) → Map<String, dynamic>
Convert model to TDLib JSON format
override
toString() → String
Convert model to TDLib JSON format, encoded into String.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaultObjectId → const String
TDLib object type