Skip to content

Commit 54b1735

Browse files
committed
add sxl annotation transforms for instances and exceptionOccurrences
1 parent 57d3275 commit 54b1735

3 files changed

Lines changed: 112 additions & 1 deletion

File tree

transforms/csdl/preprocess_csdl.xsl

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,11 +967,37 @@
967967
</xsl:call-template>
968968
</xsl:element>
969969
</xsl:element>
970+
<xsl:element name="PropertyValue">
971+
<xsl:attribute name="Property">Navigability</xsl:attribute>
972+
<xsl:element name="EnumMember">Org.OData.Capabilities.V1.NavigationType/None</xsl:element>
973+
</xsl:element>
970974
</xsl:element>
971975
</xsl:element>
972976
</xsl:copy>
973977
</xsl:template>
974978

979+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='event']/edm:NavigationProperty[@Name='exceptionOccurrences']">
980+
<xsl:copy>
981+
<xsl:apply-templates select="@* | node()"/>
982+
<xsl:choose>
983+
<xsl:when test="$open-api-generation='False'">
984+
<xsl:element name="Annotations">
985+
<xsl:attribute name="Target">microsoft.graph.event/exceptionOccurrences</xsl:attribute>
986+
<xsl:element name="Annotation">
987+
<xsl:attribute name="Term">Org.OData.Capabilities.V1.NavigationRestrictions</xsl:attribute>
988+
<xsl:element name="Record" namespace="{namespace-uri()}">
989+
<xsl:element name="PropertyValue">
990+
<xsl:attribute name="Property">Navigability</xsl:attribute>
991+
<xsl:element name="EnumMember">Org.OData.Capabilities.V1.NavigationType/None</xsl:element>
992+
</xsl:element>
993+
</xsl:element>
994+
</xsl:element>
995+
</xsl:element>
996+
</xsl:when>
997+
</xsl:choose>
998+
</xsl:copy>
999+
</xsl:template>
1000+
9751001
<!-- Add paths for user mailboxSettings by adding annotations to read and update the complex property-->
9761002
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='user']/edm:Property[@Name='mailboxSettings']">
9771003
<xsl:copy>
@@ -1375,7 +1401,7 @@
13751401
</xsl:template>
13761402

13771403
<!-- Add Navigation Restrictions Annotations -->
1378-
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']">
1404+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']">
13791405
<xsl:copy>
13801406
<xsl:apply-templates select="@* | node()"/>
13811407

transforms/csdl/preprocess_csdl_test_input.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,42 @@
1919
<Property Name="ruleName" Type="Edm.String" />
2020
<NavigationProperty Name="scheduledActionConfigurations" Type="Collection(graph.deviceManagementComplianceActionItem)" />
2121
</EntityType>
22+
<EntityType Name="event" BaseType="graph.outlookItem" OpenType="true">
23+
<NavigationProperty Name="exceptionOccurrences" Type="Collection(graph.event)" ContainsTarget="true" />
24+
<NavigationProperty Name="instances" Type="Collection(graph.event)" ContainsTarget="true">
25+
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
26+
<Record>
27+
<PropertyValue Property="RestrictedProperties">
28+
<Collection>
29+
<Record>
30+
<PropertyValue Property="NavigationProperty">
31+
<PropertyPath>instances</PropertyPath>
32+
</PropertyValue>
33+
<PropertyValue Property="ReadRestrictions">
34+
<Record>
35+
<PropertyValue Property="CustomQueryOptions">
36+
<Collection>
37+
<Record>
38+
<PropertyValue Property="Name" String="startDateTime" />
39+
<PropertyValue Property="Description" String="The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00" />
40+
<PropertyValue Property="Required" Bool="true" />
41+
</Record>
42+
<Record>
43+
<PropertyValue Property="Name" String="endDateTime" />
44+
<PropertyValue Property="Description" String="The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00" />
45+
<PropertyValue Property="Required" Bool="true" />
46+
</Record>
47+
</Collection>
48+
</PropertyValue>
49+
</Record>
50+
</PropertyValue>
51+
</Record>
52+
</Collection>
53+
</PropertyValue>
54+
</Record>
55+
</Annotation>
56+
</NavigationProperty>
57+
</EntityType>
2258
<EntityType Name="plannerPlan" BaseType="graph.entity">
2359
<Property Name="createdBy" Type="graph.identitySet" />
2460
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />

transforms/csdl/preprocess_csdl_test_output.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,55 @@
5454
<Property Name="ruleName" Type="Edm.String" />
5555
<NavigationProperty Name="scheduledActionConfigurations" Type="Collection(graph.deviceManagementComplianceActionItem)" ContainsTarget="true" />
5656
</EntityType>
57+
<EntityType Name="event" BaseType="graph.outlookItem" OpenType="true">
58+
<NavigationProperty Name="exceptionOccurrences" Type="Collection(graph.event)" ContainsTarget="true">
59+
<Annotations Target="microsoft.graph.event/exceptionOccurrences">
60+
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
61+
<Record>
62+
<PropertyValue Property="Navigability">
63+
<EnumMember>Org.OData.Capabilities.V1.NavigationType/None</EnumMember>
64+
</PropertyValue>
65+
</Record>
66+
</Annotation>
67+
</Annotations>
68+
</NavigationProperty>
69+
<NavigationProperty Name="instances" Type="Collection(graph.event)" ContainsTarget="true">
70+
<Annotation Term="Org.OData.Capabilities.V1.NavigationRestrictions">
71+
<Record>
72+
<PropertyValue Property="RestrictedProperties">
73+
<Collection>
74+
<Record>
75+
<PropertyValue Property="NavigationProperty">
76+
<PropertyPath>instances</PropertyPath>
77+
</PropertyValue>
78+
<PropertyValue Property="ReadRestrictions">
79+
<Record>
80+
<PropertyValue Property="CustomQueryOptions">
81+
<Collection>
82+
<Record>
83+
<PropertyValue Property="Name" String="startDateTime" />
84+
<PropertyValue Property="Description" String="The start date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T19:00:00-08:00" />
85+
<PropertyValue Property="Required" Bool="true" />
86+
</Record>
87+
<Record>
88+
<PropertyValue Property="Name" String="endDateTime" />
89+
<PropertyValue Property="Description" String="The end date and time of the time range, represented in ISO 8601 format. For example, 2019-11-08T20:00:00-08:00" />
90+
<PropertyValue Property="Required" Bool="true" />
91+
</Record>
92+
</Collection>
93+
</PropertyValue>
94+
</Record>
95+
</PropertyValue>
96+
</Record>
97+
</Collection>
98+
</PropertyValue>
99+
<PropertyValue Property="Navigability">
100+
<EnumMember>Org.OData.Capabilities.V1.NavigationType/None</EnumMember>
101+
</PropertyValue>
102+
</Record>
103+
</Annotation>
104+
</NavigationProperty>
105+
</EntityType>
57106
<EntityType Name="plannerPlan" BaseType="graph.entity">
58107
<Property Name="createdBy" Type="graph.identitySet" />
59108
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />

0 commit comments

Comments
 (0)