From dfc47d1d27fb80d3245d7e0ac001975851d4cd66 Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Thu, 15 Oct 2020 15:11:27 +0200
Subject: [PATCH] Moved to XSD v3_18_0

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 LibOneM2M/OneM2M_Types.ttcn         | 64 +++++++++++------------------
 OneM2M_Testcases_AE_Release_1.ttcn  |  4 +-
 OneM2M_Testcases_CSE_Release_3.ttcn |  2 +-
 3 files changed, 27 insertions(+), 43 deletions(-)

diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn
index ecebd2d..bc54396 100644
--- a/LibOneM2M/OneM2M_Types.ttcn
+++ b/LibOneM2M/OneM2M_Types.ttcn
@@ -2,7 +2,7 @@
  *  Copyright Notification
  *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
  *  The copyright and the foregoing restriction extend to reproduction in all media.
- *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
+ *  � 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
  *  All rights reserved.
  *  
  *  @author     oneM2M
@@ -1170,7 +1170,7 @@ with {
 };
 
 
-type record BatteryMgmt
+type record BatteryMgmt //TODO According to XSDs, it should be Battery, but there is a possible conflict with type Battery in HAIM 
 {
 	ResourceName resourceName,
 	ResourceType resourceType,
@@ -1209,7 +1209,7 @@ with {
 };
 
 
-type record BatteryMgmtAnnc
+type record BatteryMgmtAnnc//TODO According to XSDs, it should be BatteryAnnc, but there is a possible conflict with type Battery in HAIM 
 {
 	ResourceName resourceName,
 	ResourceType resourceType,
@@ -1747,14 +1747,11 @@ with {
 
 type enumerated PermittedMediaTypes
 {
-	applicationcbor,
-	applicationjson,
-	applicationxml
+	cbor,
+	json,
+	xml
 }
 with {
-  variant "text 'applicationcbor' as 'application/cbor'";
-  variant "text 'applicationjson' as 'application/json'";
-  variant "text 'applicationxml' as 'application/xml'";
   variant "name as uncapitalized";
 };
 
@@ -1945,7 +1942,7 @@ with {
 type XSD.String TMGI (pattern "([a-fA-F0-9]#(6))[\d]#(5)[\d]#(0,1)");
 
 
-type XSD.String SessionDescriptionString
+type XSD.String SessionDescription
 with {
   variant "name as uncapitalized";
 };
@@ -2638,7 +2635,7 @@ with {
 type record DynAuthDasRequest
 {
 	XSD.ID originator,
-	ResourceType targetedResourceType,
+	ResourceType targetedResourceType optional,
 	Operation operation,
 	record {
 		Ipv4 ipv4Address optional,
@@ -2647,7 +2644,7 @@ type record DynAuthDasRequest
 	LocationRegion originatorLocation optional,
 	record length(1 .. infinity) of RoleID originatorRoleIDs optional,
 	AbsRelTimestamp requestTimestamp optional,
-	XSD.AnyURI targetedResourceID optional,
+	XSD.AnyURI targetedResourceID,
 	AbsRelTimestamp proposedPrivilegesLifetime optional,
 	record length(1 .. infinity) of RoleID roleIDsFromACPs optional,
 	record length(1 .. infinity) of TokenID tokenIDs optional,
@@ -2777,7 +2774,7 @@ with {
 
 type record SessionDescriptions
 {
-	record length(1 .. infinity) of SessionDescriptionString sessionDescription_list
+	record length(1 .. infinity) of SessionDescription sessionDescription_list
 }
 with {
   variant "name as uncapitalized";
@@ -3534,7 +3531,7 @@ type record CrossResourceSubscription
 	ListOfURIs regularResourcesAsTarget optional,
 	ListOfURIs subscriptionResourcesAsTarget optional,
 	TimeWindowType timeWindowType,
-	AbsRelTimestamp timeWindowSize,
+	XSD.Duration timeWindowSize,
 	EventNotificationCriteriaSet eventNotificationCriteriaSet optional,
 	EventCat notificationEventCat optional,
 	XSD.PositiveInteger expirationCounter optional,
@@ -4131,11 +4128,15 @@ type enumerated ResponseStatusCode
 	int4123(4123),
 	int4124(4124),
 	int4125(4125),
+	int4126(4126),
+	int4127(4127),
+	int4128(4128),
 	int5000(5000),
 	int5001(5001),
 	int5103(5103),
 	int5105(5105),
 	int5106(5106),
+	int5107(5107),
 	int5203(5203),
 	int5204(5204),
 	int5205(5205),
@@ -4804,22 +4805,6 @@ with {
 };
 
 
-type enumerated SerializationType
-{
-	int1(1),
-	int2(2),
-	int3(3),
-	int4(4),
-	int5(5),
-	int6(6),
-	int7(7)
-}
-with {
-  variant "useNumber";
-  variant "name as uncapitalized";
-};
-
-
 type enumerated AuthorizationDecision
 {
 	int1(1),
@@ -5522,7 +5507,7 @@ type record Group
 	SpecializationType specializationType optional,
 	XSD.NonNegativeInteger currentNrOfMembers,
 	XSD.PositiveInteger maxNrOfMembers,
-	record length(0 .. infinity) of XSD.AnyURI memberIDs,//TODO A list that can be empty,
+	record length(0 .. infinity) of XSD.AnyURI memberIDs,//TODO A list that can be empty as defined in TS-0004,
 	ListOfURIs membersAccessControlPolicyIDs optional,
 	XSD.Boolean memberTypeValidated optional,
 	ConsistencyStrategy consistencyStrategy optional,
@@ -6392,7 +6377,7 @@ type record Ontology
 	XSD.ID creator optional,
 	XSD.String description optional,
 	SemanticFormat ontologyFormat,
-	XSD.AnySimpleType ontologyContent,//FIXME Use AnySimpleType instead
+	XSD.AnySimpleType ontologyContent,
 	Sparql semanticOpExec optional,
 	union {
 		record length(1 .. infinity) of ChildResourceRef childResource_list,
@@ -6431,7 +6416,7 @@ type record OntologyAnnc
 	XSD.NonNegativeInteger stateTag,
 	XSD.String description optional,
 	SemanticFormat ontologyFormat optional,
-	XSD.AnySimpleType ontologyContent optional,//FIXME Use AnySimpleType instead
+	XSD.AnySimpleType ontologyContent optional,
 	Sparql semanticOpExec optional,
 	union {
 		record length(1 .. infinity) of ChildResourceRef childResource_list,
@@ -6895,7 +6880,7 @@ with {
 };
 
 
-type record length(0 .. infinity) of XSD.AnyURI URIList //TODO Allow URIList to be empty as defined in PRO
+type record length(0 .. infinity) of XSD.AnyURI URIList //TODO Allow URIList to be empty as defined in TS-0004
 with {
   variant "list";
   variant "element";
@@ -6950,7 +6935,7 @@ type record ResourceWrapper
 //		Sg_announcedMgmtResource_group sg_announcedMgmtResource,
 //		Sg_flexContainerResource_group sg_flexContainerResource,
 //		Sg_announcedFlexContainerResource_group sg_announcedFlexContainerResource
-//	} 
+//	} choice,
 	Resource_2 choice,//TODO Use Resource_2 type instead 
 	XSD.AnyURI uRI
 }
@@ -7951,7 +7936,7 @@ type record TimeSeriesInstance
 	ListOfURIs announceTo optional,
 	record length(1 .. infinity) of XSD.NCName announcedAttribute optional,
 	AbsRelTimestamp dataGenerationTime,
-	XSD.AnySimpleType content,//FIXME Use AnySimpleType instead
+	XSD.AnySimpleType content,
 	XSD.NonNegativeInteger sequenceNr optional,
 	XSD.NonNegativeInteger contentSize,
 	union {
@@ -7987,7 +7972,7 @@ type record TimeSeriesInstanceAnnc
 	Timestamp expirationTime,
 	XSD.AnyURI link,
 	AbsRelTimestamp dataGenerationTime optional,
-	XSD.AnySimpleType content optional,//FIXME Use AnySimpleType instead
+	XSD.AnySimpleType content optional,
 	XSD.NonNegativeInteger sequenceNr optional,
 	XSD.NonNegativeInteger contentSize optional,
 	union {
@@ -8024,7 +8009,7 @@ type record TimeSeries
 	ListOfURIs dynamicAuthorizationConsultationIDs optional,
 	ListOfURIs announceTo optional,
 	record length(1 .. infinity) of XSD.NCName announcedAttribute optional,
-	XSD.ID creator optional,//TODO XSD to be changed to make it optional
+	XSD.ID creator optional,
 	XSD.NonNegativeInteger maxNrOfInstances optional,
 	XSD.NonNegativeInteger maxByteSize optional,
 	XSD.NonNegativeInteger maxInstanceAge optional,
@@ -8249,13 +8234,12 @@ type record TriggerPayload
 	Operation triggerInfoOperation optional,
 	ResourceType targetedResourceType optional,
 	XSD.ID triggerInfoAE_ID optional,
-	record length(1 .. infinity) of SerializationType triggerInfoSerializationTypes optional
+	Serializations triggerInfoSerializationTypes optional
 }
 with {
   variant "name as uncapitalized";
   variant "element";
   variant (triggerInfoAE_ID) "name as 'triggerInfoAE-ID'";
-  variant (triggerInfoSerializationTypes) "list";
 };
 
 
diff --git a/OneM2M_Testcases_AE_Release_1.ttcn b/OneM2M_Testcases_AE_Release_1.ttcn
index bfc2869..730ac6f 100644
--- a/OneM2M_Testcases_AE_Release_1.ttcn
+++ b/OneM2M_Testcases_AE_Release_1.ttcn
@@ -634,7 +634,7 @@ module OneM2M_Testcases_AE_Release_1 {
 						var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
 						var template RequestPrimitive v_createAe := mw_createAe;
 						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid AE CREATE Registration Request containing attribute ContentSerialization";
-						v_utRequest.requestPrimitive.primitiveContent.aE.contentSerialization := {applicationxml};
+						v_utRequest.requestPrimitive.primitiveContent.aE.contentSerialization := {xml};
 						v_utRequest.forcedFields := {{name := "contentSerialization", value_ := "UNINITIALIZED"}};
 						v_createAe.primitiveContent.aE.contentSerialization := ?;//Check value other than UNINITIALIZED, done by typing
 						v_cse1.start(f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action));
@@ -1161,7 +1161,7 @@ module OneM2M_Testcases_AE_Release_1 {
 						var template RequestPrimitive v_expectedUpdateRequestAe;
 						var template UtTriggerPrimitive v_utRequest := m_utUpdateAe;
 						var universal charstring v_action :=  __SCOPE__ & ": Please, send a valid UPDATE Request for AE updating attribute contentSerialization to ";
-						v_utRequest.requestPrimitive.primitiveContent.aE.contentSerialization := {applicationxml};
+						v_utRequest.requestPrimitive.primitiveContent.aE.contentSerialization := {xml};
 						v_utRequest.forcedFields := {{name := "contentSerialization", value_ := "UNINITIALIZED"}};
 						
 						v_expectedUpdateRequestAe.primitiveContent.aE := mw_contentUpdateAe;
diff --git a/OneM2M_Testcases_CSE_Release_3.ttcn b/OneM2M_Testcases_CSE_Release_3.ttcn
index a401acc..4816080 100644
--- a/OneM2M_Testcases_CSE_Release_3.ttcn
+++ b/OneM2M_Testcases_CSE_Release_3.ttcn
@@ -250,7 +250,7 @@ module OneM2M_Testcases_CSE_Release_3 {
 						var template RequestPrimitive v_createRequest := m_createAe(PX_TS_AE1.appId);
 						var template PrimitiveContent v_contentResponse;
 						
-						v_createRequest.primitiveContent.aE.contentSerialization := {applicationxml};
+						v_createRequest.primitiveContent.aE.contentSerialization := {xml};
 
 						v_contentResponse.aE := mw_contentAeBase;
 						v_contentResponse.aE.contentSerialization := ?; 
-- 
GitLab