/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2SM-RC-IEs"
 * 	found in "e2sm-rc-nov2021.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
 */

#ifndef	_EventTrigger_Cell_Info_Item_H_
#define	_EventTrigger_Cell_Info_Item_H_


#include <asn_application.h>

/* Including external dependencies */
#include "RIC-EventTrigger-Cell-ID.h"
#include "LogicalOR.h"
#include <constr_CHOICE.h>
#include <constr_SEQUENCE.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Dependencies */
typedef enum EventTrigger_Cell_Info_Item__cellType_PR {
	EventTrigger_Cell_Info_Item__cellType_PR_NOTHING,	/* No components present */
	EventTrigger_Cell_Info_Item__cellType_PR_cellType_Choice_Individual,
	EventTrigger_Cell_Info_Item__cellType_PR_cellType_Choice_Group
	/* Extensions may appear below */
	
} EventTrigger_Cell_Info_Item__cellType_PR;

/* Forward declarations */
struct EventTrigger_Cell_Info_Item_Choice_Individual;
struct EventTrigger_Cell_Info_Item_Choice_Group;

/* EventTrigger-Cell-Info-Item */
typedef struct EventTrigger_Cell_Info_Item {
	RIC_EventTrigger_Cell_ID_t	 eventTriggerCellID;
	struct EventTrigger_Cell_Info_Item__cellType {
		EventTrigger_Cell_Info_Item__cellType_PR present;
		union EventTrigger_Cell_Info_Item__cellType_u {
			struct EventTrigger_Cell_Info_Item_Choice_Individual	*cellType_Choice_Individual;
			struct EventTrigger_Cell_Info_Item_Choice_Group	*cellType_Choice_Group;
			/*
			 * This type is extensible,
			 * possible extensions are below.
			 */
		} choice;
		
		/* Context for parsing across buffer boundaries */
		asn_struct_ctx_t _asn_ctx;
	} cellType;
	LogicalOR_t	*logicalOR;	/* OPTIONAL */
	/*
	 * This type is extensible,
	 * possible extensions are below.
	 */
	
	/* Context for parsing across buffer boundaries */
	asn_struct_ctx_t _asn_ctx;
} EventTrigger_Cell_Info_Item_t;

/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_EventTrigger_Cell_Info_Item;
extern asn_SEQUENCE_specifics_t asn_SPC_EventTrigger_Cell_Info_Item_specs_1;
extern asn_TYPE_member_t asn_MBR_EventTrigger_Cell_Info_Item_1[3];

#ifdef __cplusplus
}
#endif

#endif	/* _EventTrigger_Cell_Info_Item_H_ */
#include <asn_internal.h>
