<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://gcube-system.org/namespaces/data/analysis/statisticalmanager/types"
	xmlns:tns="http://gcube-system.org/namespaces/data/analysis/statisticalmanager/types"
	xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
	xmlns:corefaults="http://gcube-system.org/namespaces/common/core/faults"
	elementFormDefault="qualified" attributeFormDefault="unqualified">

	<!-- StatisticalManager operations -->

	<xsd:simpleType name="ComputationalAgentClass">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="DISTRIBUTIONS" />
			<xsd:enumeration value="MODELS" />
			<xsd:enumeration value="EVALUATORS" />
			<xsd:enumeration value="CLUSTERERS" />
			<xsd:enumeration value="TRANSDUCERS" />
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="StatisticalServiceType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="TABULAR" />
			<xsd:enumeration value="FILE" />
			<xsd:enumeration value="PRIMITIVE" />
			<xsd:enumeration value="LIST" />
			<xsd:enumeration value="ENUM" />
			<xsd:enumeration value="TABULAR_LIST" />
			<xsd:enumeration value="COLUMN_LIST" />
			<xsd:enumeration value="COLUMN" />
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:complexType name="SMInputEntry">
		<xsd:sequence>
			<xsd:element name="key" type="xsd:string" />
			<xsd:element name="value" type="xsd:string" />
		</xsd:sequence>
	</xsd:complexType>


	<xsd:complexType name="SMEntry">
		<xsd:sequence>
			<xsd:element name="entryId" type="xsd:long" />
			<xsd:element name="computationId" type="xsd:long" />
			<xsd:element name="key" type="xsd:string" />
			<xsd:element name="value" type="xsd:string" />
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="SMEntries">
		<xsd:sequence>
			<xsd:element name="list" type="tns:SMInputEntry"
				minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="SMPagedRequest" abstract="true">
		<xsd:sequence>
			<xsd:element name="user" type="xsd:string" />
			<xsd:element name="page" type="xsd:int" />
			<xsd:element name="pageSize" type="xsd:int" />
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="SMOperation" abstract="true">
		<xsd:sequence>
			<xsd:element name="operationType" type="xsd:int" />
			<xsd:element name="operationId" type="xsd:long" />
			<xsd:element name="portalLogin" type="xsd:string" />
			<xsd:element name="submissionDate" type="xsd:dateTime" />
			<xsd:element name="completedDate" type="xsd:dateTime" />
			<xsd:element name="operationStatus" type="xsd:int" />
			<xsd:element name="description" type="xsd:string" />
			<xsd:element name="abstractResource" type="tns:SMAbstractResource" />
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="SMComputation">
		<xsd:complexContent>
			<xsd:extension base="tns:SMOperation">
				<xsd:sequence>
					<xsd:element name="title" type="xsd:string" />
					<xsd:element name="algorithm" type="xsd:string" />
					<xsd:element name="category" type="xsd:string" />
					<xsd:element name="parameters" type="tns:SMEntry"
						minOccurs="0" maxOccurs="unbounded" />
					<xsd:element name="infrastructure" type="xsd:string" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMImport">
		<xsd:complexContent>
			<xsd:extension base="tns:SMOperation">
				<xsd:sequence>
					<xsd:element name="fileName" type="xsd:string" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMSystemImport">
		<xsd:complexContent>
			<xsd:extension base="tns:SMOperation">
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMAbstractResource">
		<xsd:sequence>
			<xsd:element name="abstractResourceId" type="xsd:string" />
			<xsd:element name="resource" type="tns:SMResource" />
		</xsd:sequence>
	</xsd:complexType>


	<xsd:complexType name="SMResource" abstract="true">
		<xsd:sequence>
			<xsd:element name="resourceId" type="xsd:string" />
			<xsd:element name="resourceType" type="xsd:int" />
			<xsd:element name="portalLogin" type="xsd:string" />
			<xsd:element name="operationId" type="xsd:long" />
			<xsd:element name="description" type="xsd:string" />
			<xsd:element name="name" type="xsd:string" />
			<xsd:element name="provenance" type="xsd:int" />
			<xsd:element name="creationDate" type="xsd:dateTime" />
			<xsd:element name="algorithm" type="xsd:string" />
		</xsd:sequence>
	</xsd:complexType>


	<xsd:complexType name="SMTable">
		<xsd:complexContent>
			<xsd:extension base="tns:SMResource">
				<xsd:sequence>
					<xsd:element name="template" type="xsd:string" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMFile">
		<xsd:complexContent>
			<xsd:extension base="tns:SMResource">
				<xsd:sequence>
					<xsd:element name="url" type="xsd:string" />
					<xsd:element name="mimeType" type="xsd:string" />
					<xsd:element name="remoteName" type="xsd:string" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMObject">
		<xsd:complexContent>
			<xsd:extension base="tns:SMResource">
				<xsd:sequence>
					<xsd:element name="url" type="xsd:string" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMError">
		<xsd:complexContent>
			<xsd:extension base="tns:SMResource">
				<xsd:sequence>
					<xsd:element name="message" type="xsd:string" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="SMOperationInfo">
		<xsd:sequence>
			<xsd:element name="status" type="xsd:int" />
			<xsd:element name="percentage" type="xsd:string" />
		</xsd:sequence>
	</xsd:complexType>

</xsd:schema>