<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
  <edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Common.xml">
    <edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
  </edmx:Reference>
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
    <edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
  </edmx:Reference>
  <edmx:DataServices>
    <Schema Namespace="AuditRuleService" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <EntityContainer Name="EntityContainer">
        <EntitySet Name="AuditRule" EntityType="AuditRuleService.AuditRule">
          <NavigationPropertyBinding Path="conditions" Target="AuditConditions"/>
        </EntitySet>
        <EntitySet Name="AuditConditions" EntityType="AuditRuleService.AuditConditions">
          <NavigationPropertyBinding Path="audit_rule" Target="AuditRule"/>
        </EntitySet>
        <ActionImport Name="GetRuleWithConditions" Action="AuditRuleService.GetRuleWithConditions" EntitySet="AuditRule"/>
      </EntityContainer>
      <EntityType Name="AuditRule">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="name" Type="Edm.String" MaxLength="100"/>
        <Property Name="stopType" Type="Edm.String" MaxLength="50"/>
        <Property Name="group" Type="Edm.String" MaxLength="50"/>
        <Property Name="expect_code" Type="Edm.String" MaxLength="50"/>
        <Property Name="exception_level" Type="Edm.Int32"/>
        <Property Name="policies_ID" Type="Edm.Guid"/>
        <NavigationProperty Name="conditions" Type="Collection(AuditRuleService.AuditConditions)" Partner="audit_rule">
          <OnDelete Action="Cascade"/>
        </NavigationProperty>
        <Property Name="status" Type="Edm.String" MaxLength="50"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="conditions_snapshot" Type="Edm.String"/>
        <Property Name="conditions_map" Type="Edm.String"/>
        <Property Name="created_by" Type="Edm.String" MaxLength="128"/>
        <Property Name="updated_by" Type="Edm.String" MaxLength="128"/>
      </EntityType>
      <EntityType Name="AuditConditions">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <NavigationProperty Name="audit_rule" Type="AuditRuleService.AuditRule" Partner="conditions">
          <ReferentialConstraint Property="audit_rule_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="audit_rule_ID" Type="Edm.Guid"/>
        <Property Name="condition_key" Type="Edm.String" MaxLength="50"/>
        <Property Name="operator" Type="Edm.String" MaxLength="10"/>
        <Property Name="threshold_value" Type="Edm.String" MaxLength="50"/>
        <Property Name="role" Type="Edm.String" MaxLength="16"/>
        <Property Name="scope" Type="Edm.String" MaxLength="64"/>
        <Property Name="event_type" Type="Edm.String" MaxLength="64"/>
        <Property Name="field_name" Type="Edm.String" MaxLength="256"/>
        <Property Name="value" Type="Edm.String"/>
        <Property Name="condition_group" Type="Edm.String"/>
        <Property Name="logical_operator" Type="Edm.String" MaxLength="10"/>
        <Property Name="exception_message" Type="Edm.String"/>
        <Property Name="segment_info" Type="Edm.String"/>
        <Property Name="order_index" Type="Edm.Int32"/>
        <Property Name="ui_id" Type="Edm.String" MaxLength="128"/>
        <Property Name="dbRowId" Type="Edm.String" MaxLength="128"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="created_by" Type="Edm.String" MaxLength="128"/>
        <Property Name="updated_by" Type="Edm.String" MaxLength="128"/>
      </EntityType>
      <Action Name="GetRuleWithConditions" IsBound="false">
        <Parameter Name="ID" Type="Edm.Guid"/>
        <ReturnType Type="AuditRuleService.AuditRule"/>
      </Action>
      <Annotations Target="AuditRuleService.AuditRule/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="AuditRuleService.AuditConditions/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>