Skip to content

Commit 6655261

Browse files
authored
Merge pull request #792 from microsoftgraph/andrueastman/protectionUnits
fix: add missing `DerivedTypeConstraint` annotations for `protectionUnits` navigation property.
2 parents 08aa155 + bfcc754 commit 6655261

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

transforms/csdl/preprocess_csdl.xsl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,18 @@
499499
</Collection>
500500
</Annotation>
501501
</xsl:copy>
502+
</xsl:template>
503+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='backupRestoreRoot']/edm:NavigationProperty[@Name='protectionUnits']">
504+
<xsl:copy>
505+
<xsl:copy-of select="@* | node()" />
506+
<Annotation Term="Org.OData.Validation.V1.DerivedTypeConstraint">
507+
<Collection>
508+
<String>microsoft.graph.siteProtectionUnit</String>
509+
<String>microsoft.graph.mailboxProtectionUnit</String>
510+
<String>microsoft.graph.driveProtectionUnit</String>
511+
</Collection>
512+
</Annotation>
513+
</xsl:copy>
502514
</xsl:template>
503515
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='externalUsersSelfServiceSignUpEventsFlow']/edm:Property[@Name='onAttributeCollection']">
504516
<xsl:copy>

transforms/csdl/preprocess_csdl_test_input.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,14 @@
434434
<Property Name="displayName" Type="Edm.String" />
435435
<NavigationProperty Name="details" Type="Collection(graph.landingPageDetail)" />
436436
</EntityType>
437+
<EntityType Name="protectionUnitBase" BaseType="graph.entity">
438+
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />
439+
<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset" />
440+
</EntityType>
441+
<EntityType Name="backupRestoreRoot" BaseType="graph.entity">
442+
<Property Name="serviceStatus" Type="graph.serviceStatus" />
443+
<NavigationProperty Name="protectionUnits" Type="Collection(graph.protectionUnitBase)" />
444+
</EntityType>
437445
<EntityType Name="b2xIdentityUserFlow" BaseType="graph.identityUserFlow">
438446
<Property Name="apiConnectorConfiguration" Type="graph.userFlowApiConnectorConfiguration" />
439447
<NavigationProperty Name="identityProviders" Type="Collection(graph.identityProvider)" />

transforms/csdl/preprocess_csdl_test_output.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,22 @@
996996
<Property Name="displayName" Type="Edm.String" />
997997
<NavigationProperty Name="details" Type="Collection(graph.landingPageDetail)" ContainsTarget="true" />
998998
</EntityType>
999+
<EntityType Name="protectionUnitBase" BaseType="graph.entity">
1000+
<Property Name="createdDateTime" Type="Edm.DateTimeOffset" />
1001+
<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset" />
1002+
</EntityType>
1003+
<EntityType Name="backupRestoreRoot" BaseType="graph.entity">
1004+
<Property Name="serviceStatus" Type="graph.serviceStatus" />
1005+
<NavigationProperty Name="protectionUnits" Type="Collection(graph.protectionUnitBase)">
1006+
<Annotation Term="Org.OData.Validation.V1.DerivedTypeConstraint" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
1007+
<Collection>
1008+
<String>microsoft.graph.siteProtectionUnit</String>
1009+
<String>microsoft.graph.mailboxProtectionUnit</String>
1010+
<String>microsoft.graph.driveProtectionUnit</String>
1011+
</Collection>
1012+
</Annotation>
1013+
</NavigationProperty>
1014+
</EntityType>
9991015
<EntityType Name="b2xIdentityUserFlow" BaseType="graph.identityUserFlow">
10001016
<Property Name="apiConnectorConfiguration" Type="graph.userFlowApiConnectorConfiguration" />
10011017
<NavigationProperty Name="identityProviders" Type="Collection(graph.identityProvider)" />

0 commit comments

Comments
 (0)