Skip to content

Commit 182fd69

Browse files
authored
Merge pull request #500 from microsoftgraph/is/delta-change-type-param
Adds `changeType` custom query option to delta function for `messages`
2 parents 0b30de7 + 45c8fee commit 182fd69

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

transforms/csdl/preprocess_csdl.xsl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,26 @@
668668
</Annotation>
669669
</xsl:copy>
670670
</xsl:template>
671+
672+
<!--Delta function for messages needs the changeType parameter-->
673+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Function[@Name='delta'][edm:Parameter[@Name='bindingparameter']][edm:Parameter[@Type='Collection(graph.message)']]">
674+
<xsl:copy>
675+
<xsl:apply-templates select="@* | node()"/>
676+
<Annotation Term="Org.OData.Capabilities.V1.OperationRestrictions">
677+
<Record>
678+
<PropertyValue Property="CustomQueryOptions">
679+
<Collection>
680+
<Record>
681+
<PropertyValue Property="Name" String="changeType" />
682+
<PropertyValue Property="Description" String="A custom query option to filter the delta response based on the type of change. Supported values are created, updated or deleted." />
683+
<PropertyValue Property="Required" Bool="true" />
684+
</Record>
685+
</Collection>
686+
</PropertyValue>
687+
</Record>
688+
</Annotation>
689+
</xsl:copy>
690+
</xsl:template>
671691

672692
<!-- Add custom query options to calendarView navigation property -->
673693
<xsl:template name="CalendarViewRestrictedPopertyTemplate">

transforms/csdl/preprocess_csdl_test_input.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@
381381
<EntitySet Name="directoryObjects" EntityType="microsoft.graph.directoryObject" />
382382
<EntitySet Name="places" EntityType="microsoft.graph.place" />
383383
</EntityContainer>
384+
<Function Name="delta" IsBound="true">
385+
<Parameter Name="bindingparameter" Type="Collection(graph.message)" Nullable="false" />
386+
<ReturnType Type="Collection(graph.message)" Nullable="false" />
387+
</Function>
384388
<Function Name="delta" IsBound="true">
385389
<Parameter Name="bindingparameter" Type="Collection(graph.event)" Nullable="false" />
386390
<ReturnType Type="Collection(graph.event)" Nullable="false" />

transforms/csdl/preprocess_csdl_test_output.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,23 @@
10451045
</Annotation>
10461046
</EntitySet>
10471047
</EntityContainer>
1048+
<Function Name="delta" IsBound="true">
1049+
<Parameter Name="bindingparameter" Type="Collection(graph.message)" Nullable="false" />
1050+
<ReturnType Type="Collection(graph.message)" Nullable="false" />
1051+
<Annotation Term="Org.OData.Capabilities.V1.OperationRestrictions" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
1052+
<Record>
1053+
<PropertyValue Property="CustomQueryOptions">
1054+
<Collection>
1055+
<Record>
1056+
<PropertyValue Property="Name" String="changeType" />
1057+
<PropertyValue Property="Description" String="A custom query option to filter the delta response based on the type of change. Supported values are created, updated or deleted." />
1058+
<PropertyValue Property="Required" Bool="true" />
1059+
</Record>
1060+
</Collection>
1061+
</PropertyValue>
1062+
</Record>
1063+
</Annotation>
1064+
</Function>
10481065
<Function Name="delta" IsBound="true">
10491066
<Parameter Name="bindingparameter" Type="Collection(graph.event)" Nullable="false" />
10501067
<ReturnType Type="Collection(graph.event)" Nullable="false" />

0 commit comments

Comments
 (0)