public function jsonSerialize()
    {
        $result = array();
        foreach (get_object_vars($this) as $k => $v) {
            if (isset($v)) {
                // JSON specification set by server requires sublevel of "address" for these
                // attributes of the MailNotification, so they are special cases handled below
                if ($k == "toAddresses") {
                    $result[$k] = array("address" => $this->toAddresses);
                }
                else if ($k == "ccAddresses") {
                    $result[$k] = array("address" => $this->ccAddresses);
                }
                else if ($k == "bccAddresses") {
                    $result[$k] = array("address" => $this->bccAddresses);
                }
                else {
                    $result[$k] = $v;
                }
            }
        }
        return $result;
    }