mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 00:37:50 -06:00
Provide source_file_id
with print file
Had to implement this a bit differently as stated in the ticket. This field is returned when uploading the project file. Logic needed a bit of a change as the new behavior dictates a sequence (we can only upload the print file after the project file is uploaded, and we know the correct `file_id`/`source_file_id`) where before these two api calls were done in parallel. CURA-8555
This commit is contained in:
parent
f67d086182
commit
854607a725
2 changed files with 19 additions and 4 deletions
|
@ -1,12 +1,14 @@
|
|||
# Copyright (c) 2021 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from typing import Optional
|
||||
|
||||
from .BaseModel import BaseModel
|
||||
|
||||
|
||||
# Model that represents the request to upload a print job to the cloud
|
||||
class DFPrintJobUploadRequest(BaseModel):
|
||||
|
||||
def __init__(self, job_name: str, file_size: int, content_type: str, library_project_id: str, **kwargs) -> None:
|
||||
def __init__(self, job_name: str, file_size: int, content_type: str, library_project_id: str, source_file_id: str, **kwargs) -> None:
|
||||
"""Creates a new print job upload request.
|
||||
|
||||
:param job_name: The name of the print job.
|
||||
|
@ -18,4 +20,5 @@ class DFPrintJobUploadRequest(BaseModel):
|
|||
self.file_size = file_size
|
||||
self.content_type = content_type
|
||||
self.library_project_id = library_project_id
|
||||
self.source_file_id = source_file_id
|
||||
super().__init__(**kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue