mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Refactor cloud sync out of Toolbox.py
CURA-6983
This commit is contained in:
parent
261ecfacc1
commit
71000180fc
4 changed files with 156 additions and 67 deletions
18
plugins/Toolbox/src/CloudApiModel.py
Normal file
18
plugins/Toolbox/src/CloudApiModel.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from cura import ApplicationMetadata, UltimakerCloudAuthentication
|
||||
|
||||
|
||||
class CloudApiModel:
|
||||
sdk_version = ApplicationMetadata.CuraSDKVersion # type: Union[str, int]
|
||||
cloud_api_version = UltimakerCloudAuthentication.CuraCloudAPIVersion # type: str
|
||||
cloud_api_root = UltimakerCloudAuthentication.CuraCloudAPIRoot # type: str
|
||||
api_url = "{cloud_api_root}/cura-packages/v{cloud_api_version}/cura/v{sdk_version}".format(
|
||||
cloud_api_root = cloud_api_root,
|
||||
cloud_api_version = cloud_api_version,
|
||||
sdk_version = sdk_version
|
||||
) # type: str
|
||||
|
||||
# https://api.ultimaker.com/cura-packages/v1/user/packages
|
||||
api_url_user_packages = "{cloud_api_root}/cura-packages/v{cloud_api_version}/user/packages".format(
|
||||
cloud_api_root=cloud_api_root,
|
||||
cloud_api_version=cloud_api_version,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue