# Path: pykintone/comment.py
# 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
#         }


import json
import requests
import pykintone.comment_result as cr
from pykintone.comment import Mention


class CommentAPI(object):
    API_ROOT = "https://{0}.cybozu.com/k/v1/record/comment.json"

    def __init__(self, account, app_id, record_id, api_token="", requests_options=()):
        self.account = account
        self.app_id = app_id
        self.record_id = record_id
        self.api_token = api_token
        self.requests_options = {} if len(requests_options) == 0 else requests_options
        self._url = self.API_ROOT.format(self.account.domain)

    def select(self, order_asc=None, offset=-1, limit=-1):
        url = self._url.replace("comment.json", "comments.json")
        data = {
            "app": self.app_id,
            "record": self.record_id
        }


# Path: pykintone/comment.py
# 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_api.py
import json
import requests
import pykintone.comment_result as cr
from pykintone.comment import Mention



class CommentAPI(object):
    API_ROOT = "https://{0}.cybozu.com/k/v1/record/comment.json"

    def __init__(self, account, app_id, record_id, api_token="", requests_options=()):
        self.account = account
        self.app_id = app_id
        self.record_id = record_id
        self.api_token = api_token
        self.requests_options = {} if len(requests_options) == 0 else requests_options
        self._url = self.API_ROOT.format(self.account.domain)

    def select(self, order_asc=None, offset=-1, limit=-1):
        url = self._url.replace("comment.json", "comments.json")
        data = {
            "app": self.app_id,
            "record": self.record_id
        }


        if order_asc is not None: