Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to ParseDict from dict_to_message #353

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/spaceone/identity/interface/grpc/workspace_group_user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from google.protobuf.json_format import ParseDict
from spaceone.api.identity.v2 import (
workspace_group_pb2,
workspace_group_user_pb2,
workspace_group_user_pb2_grpc,
)
Expand All @@ -19,19 +21,19 @@ def add(self, request, context):
params, metadata = self.parse_request(request, context)
workspace_group_user_svc = WorkspaceGroupUserService(metadata)
response: dict = workspace_group_user_svc.add(params)
return self.dict_to_message(response)
return ParseDict(response, workspace_group_pb2.WorkspaceGroupInfo())

def remove(self, request, context):
params, metadata = self.parse_request(request, context)
workspace_group_user_svc = WorkspaceGroupUserService(metadata)
response: dict = workspace_group_user_svc.remove(params)
return self.dict_to_message(response)
return ParseDict(response, workspace_group_pb2.WorkspaceGroupInfo())

def update_role(self, request, context):
params, metadata = self.parse_request(request, context)
workspace_group_user_svc = WorkspaceGroupUserService(metadata)
response: dict = workspace_group_user_svc.update_role(params)
return self.dict_to_message(response)
return ParseDict(response, workspace_group_pb2.WorkspaceGroupInfo())

def find(self, request, context):
params, metadata = self.parse_request(request, context)
Expand All @@ -43,13 +45,13 @@ def get(self, request, context):
params, metadata = self.parse_request(request, context)
workspace_group_user_svc = WorkspaceGroupUserService(metadata)
response: dict = workspace_group_user_svc.get(params)
return self.dict_to_message(response)
return ParseDict(response, workspace_group_pb2.WorkspaceGroupInfo())

def list(self, request, context):
params, metadata = self.parse_request(request, context)
workspace_group_user_svc = WorkspaceGroupUserService(metadata)
response: dict = workspace_group_user_svc.list(params)
return self.dict_to_message(response)
return ParseDict(response, workspace_group_pb2.WorkspaceGroupsInfo())

def stat(self, request, context):
params, metadata = self.parse_request(request, context)
Expand Down
Loading