<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2000-2021 Ericsson Telecom AB
 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v2.0
 which accompanies this distribution, and is available at
 https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html

 Contributors:
  Balasko, Jeno
  Raduly, Csaba
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns:sci="http://uri.etsi.org/ngn/params/xml/simservs/sci"
    targetNamespace="http://uri.etsi.org/ngn/params/xml/simservs/sci" elementFormDefault="qualified" version="1.0">
	<xs:annotation>
		<xs:documentation>XML Schema Definition for the AOC information</xs:documentation>
	</xs:annotation>
	<!--Definition of simple types-->
	<xs:simpleType name="bitType">
		<xs:restriction base="xs:boolean" >
		<!-- The boolean datatype value "true" maps to bit value "1" and the value "false" to bit value "0" -->
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="EightBitType">
		<xs:restriction base="xs:hexBinary">
			<xs:length value="1"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SixteenBitType">
		<xs:restriction base="xs:hexBinary">
			<xs:length value="2"/>
		</xs:restriction>
	</xs:simpleType>
<!-- Following structure of the networkIdentification value may be used: -->
<!-- {itu-t (0) administration (2) <national regulation authority> (x) network (y) node identification (z)} -->
<!-- The value for x is the value of the national regulation authority, the value for y is under the control-->
<!-- of the national regulation authority concerned, the value for z is under the control of the network concerned. -->
	<xs:simpleType name="NetworkIdentificationType">
		<xs:restriction base="xs:string">
			<xs:pattern value="02[0-9A-F]+"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CurrencyType">
		<xs:restriction base="xs:string">
			<xs:length value="3" fixed="true" />
			<!--The currency shall be coded according to ISO 4217-->
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CurrencyFactorType">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="999999"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CurrencyScaleType">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="-7"/>
			<xs:maxInclusive value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TariffDurationType">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="36000"/>
		</xs:restriction>
	</xs:simpleType>
	<!--Definition of complex types-->
	<xs:complexType name="TariffSwitchPulseType">
		<xs:sequence>
			<xs:element name="nextTariffPulse" type="sci:TariffPulseFormatType"/>
			<xs:element name="tariffSwitchOverTime" type="sci:EightBitType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="CommunicationChargePulseType">
		<!-- the choice type shall be replaced with sequence according to ASN.1 in ES 201 296 V1.3.1 -->
		<xs:sequence>
			<xs:element name="pulseUnits" type="sci:EightBitType"/>
			<xs:element name="chargeUnitTimeInterval" type="sci:SixteenBitType"/>
			<xs:element name="tariffDuration" type="sci:TariffDurationType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TariffPulseFormatType">
		<xs:sequence>
			<xs:element name="communicationChargeSequencePulse" type="sci:CommunicationChargePulseType" minOccurs="1" maxOccurs="4"/>
			<xs:element name="tariffControlIndicators" type="sci:bitType"/>
			<xs:element name="callAttemptChargePulse" type="sci:EightBitType"/>
			<xs:element name="callSetupChargePulse" type="sci:EightBitType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="CommunicationChargeCurrencyType">
		<xs:sequence>
			<xs:element name="currencyFactorScale" type="sci:CurrencyFactorScaleType"/>
			<xs:element name="tariffDuration" type="sci:TariffDurationType"/>
			<xs:element name="subTariffControl" type="sci:bitType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TariffSwitchCurrencyType">
		<xs:sequence>
			<xs:element name="nextTariffCurrency" type="sci:TariffCurrencyFormatType"/>
			<xs:element name="tariffSwitchOverTime" type="sci:EightBitType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TariffCurrencyFormatType">
		<xs:sequence>
			<xs:element name="communicationChargeSequenceCurrency" type="sci:CommunicationChargeCurrencyType" minOccurs="1" maxOccurs="4"/>
			<xs:element name="tariffControlIndicators" type="sci:bitType"/>
			<xs:element name="callAttemptChargeCurrency" type="sci:CurrencyFactorScaleType"/>
			<xs:element name="callSetupChargeCurrency" type="sci:CurrencyFactorScaleType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="CurrencyFactorScaleType">
		<xs:sequence>
			<xs:element name="currencyFactor" type="sci:CurrencyFactorType"/>
			<xs:element name="currencyScale" type="sci:CurrencyScaleType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TariffPulseType">
		<xs:sequence>
			<xs:element name="currentTariffPulse" type="sci:TariffPulseFormatType"/>
			<xs:element name="tariffSwitchPulse" type="sci:TariffSwitchPulseType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="TariffCurrencyType">
		<xs:sequence>
			<xs:element name="currentTariffCurrency" type="sci:TariffCurrencyFormatType"/>
			<xs:element name="tariffSwitchCurrency" type="sci:TariffSwitchCurrencyType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ChargingControlIndicatorsType">
		<!-- the choice type shall be replaced with sequence according to ASN.1 in ES 201 296 V1.3.1 -->
		<xs:sequence>
			<xs:element name="immediateChangeOfActuallyAppliedTariff" type="sci:bitType"/>
			<xs:element name="delayUntilStart" type="sci:bitType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ChargingReferenceIdentificationType">
		<xs:sequence>
			<xs:element name="networkIdentification" type="sci:NetworkIdentificationType"/>
			<xs:element name="referenceID" type="xs:nonNegativeInteger"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ChargingTariffInformationType">
		<xs:sequence>
			<xs:element name="chargingControlIndicators" type="sci:ChargingControlIndicatorsType"/>
			<xs:element name="chargingTariff">
				<xs:complexType>
					<xs:choice>
						<xs:element name="tariffCurrency" type="sci:TariffCurrencyType"/>
						<xs:element name="tariffPulse" type="sci:TariffPulseType"/>
					</xs:choice>
				</xs:complexType>
			</xs:element>
			<xs:element name="originationIdentification" type="sci:ChargingReferenceIdentificationType"/>
			<xs:element name="destinationIdentification" type="sci:ChargingReferenceIdentificationType" minOccurs="0"/>
			<xs:element name="currency" type="sci:CurrencyType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="AddOnChargingInformationType">
		<xs:sequence>
			<xs:element name="chargingControlIndicators" type="sci:ChargingControlIndicatorsType"/>
			<xs:element name="addOnCharge">
				<xs:complexType>
					<xs:choice>
						<xs:element name="addOnChargeCurrency" type="sci:CurrencyFactorScaleType"/>
						<xs:element name="addOnChargePulse" type="sci:EightBitType"/>
					</xs:choice>
				</xs:complexType>
			</xs:element>
			<xs:element name="originationIdentification" type="sci:ChargingReferenceIdentificationType"/>
			<xs:element name="destinationIdentification" type="sci:ChargingReferenceIdentificationType" minOccurs="0"/>
			<xs:element name="currency" type="sci:CurrencyType"/>
		</xs:sequence>
	</xs:complexType>
	<!--Definition of document structure-->
	<xs:element name="messageType">
		<xs:complexType>
			<xs:choice>
				<xs:element name="crgt" type="sci:ChargingTariffInformationType"/>
				<xs:element name="aocrg" type="sci:AddOnChargingInformationType"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
</xs:schema>
