// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';

var Json_decode = require("@glennsl/bs-json/src/Json_decode.bs.js");
var Maybe$OptolithClient = require("../../Data/Maybe.bs.js");
var JsonStrict$OptolithClient = require("../Utilities/JsonStrict.bs.js");

function t(json) {
  var first = Json_decode.field("firstPage", Json_decode.$$int, json);
  var mlast = JsonStrict$OptolithClient.optionalField("lastPage", Json_decode.$$int, json);
  return {
          id: Json_decode.field("id", Json_decode.string, json),
          page: Maybe$OptolithClient.maybe([
                first,
                first
              ], (function (last) {
                  return [
                          first,
                          last
                        ];
                }), mlast)
        };
}

function list(param) {
  return Json_decode.list(t, param);
}

var Decode = {
  t: t,
  list: list
};

exports.Decode = Decode;
/* No side effect */
