Skip to contents

ifrs17_to_json() writes a group's state as the versioned JSON Python's to_json() writes (risk_rs.ifrs17_group, risk_rs.ifrs17_paa_group or risk_rs.ifrs17_reinsurance_held, format 1), and ifrs17_from_json() reads one back, choosing the class from its format, so a group rolled forward this quarter rolls forward next quarter to the same numbers, from R or Python.

Usage

ifrs17_to_json(x)

ifrs17_from_json(text)

Arguments

x

An ifrs17_group(), paa_group() or reinsurance_held().

text

A JSON document from ifrs17_to_json() or Python.

Value

ifrs17_to_json(): a string. ifrs17_from_json(): the group.

Examples

g <- ifrs17_group(list(premiums = c(900, 0), claims = rep(400, 2)), 30,
                  discount_curve(1, 0))
copy <- ifrs17_from_json(ifrs17_to_json(g))
identical(copy@balances, g@balances)
#> [1] TRUE