github.com/tada-team/tdproto@v1.51.57/upload.go (about)

     1  package tdproto
     2  
     3  // Uploaded media
     4  type Upload struct {
     5  	// Upload id
     6  	Uid string `json:"uid"`
     7  
     8  	// Uploaded at
     9  	Created ISODateTimeString `json:"created"`
    10  
    11  	// Upload size in bytes
    12  	Size int `json:"size"`
    13  
    14  	// Mediafile duration (for audio/video only)
    15  	Duration uint `json:"duration,omitempty"`
    16  
    17  	// Filename
    18  	Name string `json:"name"`
    19  
    20  	// Absolute url
    21  	Url string `json:"url"`
    22  
    23  	// Preview details
    24  	Preview *UploadPreview `json:"preview,omitempty"`
    25  
    26  	// Content type
    27  	ContentType string `json:"content_type"`
    28  
    29  	// Is animated (images only)
    30  	Animated bool `json:"animated,omitempty"`
    31  
    32  	// Compact representation of a placeholder for an image (images only)
    33  	Blurhash string `json:"blurhash,omitempty"`
    34  
    35  	// File still processing (video only)
    36  	Processing bool `json:"processing,omitempty"`
    37  
    38  	// PDF version of file. Experimental
    39  	PdfVersion *PdfVersion `json:"pdf_version,omitempty"`
    40  
    41  	// ?type=file,image,audio,video
    42  	MediaType UploadMediaType `json:"type"`
    43  }
    44  
    45  // Upload preview
    46  type UploadPreview struct {
    47  	// Absolute url to image
    48  	Url string `json:"url"`
    49  
    50  	// Absolute url to high resolution image (retina)
    51  	Url2x string `json:"url_2x"`
    52  
    53  	// Width in pixels
    54  	Width int `json:"width"`
    55  
    56  	// Height in pixels
    57  	Height int `json:"height"`
    58  }