Skip to content

Commit 4b2ed59

Browse files
authored
Merge pull request #761 from microsoftgraph/tm/fix-updateMgBetaServicePrincipalSynchronizationJobSchema
Adds update restrictions for ``microsoft.graph.synchronizationJob/schema`` navigation property
2 parents 3b3bdbc + 8a69c5e commit 4b2ed59

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

transforms/csdl/preprocess_csdl.xsl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,22 @@
21772177
</xsl:element>
21782178
</xsl:copy>
21792179
</xsl:template>
2180+
2181+
<!-- Update UpdateRestrictions for synchronizationJob/schema navigation property -->
2182+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Annotations[@Target='microsoft.graph.synchronizationJob/schema']/edm:Annotation[@Term='Org.OData.Capabilities.V1.UpdateRestrictions']">
2183+
<xsl:copy>
2184+
<xsl:copy-of select="@*"/>
2185+
<xsl:element name="Record" namespace="{namespace-uri()}">
2186+
<xsl:copy-of select="edm:Record/edm:PropertyValue"/>
2187+
<xsl:call-template name="UpdateMethodTemplate">
2188+
<xsl:with-param name="httpMethod">PUT</xsl:with-param>
2189+
</xsl:call-template>
2190+
<xsl:call-template name="UpdatableTemplate">
2191+
<xsl:with-param name="updatable">true</xsl:with-param>
2192+
</xsl:call-template>
2193+
</xsl:element>
2194+
</xsl:copy>
2195+
</xsl:template>
21802196

21812197
<!-- If only the grand-parent "Annotations" tag exists, modify it -->
21822198
<!-- Add UpdateRestrictions for crossTenantAccessPolicyConfigurationPartner/identitySynchronization navigation property -->

transforms/csdl/preprocess_csdl_test_input.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@
4747
<EntityType Name="servicePrincipal" BaseType="graph.directoryObject" OpenType="true">
4848
<Property Name="appId" Type="Edm.String"/>
4949
<NavigationProperty Name="owners" Type="Collection(graph.directoryObject)" />
50+
<NavigationProperty Name="synchronization" Type="graph.synchronization" ContainsTarget="true"/>
51+
</EntityType>
52+
<EntityType Name="synchronization" BaseType="graph.entity">
53+
<Property Name="secrets" Type="Collection(graph.synchronizationSecretKeyStringValuePair)"/>
54+
<NavigationProperty Name="jobs" Type="Collection(graph.synchronizationJob)" ContainsTarget="true"/>
55+
</EntityType>
56+
<EntityType Name="synchronizationJob" BaseType="graph.entity">
57+
<NavigationProperty Name="schema" Type="graph.synchronizationSchema" ContainsTarget="true"/>
58+
</EntityType>
59+
<EntityType Name="schema" BaseType="graph.entity">
60+
<Property Name="baseType" Type="Edm.String" Nullable="false"/>
61+
<Property Name="properties" Type="Collection(graph.property)"/>
62+
</EntityType>
63+
<EntityType Name="synchronizationSchema" BaseType="graph.entity">
64+
<Property Name="synchronizationRules" Type="Collection(graph.synchronizationRule)"/>
65+
<Property Name="version" Type="Edm.String"/>
66+
<NavigationProperty Name="directories" Type="Collection(graph.directoryDefinition)" ContainsTarget="true"/>
5067
</EntityType>
5168
<EntityType Name="directoryObject" BaseType="graph.entity" OpenType="true">
5269
<Property Name="deletedDateTime" Type="Edm.DateTimeOffset" />
@@ -236,6 +253,14 @@
236253
</Record>
237254
</Annotation>
238255
</Annotations>
256+
<Annotations Target="microsoft.graph.synchronizationJob/schema">
257+
<Annotation Term="Org.OData.Capabilities.V1.UpdateRestrictions">
258+
<Record>
259+
<PropertyValue Property="Description" String="synchronizationJob: schema" />
260+
<PropertyValue Property="LongDescription" String="Update the synchronization schema for a given job or template." />
261+
</Record>
262+
</Annotation>
263+
</Annotations>
239264
<Annotations Target="microsoft.graph.driveItem/children">
240265
<Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
241266
<Record>

transforms/csdl/preprocess_csdl_test_output.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,19 @@
217217
</Record>
218218
</Annotation>
219219
</NavigationProperty>
220+
<NavigationProperty Name="synchronization" Type="graph.synchronization" ContainsTarget="true" />
221+
</EntityType>
222+
<EntityType Name="synchronization" BaseType="graph.entity">
223+
<Property Name="secrets" Type="Collection(graph.synchronizationSecretKeyStringValuePair)" />
224+
<NavigationProperty Name="jobs" Type="Collection(graph.synchronizationJob)" ContainsTarget="true" />
225+
</EntityType>
226+
<EntityType Name="synchronizationJob" BaseType="graph.entity">
227+
<NavigationProperty Name="schema" Type="graph.synchronizationSchema" ContainsTarget="true" />
228+
</EntityType>
229+
<EntityType Name="synchronizationSchema" BaseType="graph.entity">
230+
<Property Name="synchronizationRules" Type="Collection(graph.synchronizationRule)" />
231+
<Property Name="version" Type="Edm.String" />
232+
<NavigationProperty Name="directories" Type="Collection(graph.directoryDefinition)" ContainsTarget="true" />
220233
</EntityType>
221234
<EntityType Name="directoryObject" BaseType="graph.entity" OpenType="true">
222235
<Property Name="deletedDateTime" Type="Edm.DateTimeOffset" />
@@ -742,6 +755,18 @@
742755
</Record>
743756
</Annotation>
744757
</Annotations>
758+
<Annotations Target="microsoft.graph.synchronizationJob/schema">
759+
<Annotation Term="Org.OData.Capabilities.V1.UpdateRestrictions">
760+
<Record>
761+
<PropertyValue Property="Description" String="synchronizationJob: schema" />
762+
<PropertyValue Property="LongDescription" String="Update the synchronization schema for a given job or template." />
763+
<PropertyValue Property="UpdateMethod">
764+
<EnumMember>Org.OData.Capabilities.V1.HttpMethod/PUT</EnumMember>
765+
</PropertyValue>
766+
<PropertyValue Property="Updatable" Bool="true" />
767+
</Record>
768+
</Annotation>
769+
</Annotations>
745770
<Annotations Target="microsoft.graph.driveItem/children">
746771
<Annotation Term="Org.OData.Capabilities.V1.ReadRestrictions">
747772
<Record>

0 commit comments

Comments
 (0)