// Contract for `openapi_client_runtime/json`.

///|
declare pub fn parse_json(text : String) -> @cjson.Json raise @cjson.ParseError

///|
declare pub fn JsonReader::new(
  node : @cjson.Json,
  ctx : @cjson.DecodeContext,
) -> JsonReader

///|
declare pub fn JsonReader::root(node : @cjson.Json) -> JsonReader

///|
declare pub fn JsonReader::raw(self : JsonReader) -> @cjson.Json

///|
declare pub fn JsonReader::context(self : JsonReader) -> @cjson.DecodeContext

///|
declare pub fn JsonReader::path(self : JsonReader) -> String

///|
declare pub fn JsonReader::error(
  self : JsonReader,
  message : String,
) -> @cjson.JsonDecodeError

///|
declare pub fn JsonReader::is_null(self : JsonReader) -> Bool

///|
declare pub fn JsonReader::read_null(
  self : JsonReader,
) -> Unit raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_string(
  self : JsonReader,
) -> String raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_bool(
  self : JsonReader,
) -> Bool raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_int64(
  self : JsonReader,
) -> Int64 raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_int32(
  self : JsonReader,
) -> Int32 raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_int16(
  self : JsonReader,
) -> Int16 raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_uint64(
  self : JsonReader,
) -> UInt64 raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_uint32(
  self : JsonReader,
) -> UInt32 raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_uint16(
  self : JsonReader,
) -> UInt16 raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_byte(
  self : JsonReader,
) -> Byte raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_char(
  self : JsonReader,
) -> Char raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_double(
  self : JsonReader,
) -> Double raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_base64(
  self : JsonReader,
) -> Bytes raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_datetime(
  self : JsonReader,
) -> @time.ZonedDateTime raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_array(
  self : JsonReader,
) -> Array[JsonReader] raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::read_object(
  self : JsonReader,
) -> Array[(String, JsonReader)] raise @cjson.JsonDecodeError

///|
declare pub fn[T] JsonReader::read_map(
  self : JsonReader,
  decode : (JsonReader) -> T raise @cjson.JsonDecodeError,
) -> Map[String, T] raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::opt_field(
  self : JsonReader,
  name : String,
) -> JsonReader? raise @cjson.JsonDecodeError

///|
declare pub fn JsonReader::field(
  self : JsonReader,
  name : String,
) -> JsonReader raise @cjson.JsonDecodeError

///|
declare pub fn[T] JsonReader::req_field(
  self : JsonReader,
  name : String,
  decode : (JsonReader) -> T raise @cjson.JsonDecodeError,
) -> T raise @cjson.JsonDecodeError

///|
declare pub fn[T] JsonReader::req_nullable_field(
  self : JsonReader,
  name : String,
  decode : (JsonReader) -> T raise @cjson.JsonDecodeError,
) -> T? raise @cjson.JsonDecodeError

///|
declare pub fn[T] JsonReader::opt_field_as(
  self : JsonReader,
  name : String,
  decode : (JsonReader) -> T raise @cjson.JsonDecodeError,
) -> T? raise @cjson.JsonDecodeError

///|
declare pub fn base64_encode(bytes : Bytes) -> String

///|
declare pub fn base64_decode(
  text : String,
  ctx? : @cjson.DecodeContext,
) -> Bytes raise @cjson.JsonDecodeError

///|
declare pub fn parse_int64_text(text : String) -> Int64?

///|
declare pub fn parse_uint64_text(text : String) -> UInt64?

///|
declare pub fn rfc3339_parse(
  text : String,
  ctx? : @cjson.DecodeContext,
) -> @time.ZonedDateTime raise @cjson.JsonDecodeError

///|
declare pub fn rfc3339_format_utc(dt : @time.ZonedDateTime) -> String

///|
declare pub fn write_int64(value : Int64) -> @cjson.Json

///|
declare pub fn write_uint64(value : UInt64) -> @cjson.Json

///|
declare pub fn write_int32(value : Int32) -> @cjson.Json

///|
declare pub fn write_uint32(value : UInt32) -> @cjson.Json

///|
declare pub fn write_int16(value : Int16) -> @cjson.Json

///|
declare pub fn write_uint16(value : UInt16) -> @cjson.Json

///|
declare pub fn write_byte(value : Byte) -> @cjson.Json

///|
declare pub fn write_double(value : Double) -> @cjson.Json

///|
declare pub fn write_bool(value : Bool) -> @cjson.Json

///|
declare pub fn write_string(value : String) -> @cjson.Json

///|
declare pub fn write_char(value : Char) -> @cjson.Json

///|
declare pub fn write_base64(bytes : Bytes) -> @cjson.Json

///|
declare pub fn write_datetime(dt : @time.ZonedDateTime) -> @cjson.Json

///|
declare pub fn ObjectBuilder::new() -> ObjectBuilder

///|
declare pub fn ObjectBuilder::field(
  self : ObjectBuilder,
  wire : String,
  value : @cjson.Json,
) -> ObjectBuilder

///|
declare pub fn ObjectBuilder::opt_field(
  self : ObjectBuilder,
  wire : String,
  value : @cjson.Json?,
) -> ObjectBuilder

///|
declare pub fn ObjectBuilder::nullable_field(
  self : ObjectBuilder,
  wire : String,
  value : @cjson.Json?,
) -> ObjectBuilder

///|
declare pub fn ObjectBuilder::merge_object(
  self : ObjectBuilder,
  other : @cjson.Json,
  overwrite? : Bool,
) -> ObjectBuilder

///|
declare pub fn ObjectBuilder::build(self : ObjectBuilder) -> @cjson.Json