Skip to content

Commit 067f3eb

Browse files
author
Agathe Guillemot
committed
Use properties for ids iinstead of methods
1 parent 7af06ba commit 067f3eb

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

dataikuapi/dss/projectdeployer.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def __init__(self, client, infra_id):
185185
self.client = client
186186
self.infra_id = infra_id
187187

188+
@property
188189
def id(self):
189190
return self.infra_id
190191

@@ -289,6 +290,7 @@ def __init__(self, client, deployment_id):
289290
self.client = client
290291
self.deployment_id = deployment_id
291292

293+
@property
292294
def id(self):
293295
return self.deployment_id
294296

@@ -357,24 +359,15 @@ def get_raw(self):
357359
"""
358360
return self.settings
359361

360-
def get_bundle_id(self):
362+
@property
363+
def bundle_id(self):
361364
"""
362365
Gets the bundle id currently used by this deployment.
363366
364367
:rtype: str
365368
"""
366369
return self.settings["bundleId"]
367370

368-
def set_bundle_id(self, new_bundle_id):
369-
"""
370-
Sets a new bundle id for this deployment. You need to call :meth:`~dataikuapi.dss.projectdeployer.DSSProjectDeployerDeployment.get_settings`
371-
afterwards for the change to be effective.
372-
373-
:param str new_bundle_id: Identifier of the bundle to be set
374-
"""
375-
self.settings["bundleId"] = new_bundle_id
376-
377-
378371
def save(self):
379372
"""
380373
Saves back these settings to the deployment
@@ -437,6 +430,7 @@ def __init__(self, client, project_key):
437430
self.client = client
438431
self.project_key = project_key
439432

433+
@property
440434
def id(self):
441435
return self.project_key
442436

0 commit comments

Comments
 (0)