From 4839cc61869fccec5c4196a293acb484c9bd1430 Mon Sep 17 00:00:00 2001
From: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
Date: Wed, 18 May 2022 12:32:17 +0200
Subject: [PATCH] SDS-2020-0291R08 - TS-0004_software_campaign_resource_R4

Signed-off-by: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
---
 CDT-commonTypes.xsd      |  19 ++++++++
 CDT-enumerationTypes.xsd |  26 ++++++++++
 CDT-softwareCampaign.xsd | 103 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 CDT-softwareCampaign.xsd

diff --git a/CDT-commonTypes.xsd b/CDT-commonTypes.xsd
index ea06436..a2e0234 100644
--- a/CDT-commonTypes.xsd
+++ b/CDT-commonTypes.xsd
@@ -1500,6 +1500,25 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 		</xs:choice>
 	</xs:complexType>	
 
+	<xs:complexType name="listOfSoftwareTriggerCriteria">
+		<xs:sequence>
+			<xs:element name="softwareTriggerCriterionEntry" type="m2m:softwareTriggerCriterion" minOccurs="1" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>	
+
+	<xs:complexType name="softwareTriggerCriterion">
+		<xs:sequence>
+			<xs:element name="subjectResourceID" type="xs:anyURI" minOccurs="1" />
+			<xs:element name="evalCriteria" type="m2m:evalCriteria" minOccurs="1" />
+		</xs:sequence>
+	</xs:complexType>	
+
+	<xs:complexType name="listOfActionStatuses">
+		<xs:sequence>
+			<xs:element name="actionStatusEntry" type="m2m:actionStatus" minOccurs="1" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>	
+
 	<!-- Resource type definitions. These types include the "common attributes" that are used by oneM2M Resources. Each oneM2M 
 		Resource has a resource type that is defined in a separate schema, but each resource type extends one of the types that is 
 		defined below -->
diff --git a/CDT-enumerationTypes.xsd b/CDT-enumerationTypes.xsd
index 0a266b5..d473d42 100644
--- a/CDT-enumerationTypes.xsd
+++ b/CDT-enumerationTypes.xsd
@@ -161,6 +161,8 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:enumeration value="66" />			
 			<!-- serviceSubscribedUserProfile -->
 			<xs:enumeration value="67" />			
+			<!-- softwareCampaign -->
+			<xs:enumeration value="68" />			
 			<!-- accessControlPolicyAnnc -->
 			<xs:enumeration value="10001" />
 			<!-- AEAnnc -->
@@ -222,6 +224,8 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:enumeration value="10065" />			
 			<!-- dependencyAnnc -->
 			<xs:enumeration value="10066" />			
+			<!-- softwareCampaignAnnc -->
+			<xs:enumeration value="10068" />			
 			
 		</xs:restriction>
 	</xs:simpleType>
@@ -461,6 +465,8 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:enumeration value="4138" />    
 			<!-- SERVICE_SUBSCRIPTION_NOT_ACTIVE -->
 			<xs:enumeration value="4139" />    
+			<!-- SOFTWARE_CAMPAIGN_CONFLICT -->
+			<xs:enumeration value="4140" />    
 			<!-- SERVICE_SUBSCRIPTION_LIMITS_EXCEEDED -->
 			<xs:enumeration value="4141" />    
 			
@@ -708,6 +714,8 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:enumeration value="66" />			
 			<!-- serviceSubscribedUserProfile -->
 			<xs:enumeration value="67" />			
+			<!-- softwareCampaign -->
+			<xs:enumeration value="68" />			
 			<!-- accessControlPolicyAnnc -->
 			<xs:enumeration value="10001" />
 			<!-- AEAnnc -->
@@ -769,6 +777,8 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 			<xs:enumeration value="10065" />			
 			<!-- dependencyAnnc -->
 			<xs:enumeration value="10066" />			
+			<!-- softwareCampaignAnnc -->
+			<xs:enumeration value="10068" />			
 			<!-- oldest -->
 			<xs:enumeration value="20001" />
 			<!-- latest -->
@@ -2111,5 +2121,21 @@ oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PR
 		</xs:restriction>
 	</xs:simpleType>
 
+	<xs:simpleType name="softwareOperation">
+		<xs:annotation>
+			<xs:documentation>Used for the softwareOperation attribute of the softwareCampaign resource</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:integer">
+			<!-- INSTALL -->
+			<xs:enumeration value="1" />
+			<!-- UNINSTALL -->
+			<xs:enumeration value="2" />
+			<!-- ACTIVATE -->
+			<xs:enumeration value="3" />
+			<!-- DEACTIVATE -->
+			<xs:enumeration value="4" />
+		</xs:restriction>
+	</xs:simpleType>
+
 </xs:schema>
 
diff --git a/CDT-softwareCampaign.xsd b/CDT-softwareCampaign.xsd
new file mode 100644
index 0000000..aaf64fd
--- /dev/null
+++ b/CDT-softwareCampaign.xsd
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+Copyright Notification
+
+The oneM2M Partners authorize you to copy this document, provided that you retain all copyright and other proprietary notices 
+contained in the original materials on any copies of the materials and that you comply strictly with these terms. 
+This copyright permission does not constitute an endorsement of the products or services, nor does it encompass the granting of 
+any patent rights. The oneM2M Partners assume no responsibility for errors or omissions in this document. 
+© 2022, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC). All rights reserved.
+
+Notice of Disclaimer & Limitation of Liability 
+
+The information provided in this document is directed solely to professionals who have the appropriate degree of experience to understand 
+and interpret its contents in accordance with generally accepted engineering or other professional standards and applicable regulations. 
+No recommendation as to products or vendors is made or should be implied. 
+
+NO REPRESENTATION OR WARRANTY IS MADE THAT THE INFORMATION IS TECHNICALLY ACCURATE OR SUFFICIENT OR CONFORMS TO ANY STATUTE, 
+GOVERNMENTAL RULE OR REGULATION, AND FURTHER, NO REPRESENTATION OR WARRANTY IS MADE OF MERCHANTABILITY OR FITNESS FOR ANY 
+PARTICULAR PURPOSE OR AGAINST INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS. 
+NO oneM2M PARTNER TYPE 1 SHALL BE LIABLE, BEYOND THE AMOUNT OF ANY SUM RECEIVED IN PAYMENT BY THAT PARTNER FOR THIS DOCUMENT, WITH RESPECT TO 
+ANY CLAIM, AND IN NO EVENT SHALL oneM2M BE LIABLE FOR LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES. 
+oneM2M EXPRESSLY ADVISES ANY AND ALL USE OF OR RELIANCE UPON THIS INFORMATION PROVIDED IN THIS DOCUMENT IS AT THE RISK OF THE USER.
+
+-->
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.onem2m.org/xml/protocols"
+	xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+	<xs:include schemaLocation="CDT-commonTypes.xsd" />
+	<xs:include schemaLocation="CDT-subscription.xsd" />
+	<xs:include schemaLocation="CDT-transaction.xsd"/>
+	<xs:include schemaLocation="CDT-schedule.xsd"/>
+
+	<xs:element name="softwareCampaign" substitutionGroup="m2m:sg_announceableResource">
+		<xs:complexType>
+			<xs:complexContent>
+				<!-- Inherit common attributes for announceable Resources -->
+				<xs:extension base="m2m:announceableResource">
+					<xs:sequence>
+						<!-- Common Attribute, specific to <container>, <contentInstance>, <request> and <delivery> and other resources -->
+						
+						<!-- Resource Specific Attributes -->
+						<xs:element name="campaignEnabled" type="xs:boolean" />
+						<xs:element name="campaignStatus" type="m2m:execStatusType" />
+						<xs:element name="version" type="xs:string" />
+						<xs:element name="softwareName" type="xs:string" />
+						<xs:element name="URL" type="xs:anyURI" />
+						<xs:element name="softwareTargets" type="m2m:listOfURIs" />
+						<xs:element name="softwareTriggerCriteria" type="m2m:listOfSoftwareTriggerCriteria" minOccurs="0" />
+						<xs:element name="softwareOperation" type="m2m:softwareOperation" />
+						<xs:element name="softwareLinks" type="m2m:listOfURIs" />
+						<xs:element name="aggregatedSoftwareStatus" type="m2m:status" />
+						<xs:element name="individualSoftwareStatuses" type="m2m:listOfActionStatuses" />
+						
+						<!-- Child Resources -->
+						<xs:choice minOccurs="0" maxOccurs="1">
+							<xs:element name="childResource" type="m2m:childResourceRef" minOccurs="1" maxOccurs="unbounded" />
+							<xs:choice minOccurs="1" maxOccurs="unbounded">
+								<xs:element ref="m2m:subscription" />
+								<xs:element ref="m2m:transaction" />
+								<xs:element ref="m2m:schedule" />
+							</xs:choice>
+						</xs:choice>
+					</xs:sequence>
+				</xs:extension>
+			</xs:complexContent>
+		</xs:complexType>
+	</xs:element>
+	
+	<xs:element name="softwareCampaignAnnc" substitutionGroup="m2m:sg_announcedResource">
+		<xs:complexType>
+			<xs:complexContent>
+				<!-- Inherit common attributes for announceable Resources -->
+				<xs:extension base="m2m:announcedResource">
+					<xs:sequence>
+						<!-- Resource Specific Attributes -->
+						<xs:element name="campaignEnabled" type="xs:boolean" minOccurs="0" />
+						<xs:element name="campaignStatus" type="m2m:execStatusType" minOccurs="0" />
+						<xs:element name="version" type="xs:string" minOccurs="0" />
+						<xs:element name="softwareName" type="xs:string" minOccurs="0" />
+						<xs:element name="URL" type="xs:anyURI" minOccurs="0" />
+						<xs:element name="softwareTargets" type="m2m:listOfURIs" minOccurs="0" />
+						<xs:element name="softwareTriggerCriteria" type="m2m:listOfSoftwareTriggerCriteria" minOccurs="0" />
+						<xs:element name="softwareOperation" type="m2m:softwareOperation" minOccurs="0" />
+						<xs:element name="softwareLinks" type="m2m:listOfURIs" minOccurs="0" />
+						<xs:element name="aggregatedSoftwareStatus" type="m2m:status" minOccurs="0" />
+						<xs:element name="individualSoftwareStatuses" type="m2m:listOfActionStatuses" minOccurs="0" />
+						
+						<!-- Child Resources -->
+						<xs:choice minOccurs="0" maxOccurs="1">
+							<xs:element name="childResource" type="m2m:childResourceRef" minOccurs="1" maxOccurs="unbounded" />
+							<xs:choice minOccurs="1" maxOccurs="unbounded">
+								<xs:element ref="m2m:subscription" />
+								<xs:element ref="m2m:transaction" />
+								<xs:element ref="m2m:schedule" />
+							</xs:choice>
+						</xs:choice>
+					</xs:sequence>
+				</xs:extension>
+			</xs:complexContent>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
-- 
GitLab