# Path: pykintone/result.py
# class Result(object):
# 
#     def __init__(self, response):
#         self.ok = response.ok
#         self.message = ""
#         self.error = None
#         if not self.ok:
#             _e = response.json()
#             self.error = Error(_e["message"], _e["id"], _e["code"])
#             self.detail = {}
#             if "errors" in _e:
#                 self.detail = _e["errors"]
# 
# Path: pykintone/comment.py
# class RecordComment(ps.kintoneStructure):
# 
#     def __init__(self):
#         super(RecordComment, self).__init__()
#         self.comment_id = -1
#         self.created_at = None
#         self.creator = None
#         self.mentions = []
# 
#         self._property_details.append(ps.PropertyDetail("comment_id", field_name="id"))
#         self._property_details.append(ps.PropertyDetail("created_at", ps.FieldType.CREATED_TIME, field_name="createdAt"))
#         self._property_details.append(ps.PropertyDetail("creator", ps.FieldType.CREATOR))
# 
# class Mention():
# 
#     def __init__(self, code, target_type):
#         self.code = code
#         self.target_type = target_type
# 
#     @classmethod
#     def deserialize(cls, mention_dict):
#         return Mention(mention_dict["code"], mention_dict["type"])
# 
#     def serialize(self):
#         return {
#             "code": self.code,
#             "type": self.target_type
#         }


from pykintone.result import Result
from pykintone.comment import RecordComment, Mention


class CreateCommentResult(Result):

    def __init__(self, response):
        super(CreateCommentResult, self).__init__(response)
        self.comment_id = -1
        if self.ok:
            serialized = response.json()
            if "id" in serialized:
                self.comment_id = int(serialized["id"])



# Path: pykintone/result.py
# class Result(object):
# 
#     def __init__(self, response):
#         self.ok = response.ok
#         self.message = ""
#         self.error = None
#         if not self.ok:
#             _e = response.json()
#             self.error = Error(_e["message"], _e["id"], _e["code"])
#             self.detail = {}
#             if "errors" in _e:
#                 self.detail = _e["errors"]
# 
# Path: pykintone/comment.py
# class RecordComment(ps.kintoneStructure):
# 
#     def __init__(self):
#         super(RecordComment, self).__init__()
#         self.comment_id = -1
#         self.created_at = None
#         self.creator = None
#         self.mentions = []
# 
#         self._property_details.append(ps.PropertyDetail("comment_id", field_name="id"))
#         self._property_details.append(ps.PropertyDetail("created_at", ps.FieldType.CREATED_TIME, field_name="createdAt"))
#         self._property_details.append(ps.PropertyDetail("creator", ps.FieldType.CREATOR))
# 
# class Mention():
# 
#     def __init__(self, code, target_type):
#         self.code = code
#         self.target_type = target_type
# 
#     @classmethod
#     def deserialize(cls, mention_dict):
#         return Mention(mention_dict["code"], mention_dict["type"])
# 
#     def serialize(self):
#         return {
#             "code": self.code,
#             "type": self.target_type
#         }


# Path: pykintone/comment_result.py
from pykintone.result import Result
from pykintone.comment import RecordComment, Mention



class CreateCommentResult(Result):

    def __init__(self, response):
        super(CreateCommentResult, self).__init__(response)
        self.comment_id = -1
        if self.ok:
            serialized = response.json()
            if "id" in serialized:
                self.comment_id = int(serialized["id"])



class SelectCommentResult(Result):