Skip to content

Commit

Permalink
Merge pull request #353 from yjinjo/master
Browse files Browse the repository at this point in the history
Update to ParseDict from dict_to_message
  • Loading branch information
yjinjo authored Sep 9, 2024
2 parents a200493 + ab2ba1e commit 46c4553
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit 46c4553

Please sign in to comment.