Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DFLibraryFileUploadResponse.py « src « DigitalLibrary « plugins - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3093c390763245f10749c3e8a59d6fd15b3d8b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from datetime import datetime
from typing import Optional

from .BaseModel import BaseModel


class DFLibraryFileUploadResponse(BaseModel):
    """
    Model that represents the response received from the Digital Factory after requesting to upload a file in a Library project
    """

    def __init__(self, client_id: str, content_type: str, file_id: str, file_name: str, library_project_id: str,
                 status: str, uploaded_at: str, user_id: str, username: str, download_url: Optional[str] = None,
                 file_size: Optional[int] = None, status_description: Optional[str] = None,
                 upload_url: Optional[str] = None, **kwargs) -> None:

        """
        :param client_id: The ID of the OAuth2 client that uploaded this file
        :param content_type: The content type of the Digital Library project file
        :param file_id: The ID of the library project file
        :param file_name: The name of the file
        :param library_project_id: The ID of the library project, in which the file will be uploaded
        :param status: The status of the Digital Library project file
        :param uploaded_at: The time on which the file was uploaded
        :param user_id: The ID of the user that uploaded this file
        :param username: The user's unique username
        :param download_url: A signed URL to download the resulting file. Only available when the job is finished
        :param file_size: The size of the uploaded file (in bytes)
        :param status_description: Contains more details about the status, e.g. the cause of failures
        :param upload_url: The one-time use URL where the file must be uploaded to (only if status is uploading)
        :param kwargs: Other keyword arguments that may be included in the response
        """

        self.client_id = client_id  # type: str
        self.content_type = content_type  # type: str
        self.file_id = file_id  # type: str
        self.file_name = file_name  # type: str
        self.library_project_id = library_project_id  # type: str
        self.status = status  # type: str
        self.uploaded_at = self.parseDate(uploaded_at)  # type: datetime
        self.user_id = user_id  # type: str
        self.username = username  # type: str
        self.download_url = download_url  # type: Optional[str]
        self.file_size = file_size  # type: Optional[int]
        self.status_description = status_description  # type: Optional[str]
        self.upload_url = upload_url  # type: Optional[str]
        super().__init__(**kwargs)