Skip to content

Commit 3c6fad0

Browse files
authored
Merge pull request #143 from microsoftgraph/andrueastman/unblockFunctionRoutes
Enable GetPstnCalls and GetDirectRoutingCalls in open Api generation
2 parents 258fe0a + a4a98d6 commit 3c6fad0

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

transforms/csdl/preprocess_csdl.xsl

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
<xsl:param name="remove-capability-annotations">True</xsl:param>
88
<xsl:param name="add-innererror-description">False</xsl:param>
99

10+
<!-- Flag to signal if we are generating a document for open api generation. -->
11+
<xsl:variable name="open-api-generation">
12+
<xsl:choose>
13+
<!-- Open API document generation is done with capability annotations and error descriptions -->
14+
<xsl:when test="$remove-capability-annotations='False' and $add-innererror-description='True'">True</xsl:when>
15+
<xsl:otherwise>False</xsl:otherwise>
16+
</xsl:choose>
17+
</xsl:variable>
1018
<!-- DO NOT FORMAT ON SAVE or else the match templates will become unreadable. -->
1119
<!-- All element references should include schema namespace as we need to support multiple namespaces. -->
1220

@@ -333,9 +341,18 @@
333341
</xsl:if>
334342
</xsl:template>
335343

344+
<!--Remove functions that are blocking beta generation only for CSDL based generation -->
345+
<xsl:template match="edm:Schema[@Namespace='microsoft.graph.callRecords']/edm:Function[@Name='getPstnCalls'] |
346+
edm:Schema[@Namespace='microsoft.graph.callRecords']/edm:Function[@Name='getDirectRoutingCalls']">
347+
<xsl:choose>
348+
<xsl:when test="$open-api-generation='True'">
349+
<xsl:copy>
350+
<xsl:copy-of select="@* | node()" />
351+
</xsl:copy>
352+
</xsl:when>
353+
</xsl:choose>
354+
</xsl:template>
336355
<!--Remove functions that are blocking beta generation-->
337-
<xsl:template match="edm:Schema[@Namespace='microsoft.graph.callRecords']/edm:Function[@Name='getPstnCalls']"/>
338-
<xsl:template match="edm:Schema[@Namespace='microsoft.graph.callRecords']/edm:Function[@Name='getDirectRoutingCalls']"/>
339356
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Function[@Name='delta'][edm:Parameter[@Name='token']][edm:Parameter[@Type='Collection(graph.site)']]"/>
340357
<xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Function[@Name='additionalAccess'][edm:Parameter[@Name='accessPackageId']][edm:Parameter[@Type='Collection(graph.accessPackageAssignment)']][1]"/>
341358

transforms/csdl/preprocess_csdl_test_input.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,18 @@
226226
<Member Name="peerToPeer" Value="2" />
227227
<Member Name="unknownFutureValue" Value="3" />
228228
</EnumType>
229+
<Function Name="getPstnCalls" IsBound="true">
230+
<Parameter Name="bindingParameter" Type="Collection(microsoft.graph.callRecords.callRecord)"/>
231+
<Parameter Name="fromDateTime" Type="Edm.DateTimeOffset"/>
232+
<Parameter Name="toDateTime" Type="Edm.DateTimeOffset"/>
233+
<ReturnType Type="Collection(microsoft.graph.callRecords.pstnCallLogRow)"/>
234+
</Function>
235+
<Function Name="getDirectRoutingCalls" IsBound="true">
236+
<Parameter Name="bindingParameter" Type="Collection(microsoft.graph.callRecords.callRecord)"/>
237+
<Parameter Name="fromDateTime" Type="Edm.DateTimeOffset"/>
238+
<Parameter Name="toDateTime" Type="Edm.DateTimeOffset"/>
239+
<ReturnType Type="Collection(microsoft.graph.callRecords.directRoutingLogRow)"/>
240+
</Function>
229241
</Schema>
230242
<Schema Namespace="microsoft.graph.managedTenants" xmlns="http://docs.oasis-open.org/odata/ns/edm">
231243
<EntityType Name="managementTemplateStepVersion" BaseType="graph.entity">

0 commit comments

Comments
 (0)