def execute(self): try: json_obj = PatchRequest( connection=self.connection, context=f"{self.CONTEXT}/{self.query.id}/unstar").execute() return Query(json_obj) except RequestError as re: raise BusinessError(f"Error to unstar: {self.query.id}") from re
def execute(self): try: membership_id = self.membership.id self.__remove_readonly_attributes() json_obj = PatchRequest(connection=self.connection, headers={"Content-Type": "application/json"}, context=f"{self.CONTEXT}/{membership_id}", json=self.membership.__dict__).execute() return mem.Membership(json_obj) except RequestError as re: raise BusinessError(f"Error updating membership by id: {self.membership.id}") from re
def execute(self): try: version_id = self.version.id self.__remove_readonly_attributes() json_obj = PatchRequest(connection=self.connection, context=f"{self.CONTEXT}/{version_id}", json=self.version.__dict__, headers={"Content-Type": "application/json"}).execute() return v.Version(json_obj) except RequestError as re: raise BusinessError(f"Error updating version: {self.version.id}") from re
def execute(self): try: json_obj = PatchRequest(connection=self.connection, headers={"Content-Type": "application/json"}, context=str(URL(f"{self.CONTEXT}{self.work_package.id}", [ URLParameter("notify", self.notify) ])), json=self.work_package.__dict__).execute() return wp.WorkPackage(json_obj) except RequestError as re: raise BusinessError(f"Error updating work package: {self.work_package.id}") from re
def execute(self): try: json_obj = PatchRequest( connection=self.connection, headers={ "Content-Type": "application/json" }, context=f"{self.CONTEXT}", json=self.userPreferences.__dict__).execute() return UserPreferences(json_obj) except RequestError as re: raise BusinessError("Error updating user preferences") from re
def execute(self): try: time_entry_id = self.time_entry.id self.__remove_readonly_attributes() json_obj = PatchRequest(connection=self.connection, context=f"{self.CONTEXT}/{time_entry_id}", json=self.time_entry.__dict__).execute() return te.TimeEntry(json_obj) except RequestError as re: raise BusinessError( f"Error updating a time entry with ID: {time_entry_id}" ) from re
def execute(self): try: project_id = self.project.id self.__remove_readonly_attributes() json_obj = PatchRequest(connection=self.connection, headers={ "Content-Type": "application/json" }, context=f"{self.CONTEXT}/{project_id}", json=self.project.__dict__).execute() return p.Project(json_obj) except RequestError as re: raise BusinessError( f"Error updating project: {self.project.name}") from re
def execute(self): try: grid_id = self.grid.id self.__remove_readonly_attributes() json_obj = PatchRequest(connection=self.connection, headers={ "Content-Type": "application/json" }, context=f"{self.CONTEXT}", json=self.grid.__dict__).execute() return Grid(json_obj) except RequestError as re: raise BusinessError( f"Error updating grid with id: {grid_id}") from re
def execute(self): try: activity_id = self.activity.id self.__remove_readonly_attributes() json_obj = PatchRequest(connection=self.connection, headers={ "Content-Type": "application/json" }, context=f"{self.CONTEXT}/{activity_id}", json=self.activity.__dict__).execute() return act.Activity(json_obj) except RequestError as re: raise BusinessError( f"Error updating activity: {activity_id}") from re