How to call function to get product quantity in Magento 2.3

how to call this function? use Magento\InventorySourceDeductionApi\Model\GetSourceItemBySourceCodeAndSku; … public function __construct( GetSourceItemBySourceCodeAndSku $getSourceItemBySourceCodeAndSku ) { $this->getSourceItemBySourceCodeAndSku = $getSourceItemBySourceCodeAndSku; } … public function doSomething($product, $source) { $sourceItem = $this->getSourceItemBySourceCodeAndSku->execute($sourceCode, $itemSku); print $sourceItem->getSku() . ‘,’; print $sourceItem->getSourceCode() . ‘,’; // The actual source code, e.g: warehouse_rotterdam print $sourceItem->getStatus() . ‘,’; // wether it is salable print $sourceItem->getQuantity()…

Details