<?xml version="1.0" encoding="UTF-8" ?>

<xsd:schema xmlns="https://sentry.io/schema/dic/sentry-symfony"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="https://sentry.io/schema/dic/sentry-symfony"
            elementFormDefault="qualified">

    <xsd:element name="config" type="config" />

    <xsd:complexType name="config">
        <xsd:choice maxOccurs="unbounded">
            <xsd:element name="options" type="options" minOccurs="0" maxOccurs="1" />
            <xsd:element name="messenger" type="messenger" minOccurs="0" maxOccurs="1" />
            <xsd:element name="tracing" type="tracing" minOccurs="0" maxOccurs="1" />
        </xsd:choice>

        <xsd:attribute name="register-error-listener" type="xsd:boolean" />
        <xsd:attribute name="register-error-handler" type="xsd:boolean" />
        <xsd:attribute name="transport-factory" type="xsd:string" />
        <xsd:attribute name="dsn" type="xsd:string" />
        <xsd:attribute name="logger" type="xsd:string" />
    </xsd:complexType>

    <xsd:complexType name="options">
        <xsd:sequence>
            <xsd:element name="integration" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="trace-propagation-target" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="prefix" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="in-app-exclude" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="in-app-include" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="class-serializer" type="class-serializer" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="ignore-exception" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
            <xsd:element name="ignore-transaction" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>

        <xsd:attribute name="default-integrations" type="xsd:boolean" />
        <xsd:attribute name="send-attempts" type="xsd:integer" />
        <xsd:attribute name="sample-rate" type="xsd:float" />
        <xsd:attribute name="traces-sample-rate" type="xsd:float" />
        <xsd:attribute name="profiles-sample-rate" type="xsd:float" />
        <xsd:attribute name="traces-sampler" type="xsd:string" />
        <xsd:attribute name="attach-stacktrace" type="xsd:boolean" />
        <xsd:attribute name="context-lines" type="xsd:integer" />
        <xsd:attribute name="enable-compression" type="xsd:boolean" />
        <xsd:attribute name="environment" type="xsd:string" />
        <xsd:attribute name="logger" type="xsd:string" />
        <xsd:attribute name="release" type="xsd:string" />
        <xsd:attribute name="server-name" type="xsd:string" />
        <xsd:attribute name="before-send" type="xsd:string" />
        <xsd:attribute name="before-send-transaction" type="xsd:string" />
        <xsd:attribute name="error-types" type="xsd:string" />
        <xsd:attribute name="max-breadcrumbs" type="xsd:integer" />
        <xsd:attribute name="before-breadcrumb" type="xsd:string" />
        <xsd:attribute name="send-default-pii" type="xsd:boolean" />
        <xsd:attribute name="max-value-length" type="xsd:integer" />
        <xsd:attribute name="http-proxy" type="xsd:string" />
        <xsd:attribute name="http-timeout" type="xsd:integer" />
        <xsd:attribute name="http-connect-timeout" type="xsd:integer" />
        <xsd:attribute name="capture-silenced-errors" type="xsd:boolean" />
        <xsd:attribute name="max-request-body-size" type="max-request-body-size" />
    </xsd:complexType>

    <xsd:complexType name="tag">
        <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

    <xsd:complexType name="class-serializer">
        <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute name="class" type="xsd:string" use="required" />
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

    <xsd:simpleType name="max-request-body-size">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="none" />
            <xsd:enumeration value="small" />
            <xsd:enumeration value="medium" />
            <xsd:enumeration value="always" />
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="messenger">
        <xsd:attribute name="enabled" type="xsd:boolean" />
        <xsd:attribute name="capture-soft-fails" type="xsd:boolean" />
    </xsd:complexType>

    <xsd:complexType name="tracing">
        <xsd:choice maxOccurs="unbounded">
            <xsd:element name="dbal" type="tracing-dbal" minOccurs="0" maxOccurs="1" />
            <xsd:element name="twig" type="tracing-twig" minOccurs="0" maxOccurs="1" />
            <xsd:element name="cache" type="tracing-cache" minOccurs="0" maxOccurs="1" />
            <xsd:element name="console" type="tracing-console" minOccurs="0" maxOccurs="1" />
            <xsd:element name="http-client" type="tracing-http-client" minOccurs="0" maxOccurs="1" />
        </xsd:choice>

        <xsd:attribute name="enabled" type="xsd:boolean" default="true"/>
    </xsd:complexType>

    <xsd:complexType name="tracing-dbal">
        <xsd:sequence maxOccurs="unbounded">
            <xsd:element name="connection" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>

        <xsd:attribute name="enabled" type="xsd:boolean" />
    </xsd:complexType>

    <xsd:complexType name="tracing-twig">
        <xsd:attribute name="enabled" type="xsd:boolean" />
    </xsd:complexType>

    <xsd:complexType name="tracing-cache">
        <xsd:attribute name="enabled" type="xsd:boolean" />
    </xsd:complexType>

    <xsd:complexType name="tracing-console">
        <xsd:sequence maxOccurs="unbounded">
            <xsd:element name="excluded-command" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="tracing-http-client">
        <xsd:attribute name="enabled" type="xsd:boolean" />
    </xsd:complexType>
</xsd:schema>
