/* JSON message definitions for ES2+
 *
 * Author: Philipp Maier <pmaier@sysmocom.de> / sysmocom - s.f.m.c. GmbH
 *
 * Released under the terms of GNU General Public License, Version 2 or
 * (at your option) any later version.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

module esx_header_Types_JSON {

/* GSMA SGP.22, section 6.5.1.3 */
type record JSON_ESx_RequestHeader {
	charstring functionRequesterIdentifier,
	charstring functionCallIdentifier
};

/* GSMA SGP.22, section 6.5.1.4 */

type record JSON_ESx_FunctionExecutionStatusCodeData {
	charstring subjectCode,
	charstring reasonCode,
	charstring subjectIdentifier optional,
	charstring message_ optional
} with {
	encode "JSON";
    variant (message_) "JSON:name as message"
};

type record JSON_ESx_FunctionExecutionStatus {
	charstring status,
	JSON_ESx_FunctionExecutionStatusCodeData statusCodeData optional
};
type record JSON_ESx_ResponseHeader {
	JSON_ESx_FunctionExecutionStatus functionExecutionStatus
};

template (value) JSON_ESx_ResponseHeader
ts_responseHeader := {
	functionExecutionStatus := {
		status := "Executed-Success",
		statusCodeData := omit
	}
}
template (present) JSON_ESx_ResponseHeader
tr_responseHeader := {
	functionExecutionStatus := {
		status := ?,
		statusCodeData := *
	}
}

template (value) JSON_ESx_RequestHeader
ts_requestHeader := {
	functionRequesterIdentifier := "TTCN3",
	functionCallIdentifier := "testsuite"
}
template (present) JSON_ESx_RequestHeader
tr_requestHeader := {
	functionRequesterIdentifier := ?,
	functionCallIdentifier := ?
}

}