Skip to content

Commit

Permalink
Merge pull request #500 from microsoftgraph/is/delta-change-type-param
Browse files Browse the repository at this point in the history
Adds `changeType` custom query option to delta function for `messages`
  • Loading branch information
baywet authored Nov 15, 2023
2 parents 0b30de7 + 45c8fee commit 182fd69
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions transforms/csdl/preprocess_csdl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,26 @@
</Annotation>
</xsl:copy>
</xsl:template>

<!--Delta function for messages needs the changeType parameter-->
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Function[@Name='delta'][edm:Parameter[@Name='bindingparameter']][edm:Parameter[@Type='Collection(graph.message)']]">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<Annotation Term="Org.OData.Capabilities.V1.OperationRestrictions">
<Record>
<PropertyValue Property="CustomQueryOptions">
<Collection>
<Record>
<PropertyValue Property="Name" String="changeType" />
<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." />
<PropertyValue Property="Required" Bool="true" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</xsl:copy>
</xsl:template>

<!-- Add custom query options to calendarView navigation property -->
<xsl:template name="CalendarViewRestrictedPopertyTemplate">
Expand Down
4 changes: 4 additions & 0 deletions transforms/csdl/preprocess_csdl_test_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@
<EntitySet Name="directoryObjects" EntityType="microsoft.graph.directoryObject" />
<EntitySet Name="places" EntityType="microsoft.graph.place" />
</EntityContainer>
<Function Name="delta" IsBound="true">
<Parameter Name="bindingparameter" Type="Collection(graph.message)" Nullable="false" />
<ReturnType Type="Collection(graph.message)" Nullable="false" />
</Function>
<Function Name="delta" IsBound="true">
<Parameter Name="bindingparameter" Type="Collection(graph.event)" Nullable="false" />
<ReturnType Type="Collection(graph.event)" Nullable="false" />
Expand Down
17 changes: 17 additions & 0 deletions transforms/csdl/preprocess_csdl_test_output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,23 @@
</Annotation>
</EntitySet>
</EntityContainer>
<Function Name="delta" IsBound="true">
<Parameter Name="bindingparameter" Type="Collection(graph.message)" Nullable="false" />
<ReturnType Type="Collection(graph.message)" Nullable="false" />
<Annotation Term="Org.OData.Capabilities.V1.OperationRestrictions" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
<Record>
<PropertyValue Property="CustomQueryOptions">
<Collection>
<Record>
<PropertyValue Property="Name" String="changeType" />
<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." />
<PropertyValue Property="Required" Bool="true" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Function>
<Function Name="delta" IsBound="true">
<Parameter Name="bindingparameter" Type="Collection(graph.event)" Nullable="false" />
<ReturnType Type="Collection(graph.event)" Nullable="false" />
Expand Down

0 comments on commit 182fd69

Please sign in to comment.