List of all members | Public Fields | Public Types | Public Instance Methods | Static Public Attributes
optimizeStorage Class Referencefinal

Inherits Function.

Description

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

Returns object_ptr<StorageStatistics>.

Public Fields

int53 size_
 Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit.
 
int32 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.
 
int32 count_
 Limit on the total number of files after deletion. Pass -1 to use the default limit.
 
int32 immunity_delay_
 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.
 
array< object_ptr< FileType > > file_types_
 If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.
 
array< int53chat_ids_
 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).
 
array< int53exclude_chat_ids_
 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).
 
bool return_deleted_file_statistics_
 Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics.
 
int32 chat_limit_
 Same as in getStorageStatistics. Affects only returned statistics.
 

Public Types

using ReturnType = object_ptr< storageStatistics >
 Typedef for the type returned by the function.
 

Public Instance Methods

 optimizeStorage ()
 
 optimizeStorage (int53 size_, int32 ttl_, int32 count_, int32 immunity_delay_, array< object_ptr< FileType >> &&file_types_, array< int53 > &&chat_ids_, array< int53 > &&exclude_chat_ids_, bool return_deleted_file_statistics_, int32 chat_limit_)
 
void store (TlStorerToString &s, const char *field_name) const final
 
- Public Instance Methods inherited from TlObject
virtual void store (TlStorerUnsafe &s) const
 
virtual void store (TlStorerCalcLength &s) const
 
 TlObject ()=default
 
 TlObject (const TlObject &)=delete
 
TlObjectoperator= (const TlObject &)=delete
 
 TlObject (TlObject &&)=default
 
TlObjectoperator= (TlObject &&)=default
 
virtual ~TlObject ()=default
 

Static Public Attributes

static const std::int32_t ID = 853186759
 Identifier uniquely determining a type of the object.
 

Constructor & Destructor Documentation

◆ optimizeStorage() [1/2]

Default constructor for a function, which optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

Returns object_ptr<StorageStatistics>.

◆ optimizeStorage() [2/2]

optimizeStorage ( int53  size_,
int32  ttl_,
int32  count_,
int32  immunity_delay_,
array< object_ptr< FileType >> &&  file_types_,
array< int53 > &&  chat_ids_,
array< int53 > &&  exclude_chat_ids_,
bool  return_deleted_file_statistics_,
int32  chat_limit_ 
)

Creates a function, which optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

Returns object_ptr<StorageStatistics>.

Parameters
[in]size_Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit.
[in]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.
[in]count_Limit on the total number of files after deletion. Pass -1 to use the default limit.
[in]immunity_delay_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.
[in]file_types_If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.
[in]chat_ids_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).
[in]exclude_chat_ids_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).
[in]return_deleted_file_statistics_Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics.
[in]chat_limit_Same as in getStorageStatistics. Affects only returned statistics.

Method Documentation

◆ store()

void store ( TlStorerToString &  s,
const char *  field_name 
) const
finalvirtual

Helper function for to_string method. Appends string representation of the object to the storer.

Parameters
[in]sStorer to which object string representation will be appended.
[in]field_nameObject field_name if applicable.

Implements TlObject.


The documentation for this class was generated from the following file: