示例#1
0
 def Grant(self):
     args = user_pb2.ApiGrantHuntApprovalArgs(hunt_id=self.hunt_id,
                                              username=self.username,
                                              approval_id=self.approval_id)
     data = self._context.SendRequest("GrantHuntApproval", args)
     return HuntApproval(data=data,
                         username=self.username,
                         context=self._context)
示例#2
0
    def Grant(self) -> "HuntApproval":
        args = user_pb2.ApiGrantHuntApprovalArgs(hunt_id=self.hunt_id,
                                                 username=self.username,
                                                 approval_id=self.approval_id)
        data = self._context.SendRequest("GrantHuntApproval", args)
        if not isinstance(data, user_pb2.ApiHuntApproval):
            raise TypeError(f"Unexpected response type: '{type(data)}'")

        return HuntApproval(data=data,
                            username=self.username,
                            context=self._context)