<?php
 declare(strict_types=1); namespace Shopify\Rest\Admin2024_04; use Shopify\Auth\Session; use Shopify\Rest\Base; class ProductListing extends Base { public static string $API_VERSION = "2024-04"; protected static array $HAS_ONE = []; protected static array $HAS_MANY = [ "images" => Image::class, "variants" => Variant::class ]; protected static array $PATHS = [ ["http_method" => "delete", "operation" => "delete", "ids" => ["product_id"], "path" => "product_listings/<product_id>.json"], ["http_method" => "get", "operation" => "count", "ids" => [], "path" => "product_listings/count.json"], ["http_method" => "get", "operation" => "get", "ids" => [], "path" => "product_listings.json"], ["http_method" => "get", "operation" => "get", "ids" => ["product_id"], "path" => "product_listings/<product_id>.json"], ["http_method" => "get", "operation" => "product_ids", "ids" => [], "path" => "product_listings/product_ids.json"], ["http_method" => "put", "operation" => "put", "ids" => ["product_id"], "path" => "product_listings/<product_id>.json"] ]; protected static string $PRIMARY_KEY = "product_id"; public static function find( Session $session, $product_id, array $urlIds = [], array $params = [] ): ?ProductListing { $result = parent::baseFind( $session, array_merge(["product_id" => $product_id], $urlIds), $params, ); return !empty($result) ? $result[0] : null; } public static function delete( Session $session, $product_id, array $urlIds = [], array $params = [] ): ?array { $response = parent::request( "delete", "delete", $session, array_merge(["product_id" => $product_id], $urlIds), $params, ); return $response->getDecodedBody(); } public static function all( Session $session, array $urlIds = [], array $params = [] ): array { return parent::baseFind( $session, [], $params, ); } public static function count( Session $session, array $urlIds = [], array $params = [] ): ?array { $response = parent::request( "get", "count", $session, [], $params, [], ); return $response->getDecodedBody(); } public static function product_ids( Session $session, array $urlIds = [], array $params = [] ): ?array { $response = parent::request( "get", "product_ids", $session, [], $params, [], ); return $response->getDecodedBody(); } } 