Skip to content

Commit

Permalink
Use autosplat for settings update. Add docstring to Update service
Browse files Browse the repository at this point in the history
  • Loading branch information
jcardonnet committed May 16, 2024
1 parent 5c739a5 commit 17374ca
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion packages/syft/src/syft/service/settings/settings_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,36 @@ def set(
else:
return SyftError(message=result.err())

@service_method(path="settings.update", name="update")
@service_method(path="settings.update", name="update", autosplat=["settings"])
def update(
self, context: AuthedServiceContext, settings: NodeSettingsUpdate
) -> Result[SyftSuccess, SyftError]:
"""
Update the Node Settings using the provided values.
Args:
name: Optional[str]
Node name
organization: Optional[str]
Organization name
description: Optional[str]
Node description
on_board: Optional[bool]
Show onboarding panel when a user logs in for the first time
signup_enabled: Optional[bool]
Enable/Disable registration
admin_email: Optional[str]
Administrator email
association_request_auto_approval: Optional[bool]
Returns:
Result[SyftSuccess, SyftError]: A result indicating the success or failure of the update operation.
Example:
>>> node_client.update(name='foo', organization='bar', description='baz', signup_enabled=True)
SyftSuccess: Settings updated successfully.
"""

result = self.stash.get_all(context.credentials)
if result.is_ok():
current_settings = result.ok()
Expand Down

0 comments on commit 17374ca

Please sign in to comment.