LocationAPI_TypesAndValues.ttcn 30.8 KB
Newer Older
/**
 *  @author     ETSI / STF569
 *  @version    $Url$
 *              $Id$
 *  @desc       Types ANd Values for ETSI GS MEC 013 V2.1.1 (2019-09)
 *  @copyright   ETSI Copyright Notification
 *               No part may be reproduced except as authorized by written permission.
 *               The copyright and the foregoing restriction extend to reproduction in all media.
 *               All rights reserved.
 */
Yann Garcia's avatar
Yann Garcia committed
module LocationAPI_TypesAndValues {
Yann Garcia's avatar
Yann Garcia committed
  // JSON
  import from JSON all;
Yann Garcia's avatar
Yann Garcia committed
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;
YannGarcia's avatar
YannGarcia committed
  /**
   * @desc The seconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC
   */
  type UInt32 Seconds;

  /**
   * @desc The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC
   */
  type UInt32 NanoSeconds;

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc
   * @member seconds The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC
   * @member nanoSeconds The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) Clause 6.5.2 Type: TimeStamp
Yann Garcia's avatar
Yann Garcia committed
   */
Yann Garcia's avatar
Yann Garcia committed
  type record TimeStamp {
YannGarcia's avatar
YannGarcia committed
    Seconds seconds,
    NanoSeconds nanoSeconds
Yann Garcia's avatar
Yann Garcia committed
  }
Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc A type containing list of users.
   * @member user Collection of the zone information list.
   * @member resourceURL Self referring URL.
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) Clause 
Yann Garcia's avatar
Yann Garcia committed
   */
  type record of UserInfo UserInfos;
  type record UserList {
    UserInfos user optional,
Yann Garcia's avatar
Yann Garcia committed
    ResourceURL resourceURL
Yann Garcia's avatar
Yann Garcia committed
  }

  /**
   * @desc Shape information, as detailed in [14], associated with the reported location coordinate
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) Table 6.5.3-1: Definition of type LocationInfo
   */
  type enumerated Shape {
    ELLIPSOID_ARC (1),
    ELLIPSOID_POINT (2),
    ELLIPSOID_POINT_ALTITUDE (3),
    ELLIPSOID_POINT_ALTITUDE_UNCERT_ELLIPSOID (4),
    ELLIPSOID_POINT_UNCERT_CIRCLE (5),
    ELLIPSOID_POINT_UNCERT_ELLIPSE (6),
    POLYGON (7)
  }  with {
    variant "JSON: as number"
  }

  /**
   * @desc Velocity information, as detailed in [14], associated with the reported location coordinate
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) Table 6.5.3-1: Definition of type LocationInfo
   */
  type enumerated VelocityType {
    HORIZONTAL (1),
    HORIZONTAL_VERTICAL (2),
    HORIZONTAL_UNCERT (3),
    HORIZONTAL_VERTICAL_UNCERT (4)
  }

  type record Velocity {
    VelocityType velocityType,
    UInt32 bearing,
    UInt32 horizontalSpeed,
    Int32 verticalSpeed optional,
    UInt32 verticalUncertainty optional
  }

  type record of JSON.Number Latitude;

  type record of JSON.Number Longitude;

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc A type containing location information with latitude, longitude and altitude, in addition the accuracy of the information are provided.
   * @member latitude Location latitude, expressed in the range -90° to +90°. Cardinality greater than one only if "shape" equals 7.
   * @member longitude Location longitude, expressed in the range -180° to +180°. Cardinality greater than one only if "shape" equals 7.
   * @member altitude Location altitude relative to the WGS84 ellipsoid surface.
   * @member accuracy Horizontal accuracy / (semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if "shape" equals 4, 5 or 6
   * @member accuracySemiMinor Horizontal accuracy / (semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6
   * @member accuracyAltitude Altitude accuracy / uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4
   * @member orientationMajorAxis Angle of orientation of the major axis, expressed in the range 0° to 180°, as defined in [14]. Present only if \"shape\" equals 4 or 6
   * @member confidence Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6
   * @member innerRadius Present only if \"shape\" equals 6
   * @member uncertaintyRadius Present only if \"shape\" equals 6
   * @member offsetAngle Present only if \"shape\" equals 6
   * @member includedAngle Present only if \"shape\" equals 6
   * @member shape Shape information, as detailed in [14], associated with the reported location coordinate
   * @member velocity Structure with attributes relating to the target entity’s velocity, as defined in [14]
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) Clause 6.5.3 Type: LocationInfo
Yann Garcia's avatar
Yann Garcia committed
   */
  type record LocationInfo {
    Latitude latitude,
    Longitude longitude,
Yann Garcia's avatar
Yann Garcia committed
    JSON.Number altitude optional,
    UInt32 accuracy optional,
    UInt32 accuracySemiMinor optional,
    UInt32 accuracyAltitude optional,
    UInt32 orientationMajorAxis optional,
    UInt32 confidence optional,
    UInt32 innerRadius  optional,
    UInt32 uncertaintyRadius optional,
    UInt32 offsetAngle optional,
    UInt32 includedAngle optional,
    Shape shape,
    TimeStamp timestamp_ optional,
  } with {
    variant (timestamp_) "name as 'timestamp'";
Yann Garcia's avatar
Yann Garcia committed
  } // End of type LocationInfo
Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc A type containing zone information.
Yann Garcia's avatar
Yann Garcia committed
   * @member zoneId Identifier of zone
   * @member numberOfAccessPoints The number of access points within the zone
   * @member numberOfUnservicableAccessPoints Number of inoperable access points within the zone.
   * @member numberOfUsers The number of users currently on the access point.
   * @member resourceURL Self referring URL.
Yann Garcia's avatar
Yann Garcia committed
   */
  type record ZoneInfo {
Yann Garcia's avatar
Yann Garcia committed
    ZoneId zoneId,
    NumberOfAccessPoints numberOfAccessPoints,
    NumberOfUnserviceableAccessPoints numberOfUnservicableAccessPoints,
    NumberOfUsers numberOfUsers,
    ResourceURL resourceURL
Yann Garcia's avatar
Yann Garcia committed
  }
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Collection of the zone information list.
   * @member zone Collection of the zone information list.
   * @member resourceURL Self referring URL.
   */
  type record of ZoneInfo ZoneInfos;
  type record ZoneList {
    ZoneInfos zone optional,
Yann Garcia's avatar
Yann Garcia committed
    ResourceURL resourceURL
  }

  /**
   * @desc Identifier of access point, <E-CGI><Cell Portion ID> (reference ETSI TS 129 171). Where the E-CGI is made up of the PLMN and Cell Identity (28 bit string). Then the PLMN is made up of the 3 digit MCC & 2 or 3 digit MNC. The Cell Portion is an optional element
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) 6.6.1 accessPointId
Yann Garcia's avatar
Yann Garcia committed
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String AccessPointId;

  type UInt32 DateTimeStamp; // FIXME To be reviewed

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc A type containing access point information.
   * @member accessPointId Identifier of access point
Yann Garcia's avatar
Yann Garcia committed
   * @member connectionType The connection type for the access poin
   * @member operationStatus The operation status of the access point
   * @member numberOfUsers The number of users currently on the access point.
   * @member interestRealm Interest realm of access point
   * @member timezone Time zone of access point
Yann Garcia's avatar
Yann Garcia committed
   * @member resourceURL Self referring URL.
   */
  type record AccessPointInfo {
    AccessPointId accessPointId,
Yann Garcia's avatar
Yann Garcia committed
    LocationInfo locationInfo optional,
Yann Garcia's avatar
Yann Garcia committed
    ConnectionType connectionType,
    OperationStatus operationStatus,
Yann Garcia's avatar
Yann Garcia committed
    NumberOfUsers numberOfUsers,
    InterestRealm interestRealm optional,
    DateTimeStamp timezone optional,
Yann Garcia's avatar
Yann Garcia committed
    ResourceURL resourceURL
  }
  /**
   * @desc Collection of the access point information list
   */
Yann Garcia's avatar
Yann Garcia committed
  type record of AccessPointInfo AccessPointInfos;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc A type containing list of access points.
   * @member zoneId Identifier of zone
Yann Garcia's avatar
Yann Garcia committed
   * @member accessPoint Collection of the access point information list.
   * @member resourceURL Self referring URL
Yann Garcia's avatar
Yann Garcia committed
   */
  type record AccessPointList {
    ZoneId zoneId,
Yann Garcia's avatar
Yann Garcia committed
    AccessPointInfos accessPoint optional,
Yann Garcia's avatar
Yann Garcia committed
    ResourceURL resourceURL
  }

  /**
   * @desc Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI).
   */
Yann Garcia's avatar
Yann Garcia committed
  type record of Address Addresses;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Reserved for future use.
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String AncillaryInfo;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc CallBackData if passed by the application during the associated ZonalTrafficSubscription and UserTrackingSubscription operation. See [\
REST_NetAPI_Common].
   */
Yann Garcia's avatar
Yann Garcia committed
  type JSON.String CallbackData;
   * @desc Notification serialization format
   */
  type enumerated NotificationFormat {
    JSON (1),
    XML (2)
  }

  /**
   * @desc CallbackData description
   * @member callbackData Data the application can register with the server when subscribing to notifications, and that are passed back unchanged in each of the related notifications. These data can be used by the application in the processing of the notification, e.g. for correlation purposes
   * @member notificationFormat 
   * @member notifyURL Notify Callback URL
Yann Garcia's avatar
Yann Garcia committed
   */
  type record CallbackReference {
    CallbackData callbackData optional,
    NotificationFormat notificationFormat optional,
Yann Garcia's avatar
Yann Garcia committed
    NotifyURL notifyURL
Yann Garcia's avatar
Yann Garcia committed
  }

  /**
Yann Garcia's avatar
Yann Garcia committed
   * @desc Uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription.
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String ClientCorrelator;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc The connection type for the access point
Yann Garcia's avatar
Yann Garcia committed
   */
  type enumerated ConnectionType {
Yann Garcia's avatar
Yann Garcia committed
    Femto,
    LTE_femto,
    Smallcell,
    LTE_smallcell,
    Wifi,
    Pico,
    Micro,
    Macro,
    Wimax,
    Unknown
Yann Garcia's avatar
Yann Garcia committed
  }

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc Contextual information of a user location (e.g., aisle, floor, room number, etc.)
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String ContextLocationInfo;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Zone ID
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String CurrentAccessPointId;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Period (in seconds) of time notifications are provided for. If set to \"0\" (zero), a default duration time, which is specified by the service policy, will be used. If the parameter is omitted, the notifications will continue until the maximum duration time, which is specified by the service policy, unless the notifications are stopped by deletion of subscription for notifications. This element MAY be given by the client during resource creation in order to signal the desired lifetime of the subscription. The server MUST return in this element the period of time for which the subscription will still be valid.
   */
Yann Garcia's avatar
Yann Garcia committed
  type JSON.Date Duration;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Interest realm of access point (e.g. geographical area, a type of industry etc.).
   */
Yann Garcia's avatar
Yann Garcia committed
  type JSON.String InterestRealm;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Link to other resources
   * @member rel Describes the relationship between the URI and the resource.
   * @member href UTI
   */
  type record Link {
YannGarcia's avatar
YannGarcia committed
    JSON.String rel,
    JSON.String href
Yann Garcia's avatar
Yann Garcia committed
  }

  /**
   * @desc The URL of your own listener application.
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String NotifyURL;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc The number of access points within the zone
   */
  type UInt32 NumberOfAccessPoints;

  /**
   * @desc Number of inoperable access points within the zone.
   */
  type UInt32 NumberOfUnserviceableAccessPoints;

  /**
   * @desc The number of users currently on the access point.
   */
  type UInt32 NumberOfUsers;

  /**
   * @desc Threshold number of users in an access point which if crossed shall cause a notification.
   */
  type UInt32 NumberOfUsersAPThreshold;

  /**
   * @desc This element shall be present when ZoneStatusSubscription includes numberOfUsersAPThreshold element and the number of users in an access point exceeds the threshold defined in the subscription.
   */
  type UInt32 NumberOfUsersInAP;

  /**
   * @desc Threshold number of users in a zone which if crossed shall cause a notification.
   */
  type UInt32 NumberOfUsersInZone;

  /**
   * @desc Threshold number of users in a zone which if crossed shall cause a notification.
   */
  type UInt32 NumberOfUsersZoneThreshold;

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc The operation status of the access point
   */
  type enumerated OperationStatus {
Yann Garcia's avatar
Yann Garcia committed
    Serviceable,
    Unserviceable,
    Unknown
Yann Garcia's avatar
Yann Garcia committed
  }
  /**
   * @desc The retrieval operation status
   */
  type enumerated RetrievalStatus {
    Retrieved,
    NotRetrieved,
    Error
  }

Yann Garcia's avatar
Yann Garcia committed
  /**
Yann Garcia's avatar
Yann Garcia committed
   * @desc Zone ID
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String PreviousAccessPointId;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Self referring URL
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.AnyURI ResourceURL;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc Time zone of access point
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String Timezone;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc User event
   */
  type enumerated UserEventType {
    Entering,
    Leaving,
    Transferring
  }

  /**
   * @desc List of user event values to generate notifications for (these apply to address specified). If this element is missing, a notification is requested to be generated for any change in user event.
   */
  type record of UserEventType UserEventCriteria;

  /**
   * @desc A type containing user information.
   * @member address_ Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI).
   * @member accessPointId Identifier of access point, <E-CGI><Cell Portion ID> (reference ETSI TS 129 171).
   * @member zoneId Identifier of zone
Yann Garcia's avatar
Yann Garcia committed
   * @member resourceURL Self referring URL.
Yann Garcia's avatar
Yann Garcia committed
   * @member locationInfo A type containing location information with latitude, longitude and altitude, in addition the accuracy of the information are provided.
   * @member contextLocationInfo Contextual information of a user location (e.g. aisle, floor, room number, etc.). 
   * @member ancillaryInfo Reserved for future use
   * @see ETSI GS MEC 013 V2.1.1 (2019-09) Clause 6.2.2 Type: UserInfo
Yann Garcia's avatar
Yann Garcia committed
   */
Yann Garcia's avatar
Yann Garcia committed
  type record UserInfo {
    Address address_,
    AccessPointId accessPointId,
    ZoneId zoneId,
Yann Garcia's avatar
Yann Garcia committed
    ResourceURL resourceURL,
    LocationInfo locationInfo optional,
    ContextLocationInfo contextLocationInfo optional,
    AncillaryInfo ancillaryInfo optional
  } with {
    variant (address_) "name as 'address'";
    variant (timestamp_) "name as 'timestamp'";
Yann Garcia's avatar
Yann Garcia committed
  } // End of type UserInfo

  /**
   * @desc A type containing user tracking subscription.
   * @member clientCorrelator A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server
   * @member callbackReference 
   * @member address_ Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI) to monitor
   * @member userEventCriteria List of user event values to generate notifications for (these apply to address specified). If this element is missing, a notification is requested to be generated for any change in user event
   * @member resourceURL Self referring URL
Yann Garcia's avatar
Yann Garcia committed
   */
  type record UserTrackingSubscription {
    ClientCorrelator clientCorrelator optional,
    CallbackReference callbackReference,
    Address address_,
    UserEventCriteria userEventCriteria optional,
    ResourceURL resourceURL optional
  } with {
    variant (address_) "name as 'address'";
  }

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc A type containing periodic tracking subscription.
   * @member 
   */
  type record PeriodicTrackingSubscription {
    ClientCorrelator clientCorrelator optional,
    CallbackReference callbackReference,
    Address address_,
    JSON.Number frequency,
    JSON.Number requestedAccuracy,
    ResourceURL resourceURL optional
  } with {
    variant (address_) "name as 'address'";
  }

Yann Garcia's avatar
Yann Garcia committed
  /**
   * @desc A type containing zonal presence notification
   * @member callbackData CallBackData if passed by the application during the associated ZonalTrafficSubscription and UserTrackingSubscription operation. See
   * @member zoneId Identifier of zone
   * @member address_ Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI) to monitor
   * @member interestRealm Interest realm of access point (e.g. geographical area, a type of industry etc.)
   * @member userEventType 
   * @member currentAccessPointId Identifier of access point
   * @member previousAccessPointId Identifier of access point
   * @member timestamp_ 
Yann Garcia's avatar
Yann Garcia committed
   * @member link Link to other resources that are in relationship with this notification. The server SHOULD include a link to the related subscription. No other links are required or suggested by this specification.
   */
  type record ZonalPresenceNotification {
    CallbackData callbackData optional,
Yann Garcia's avatar
Yann Garcia committed
    ZoneId zoneId,
    Address address_,
    InterestRealm interestRealm optional,
    UserEventType userEventType,
    CurrentAccessPointId currentAccessPointId,
    PreviousAccessPointId previousAccessPointId optional,
Yann Garcia's avatar
Yann Garcia committed
    Link link optional
  } with {
    variant (address_) "name as 'address'";
    variant (timestamp_) "name as 'timestamp'";
  }

  /**
   * @desc A type containing zonal traffic subscription
   * @member clientCorrelator A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server
   * @member callbackReference 
   * @member zoneId Identifier of zone
Yann Garcia's avatar
Yann Garcia committed
   * @member interestRealm Interest realms of access points within a zone (e.g. geographical area, a type of industry etc.).
   * @member userEventCriteria List of user event values to generate notifications for (these apply to zone identifier or all interest realms within zone identifier specified). If this element is missing, a notification is requested to be generated for any change in user event.
   * @member duration Period (in seconds) of time notifications are provided for
   * @member resourceURL Self referring URL
Yann Garcia's avatar
Yann Garcia committed
   */
  type record ZonalTrafficSubscription {
    ClientCorrelator clientCorrelator optional,
    CallbackReference callbackReference,
    ZoneId zoneId,
    InterestRealm interestRealm optional,
    UserEventCriteria userEventCriteria optional,
    Duration duration optional,
    ResourceURL resourceURL optional
  }

  /**
   * @desc Identifier of zone
   */
YannGarcia's avatar
YannGarcia committed
  type JSON.String ZoneId;
Yann Garcia's avatar
Yann Garcia committed

  /**
   * @desc A type containing zone status notification.
   * @member callbackData CallBackData if passed by the application during the associated ZoneStatusSubscription operation
   * @member zoneId Identifier of zone
   * @member accessPointId Identifier of an access point
   * @member numberOfUsersInZone This element shall be present when ZoneStatusSubscription includes numberOfUsersZoneThreshold element and the number of users in a zone exceeds the threshold defined in this subscription
   * @member numberOfUsersInAP This element shall be present when ZoneStatusSubscription includes numberOfUsersAPThreshold element and the number of users in an access point exceeds the threshold defined in the subscription
   * @member operationStatus 
   * @member timestamp_
   * @member link Link to other resources that are in relationship with this notification
Yann Garcia's avatar
Yann Garcia committed
   */
  type record ZoneStatusNotification {
    CallbackData callbackData optional,
    ZoneId zoneId,
    AccessPointId accessPointId optional,
    NumberOfUsersInZone numberOfUsersInZone optional,
    NumberOfUsersInAP numberOfUsersInAP optional,
    OperationStatus operationStatus optional,
    TimeStamp timestamp_,
    Link link optional
Yann Garcia's avatar
Yann Garcia committed
  } with {
    variant (timestamp_) "name as 'timestamp'";
  }

  /**
   * @desc A type containing zone status subscription.
   * @member clientCorrelator A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server
   * @member resourceURL Self referring URL
   * @member callbackReference 
   * @member zoneId Identifier of zone
   * @member numberOfUsersZoneThreshold Threshold number of users in a zone which if crossed shall cause a notification
   * @member numberOfUsersAPThreshold Threshold number of users in an access point which if crossed shall cause a notification
Yann Garcia's avatar
Yann Garcia committed
   * @member operationStatus List of operation status values to generate notifications for (these apply to all access points within a zone).
   */
  type record ZoneStatusSubscription {
    ClientCorrelator clientCorrelator optional,
    ResourceURL resourceURL optional,
    CallbackReference callbackReference,
    ZoneId zoneId,
    NumberOfUsersZoneThreshold numberOfUsersZoneThreshold optional,
    NumberOfUsersAPThreshold numberOfUsersAPThreshold optional,
    OperationStatus operationStatus optional
Yann Garcia's avatar
Yann Garcia committed
  }

  /**
   * @desc A type containing data for notifications, when the area is defined as a circle
   * @member address Address of terminals to monitor (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)
   * @member callbackReference 
   * @member checkImmediate Check location immediately after establishing notification
   * @member clientCorrelator A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server
   * @member count Maximum number of notifications per individual address. For no maximum, either do not include this element or specify a value of zero. Default value is 0
   * @member duration Period of time (in seconds) notifications are provided for. If set to “0” (zero), a default duration time, which is specified by the service policy, will be used. If the parameter is omitted, the notifications will continue until the maximum duration time, which is specified by the service policy, unless the notifications are stopped by deletion of subscription for notifications
   * @member enteringLeavingCriteria 
   * @member frequency Maximum frequency (in seconds) of notifications per subscription (can also be considered minimum time between notifications)
   * @member latitude Latitude of center point
   * @member link Link to other resources that are in relationship with the resource
   * @member longitude Longitude of center point
   * @member radius Radius circle around center point in meters
   * @member requester Identifies the entity that is requesting the information (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)
   * @member resourceURL Self referring URL
   * @member trackingAccuracy Number of meters of acceptable error in tracking distance
   */
  type record CircleNotificationSubscription {
Yann Garcia's avatar
Yann Garcia committed
    Addresses address_,
    CallbackReference callbackReference,
    JSON.Bool checkImmediate,
    ClientCorrelator clientCorrelator optional,
    JSON.Number count optional,
    JSON.Number duration optional,
    EnteringLeavingCriteria enteringLeavingCriteria,
    JSON.Number frequency,
Yann Garcia's avatar
Yann Garcia committed
    JSON.Number latitude,
Yann Garcia's avatar
Yann Garcia committed
    JSON.Number longitude,
    JSON.Number radius,
    JSON.AnyURI requester optional,
    ResourceURL resourceURL optional,
    JSON.Number trackingAccuracy
  } with {
    variant (address_) "name as 'address'";
  }
Yann Garcia's avatar
Yann Garcia committed

  type enumerated EnteringLeavingCriteria {
    Entering,
    Leaving
  }

  /**
   * @desc A type containing information about the distance from a terminal to a location or between two terminals, in addition the accuracy and a timestamp of the information are provided
   * @member distance Distance from terminal to a location or between two terminals specified in meters
   * @member accuracy Accuracy of the provided distance in meters
   * @member timestamp 
   */
  type record TerminalDistance {
Yann Garcia's avatar
Yann Garcia committed
    JSON.Number distance,
    JSON.Number accuracy optional,
    JSON.DateTime timestamp_ optional
  } with {
    variant (timestamp_) "name as 'timestamp'";

  /**
   * @desc Distance criterium
   */
  type enumerated DistanceCriteria {
    AllWithinDistance,
    AnyWithinDistance,
    AllBeyondDistance,
    AnyBeyondDistance
  }

  /**
   * @desc A type containing data for distance subscription, with reference to other devices
   * @member callbackReference 
   * @member checkImmediate Check location immediately after establishing notification
   * @member clientCorrelator A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server
   * @member count Maximum number of notifications per individual address. For no maximum, either do not include this element or specify a value of zero. Default value is 0
   * @member criteria 
   * @member distance Distance between devices that shall be monitored
   * @member duration Period of time (in seconds) notifications are provided for. If set to “0” (zero), a default duration time, which is specified by the service policy, will be used. If the parameter is omitted, the notifications will continue until the maximum duration time, which is specified by the service policy, unless the notifications are stopped by deletion of subscription for notifications
   * @member frequency Maximum frequency (in seconds) of notifications per subscription (can also be considered minimum time between notifications)
   * @member link Link to other resources that are in relationship with the resource
   * @member monitoredAddress Contains addresses of devices to monitor (e.g., 'sip' URI, 'tel' URI, 'acr' URI)
   * @member referenceAddress Indicates address of each device that will be used as reference devices from which the distances towards monitored devices indicated in the Addresses will be monitored (e.g., 'sip' URI, 'tel' URI, 'acr' URI)
   * @member requester Identifies the entity that is requesting the information (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)
   * @member resourceURL Self referring URL
   * @member trackingAccuracy Number of meters of acceptable error in tracking distance
   */
  type record DistanceNotificationSubscription {
    CallbackReference callbackReference,
    JSON.Bool checkImmediate,
    ClientCorrelator clientCorrelator optional,
    JSON.Number count optional,
    DistanceCriteria criteria,
    JSON.Number distance,
    JSON.Number duration optional,
    JSON.Number frequency,
    Link link optional,
    JSON.AnyURI monitoredAddress,
    Addresses referenceAddress optional,
    JSON.AnyURI requester optional,
    ResourceURL resourceURL optional,
    JSON.Number trackingAccuracy
  }

  /**
   * @desc A type containing data for periodic subscription
   * @member address_ Address of terminals to monitor (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)
   * @member callbackReference 
   * @member clientCorrelator A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server
   * @member duration Period of time (in seconds) notifications are provided for. If set to “0” (zero), a default duration time, which is specified by the service policy, will be used. If the parameter is omitted, the notifications will continue until the maximum duration time, which is specified by the service policy, unless the notifications are stopped by deletion of subscription for notifications
   * @member frequency Maximum frequency (in seconds) of notifications per subscription (can also be considered minimum time between notifications)
   * @member link Link to other resources that are in relationship with the resource
   * @member monitoredAddress Contains addresses of devices to monitor (e.g., 'sip' URI, 'tel' URI, 'acr' URI)
   * @member requestedAccuracy Accuracy of the provided distance in meters
   * @member requester Identifies the entity that is requesting the information (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)
   * @member resourceURL Self referring URL
   */
  type record PeriodicNotificationSubscription {
    Address address_,
    CallbackReference callbackReference,
    ClientCorrelator clientCorrelator optional,
    JSON.Number duration optional,
    JSON.Number frequency,
    Link link optional,
    JSON.Number requestedAccuracy,
    JSON.AnyURI requester optional,
    ResourceURL resourceURL optional
  } with {
    variant (address_) "name as 'address'";
  }

  type record of JSON.String Variables;
  /**
   * @desc Used to indicate a notification termination or cancellation
   * @member messageId Message identifier, either with prefix SVC or with prefix POL
   * @member text Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1
   * @member variables Variables to substitute into text string
   */
  type record ServiceError {
    JSON.String messageId,
    JSON.String text,
    Variables variables optional
  }

  /**
   * @desc A type containing device address, retrieval status and location information
   * @member address_ Address of the terminal to which the location information applies (e.g., 'sip' URI, 'tel' URI, 'acr' URI)
   * @member currentLocation 
   * @member errorInformation Used to indicate a notification termination or cancellation
   * @member locationRetrievalStatus
   */
  type record TerminalLocation {
    Address address_,
    LocationInfo currentLocation optional,
    ServiceError errorInformation optional,
    RetrievalStatus locationRetrievalStatus
  } with {
    variant (address_) "name as 'address'";
  }
  type record of TerminalLocation TerminalLocationList

  /**
   * @desc A type containing the notification subscription
   * @member callbackData CallbackData if passed by the application in the receiptRequest element during the associated subscription operation
   * @member link Link to other resources that are in relationship with the resource
   * @member isFinalNotification Set to true if it is a final notification about location change
   * @member terminalLocation Collection of the terminal locations
   */
  type record SubscriptionNotification {
    CallbackData callbackData optional,
    DistanceCriteria distanceCriteria optional,
    JSON.Bool isFinalNotification optional,
    Link link optional,
    TerminalLocationList terminalLocation
  }

  /**
   * @desc A type containing the subscription cancellation notification
   * @member address_  Address of terminal if the error applies to an individual terminal
   * @member callbackData CallbackData if passed by the application in the receiptRequest element during the associated subscription operation
   * @member link Link to other resources that are in relationship with the resource
   * @member reason Used to indicate a notification termination or cancellation
   */
  type record SubscriptionCancellationNotification {
    Address address_,
    CallbackData callbackData optional,
    Link link optional,
    ServiceError reason
  } with {
    variant (address_) "name as 'address'";
  }

  /**
   * @desc This type contains a list of subscriptions
   * @member zonalTrafficSubscription Collection of ZonalTrafficSubscription elements
   * @member userTrackingSubscription Collection of UserTrackingSubscription elements
   * @member periodicTrackingSubscription Collection of PeriodicNotificationSubscription elements
   * @member zoneStatusSubscription Collection of ZoneStatusSubscription elements
   * @member circleNotificationSubscription Collection of CircleNotificationSubscription elements
   * @member distanceNotificationSubscription Collection of DistanceNotificationSubscription elements
   * @member resourceURL Self-referring URL
   * @ see ETSI GS MEC 013 V2.1.1 (2019-09) Clause 6.3.3 Type: NotificationSubscriptionList
   */
  type record NotificationSubscriptionList {
    ZonalTrafficSubscription zonalTrafficSubscription optional,
    UserTrackingSubscription userTrackingSubscription optional,
Yann Garcia's avatar
Yann Garcia committed
    PeriodicTrackingSubscription periodicTrackingSubscription optional,
    ZoneStatusSubscription zoneStatusSubscription optional,
    CircleNotificationSubscription circleNotificationSubscription optional,
    DistanceNotificationSubscription distanceNotificationSubscription optional,
    ResourceURL resourceURL
    }
Yann Garcia's avatar
Yann Garcia committed
} with {
  encode "JSON"
}