Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions transforms/csdl/preprocess_csdl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,22 @@
</xsl:element>
</xsl:copy>
</xsl:template>

<!-- Update UpdateRestrictions for synchronizationJob/schema navigation property -->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Annotations[@Target='microsoft.graph.synchronizationJob/schema']/edm:Annotation[@Term='Org.OData.Capabilities.V1.UpdateRestrictions']">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:element name="Record" namespace="{namespace-uri()}">
<xsl:copy-of select="edm:Record/edm:PropertyValue"/>
<xsl:call-template name="UpdateMethodTemplate">
<xsl:with-param name="httpMethod">PUT</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="UpdatableTemplate">
<xsl:with-param name="updatable">true</xsl:with-param>
</xsl:call-template>
</xsl:element>
</xsl:copy>
</xsl:template>

<!-- If only the grand-parent "Annotations" tag exists, modify it -->
<!-- Add UpdateRestrictions for crossTenantAccessPolicyConfigurationPartner/identitySynchronization navigation property -->
Expand Down
25 changes: 25 additions & 0 deletions transforms/csdl/preprocess_csdl_test_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@
<EntityType Name="servicePrincipal" BaseType="graph.directoryObject" OpenType="true">
<Property Name="appId" Type="Edm.String"/>
<NavigationProperty Name="owners" Type="Collection(graph.directoryObject)" />
<NavigationProperty Name="synchronization" Type="graph.synchronization" ContainsTarget="true"/>
</EntityType>
<EntityType Name="synchronization" BaseType="graph.entity">
<Property Name="secrets" Type="Collection(graph.synchronizationSecretKeyStringValuePair)"/>
<NavigationProperty Name="jobs" Type="Collection(graph.synchronizationJob)" ContainsTarget="true"/>
</EntityType>
<EntityType Name="synchronizationJob" BaseType="graph.entity">
<NavigationProperty Name="schema" Type="graph.synchronizationSchema" ContainsTarget="true"/>
</EntityType>
<EntityType Name="schema" BaseType="graph.entity">
<Property Name="baseType" Type="Edm.String" Nullable="false"/>
<Property Name="properties" Type="Collection(graph.property)"/>
</EntityType>
<EntityType Name="synchronizationSchema" BaseType="graph.entity">
<Property Name="synchronizationRules" Type="Collection(graph.synchronizationRule)"/>
<Property Name="version" Type="Edm.String"/>
<NavigationProperty Name="directories" Type="Collection(graph.directoryDefinition)" ContainsTarget="true"/>
</EntityType>
<EntityType Name="directoryObject" BaseType="graph.entity" OpenType="true">
<Property Name="deletedDateTime" Type="Edm.DateTimeOffset" />
Expand Down Expand Up @@ -236,6 +253,14 @@
</Record>
</Annotation>
</Annotations>
<Annotations Target="microsoft.graph.synchronizationJob/schema">
<Annotation Term="Org.OData.Capabilities.V1.UpdateRestrictions">
<Record>
<PropertyValue Property="Description" String="synchronizationJob: schema" />
<PropertyValue Property="LongDescription" String="Update the synchronization schema for a given job or template." />
</Record>
</Annotation>
</Annotations>
<Annotations Target="microsoft.graph.driveItem/children">
<Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
<Record>
Expand Down
25 changes: 25 additions & 0 deletions transforms/csdl/preprocess_csdl_test_output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@
</Record>
</Annotation>
</NavigationProperty>
<NavigationProperty Name="synchronization" Type="graph.synchronization" ContainsTarget="true" />
</EntityType>
<EntityType Name="synchronization" BaseType="graph.entity">
<Property Name="secrets" Type="Collection(graph.synchronizationSecretKeyStringValuePair)" />
<NavigationProperty Name="jobs" Type="Collection(graph.synchronizationJob)" ContainsTarget="true" />
</EntityType>
<EntityType Name="synchronizationJob" BaseType="graph.entity">
<NavigationProperty Name="schema" Type="graph.synchronizationSchema" ContainsTarget="true" />
</EntityType>
<EntityType Name="synchronizationSchema" BaseType="graph.entity">
<Property Name="synchronizationRules" Type="Collection(graph.synchronizationRule)" />
<Property Name="version" Type="Edm.String" />
<NavigationProperty Name="directories" Type="Collection(graph.directoryDefinition)" ContainsTarget="true" />
</EntityType>
<EntityType Name="directoryObject" BaseType="graph.entity" OpenType="true">
<Property Name="deletedDateTime" Type="Edm.DateTimeOffset" />
Expand Down Expand Up @@ -742,6 +755,18 @@
</Record>
</Annotation>
</Annotations>
<Annotations Target="microsoft.graph.synchronizationJob/schema">
<Annotation Term="Org.OData.Capabilities.V1.UpdateRestrictions">
<Record>
<PropertyValue Property="Description" String="synchronizationJob: schema" />
<PropertyValue Property="LongDescription" String="Update the synchronization schema for a given job or template." />
<PropertyValue Property="UpdateMethod">
<EnumMember>Org.OData.Capabilities.V1.HttpMethod/PUT</EnumMember>
</PropertyValue>
<PropertyValue Property="Updatable" Bool="true" />
</Record>
</Annotation>
</Annotations>
<Annotations Target="microsoft.graph.driveItem/children">
<Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
<Record>
Expand Down
Loading