Testing on my 8.5 system with phones, gateway and trunks defined: only phone and trunk devices are returned. Gateways are not supported with the API, it appears:
...
<item xsi:type="ns1:CmDevice">
<Name xsi:type="xsd:string">CUPS-SIP-Trunk</Name>
<DirNumber xsi:type="xsd:string" xsi:nil="true"/>
<Class xsi:type="ns1
eviceClass">SIP Trunk</Class>
<Model xsi:type="xsd:unsignedInt">131</Model>
<Product xsi:type="xsd:unsignedInt">0</Product>
...