Skip to content

Commit bba5ee8

Browse files
Merge pull request #850 from microsoftgraph/ramsess/addExplicitBindingToOffboardActions
add explicit bindings to offboard and cancelOffboard actions
2 parents b4f50f4 + b31dab3 commit bba5ee8

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

transforms/csdl/preprocess_csdl.xsl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@
500500
</Annotation>
501501
</xsl:copy>
502502
</xsl:template>
503-
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='backupRestoreRoot']/edm:NavigationProperty[@Name='protectionUnits']">
503+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='backupRestoreRoot']/edm:NavigationProperty[@Name='protectionUnits']">
504504
<xsl:copy>
505505
<xsl:copy-of select="@* | node()" />
506506
<Annotation Term="Org.OData.Validation.V1.DerivedTypeConstraint">
@@ -510,6 +510,12 @@
510510
<String>microsoft.graph.driveProtectionUnit</String>
511511
</Collection>
512512
</Annotation>
513+
<Annotation Term="Org.OData.Core.V1.ExplicitOperationBindings">
514+
<Collection>
515+
<String>microsoft.graph.cancelOffboard</String>
516+
<String>microsoft.graph.offboard</String>
517+
</Collection>
518+
</Annotation>
513519
</xsl:copy>
514520
</xsl:template>
515521
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:EntityType[@Name='externalUsersSelfServiceSignUpEventsFlow']/edm:Property[@Name='onAttributeCollection']">
@@ -700,6 +706,15 @@
700706
<Annotation Term="Org.OData.Core.V1.RequiresExplicitBinding"/>
701707
</xsl:copy>
702708
</xsl:template>
709+
710+
<!-- Actions bound to protectionUnitBase should have the 'RequiresExplicitBinding' annotation-->
711+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Action[@Name='offboard'][edm:Parameter[@Name='bindingParameter']][edm:Parameter[@Type='graph.protectionUnitBase']] |
712+
edm:Schema[@Namespace='microsoft.graph']/edm:Action[@Name='cancelOffboard'][edm:Parameter[@Name='bindingParameter']][edm:Parameter[@Type='graph.protectionUnitBase']]">
713+
<xsl:copy>
714+
<xsl:apply-templates select="@* | node()" />
715+
<Annotation Term="Org.OData.Core.V1.RequiresExplicitBinding"/>
716+
</xsl:copy>
717+
</xsl:template>
703718

704719
<!--Delta function for events need the start and end date parameters-->
705720
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Function[@Name='delta'][edm:Parameter[@Name='bindingparameter']][edm:Parameter[@Type='Collection(graph.event)']]">

transforms/csdl/preprocess_csdl_test_input.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,14 @@
543543
</Parameter>
544544
<ReturnType Type="graph.directoryObject" />
545545
</Action>
546+
<Action Name="cancelOffboard" IsBound="true">
547+
<Parameter Name="bindingParameter" Type="graph.protectionUnitBase" />
548+
<ReturnType Type="graph.protectionUnitBase" />
549+
</Action>
550+
<Action Name="offboard" IsBound="true">
551+
<Parameter Name="bindingParameter" Type="graph.protectionUnitBase" />
552+
<ReturnType Type="graph.protectionUnitBase" />
553+
</Action>
546554
<Action Name="add" IsBound="true">
547555
<Parameter Name="bindingParameter" Type="Collection(graph.site)" />
548556
<Parameter Name="value" Type="Collection(graph.site)" />

transforms/csdl/preprocess_csdl_test_output.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,12 @@
10651065
<String>microsoft.graph.driveProtectionUnit</String>
10661066
</Collection>
10671067
</Annotation>
1068+
<Annotation Term="Org.OData.Core.V1.ExplicitOperationBindings" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm">
1069+
<Collection>
1070+
<String>microsoft.graph.cancelOffboard</String>
1071+
<String>microsoft.graph.offboard</String>
1072+
</Collection>
1073+
</Annotation>
10681074
</NavigationProperty>
10691075
</EntityType>
10701076
<EntityType Name="b2xIdentityUserFlow" BaseType="graph.identityUserFlow">
@@ -1362,6 +1368,16 @@
13621368
<ReturnType Type="graph.directoryObject" />
13631369
<Annotation Term="Org.OData.Core.V1.RequiresExplicitBinding" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm" />
13641370
</Action>
1371+
<Action Name="cancelOffboard" IsBound="true">
1372+
<Parameter Name="bindingParameter" Type="graph.protectionUnitBase" />
1373+
<ReturnType Type="graph.protectionUnitBase" />
1374+
<Annotation Term="Org.OData.Core.V1.RequiresExplicitBinding" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm" />
1375+
</Action>
1376+
<Action Name="offboard" IsBound="true">
1377+
<Parameter Name="bindingParameter" Type="graph.protectionUnitBase" />
1378+
<ReturnType Type="graph.protectionUnitBase" />
1379+
<Annotation Term="Org.OData.Core.V1.RequiresExplicitBinding" xmlns:edm="http://docs.oasis-open.org/odata/ns/edm" />
1380+
</Action>
13651381
<Action Name="add" IsBound="true">
13661382
<Parameter Name="bindingParameter" Type="Collection(graph.site)" />
13671383
<Parameter Name="value" Type="Collection(graph.site)" />

0 commit comments

Comments
 (0)