# Path: pykintone/base_api.py
# class BaseAPI(object):
# 
#     def __init__(self, account, api_token="", requests_options=(), app_id=""):
#         self.account = account
#         self.api_token = api_token
#         self.requests_options = {} if len(requests_options) == 0 else requests_options
#         self.app_id = app_id
# 
#     def _request(self, method, url, params_or_data, headers=None, use_api_token=True):
#         m = method.upper()
#         h = headers
#         token = self.api_token if use_api_token else ""
#         r = None
# 
#         if m == "GET":
#             h = h if h else self.account.to_header(api_token=token, with_content_type=False)
#             r = requests.get(url, params=params_or_data, headers=h, **self.requests_options)
#         elif m == "FILE":
#             h = h if h else self.account.to_header(api_token=token, with_content_type=False)
#             r = requests.request("POST", url, files=params_or_data, headers=h, **self.requests_options)
#         else:
#             h = h if h else self.account.to_header(api_token=token)
#             r = requests.request(m, url, data=json.dumps(params_or_data), headers=h, **self.requests_options)
# 
#         return r


from pykintone.base_api import BaseAPI
        from enum import Enum
        from pykintone.application_settings.administrator import Administrator
        from pykintone.comment_api import CommentAPI
import pykintone.model_result as mr
        import pykintone.model as pykm
            if self.__is_record_id(k) or self.__is_revision(k):
                continue
            else:
                formatted[k] = record[k]

        return formatted

    def create(self, record_or_model):
        url = self.__single()
        _record = self.__to_create_format(record_or_model)

        data = {
            "app": self.app_id,
            "record": _record
        }

        resp = self._request("POST", url, params_or_data=data)
        r = mr.CreateResult(resp)

        return r

    def batch_create(self, records_or_models):
        url = self.__multiple()
        _records = [self.__to_create_format(r) for r in records_or_models]

        data = {
            "app": self.app_id,
            "records": _records
        }


# Path: pykintone/base_api.py
# class BaseAPI(object):
# 
#     def __init__(self, account, api_token="", requests_options=(), app_id=""):
#         self.account = account
#         self.api_token = api_token
#         self.requests_options = {} if len(requests_options) == 0 else requests_options
#         self.app_id = app_id
# 
#     def _request(self, method, url, params_or_data, headers=None, use_api_token=True):
#         m = method.upper()
#         h = headers
#         token = self.api_token if use_api_token else ""
#         r = None
# 
#         if m == "GET":
#             h = h if h else self.account.to_header(api_token=token, with_content_type=False)
#             r = requests.get(url, params=params_or_data, headers=h, **self.requests_options)
#         elif m == "FILE":
#             h = h if h else self.account.to_header(api_token=token, with_content_type=False)
#             r = requests.request("POST", url, files=params_or_data, headers=h, **self.requests_options)
#         else:
#             h = h if h else self.account.to_header(api_token=token)
#             r = requests.request(m, url, data=json.dumps(params_or_data), headers=h, **self.requests_options)
# 
#         return r


# Path: pykintone/application.py
from pykintone.base_api import BaseAPI
        from enum import Enum
        from pykintone.application_settings.administrator import Administrator
        from pykintone.comment_api import CommentAPI
import pykintone.model_result as mr
        import pykintone.model as pykm

            if self.__is_record_id(k) or self.__is_revision(k):
                continue
            else:
                formatted[k] = record[k]

        return formatted

    def create(self, record_or_model):
        url = self.__single()
        _record = self.__to_create_format(record_or_model)

        data = {
            "app": self.app_id,
            "record": _record
        }

        resp = self._request("POST", url, params_or_data=data)
        r = mr.CreateResult(resp)

        return r

    def batch_create(self, records_or_models):
        url = self.__multiple()
        _records = [self.__to_create_format(r) for r in records_or_models]

        data = {
            "app": self.app_id,
            "records": _records
        }


        resp = self._request("POST", url, params_or_data=data)