<?php
 declare(strict_types=1); namespace Shopify\Rest\Admin2024_07; use Shopify\Auth\Session; use Shopify\Rest\Base; class GiftCard extends Base { public static string $API_VERSION = "2024-07"; protected static array $HAS_ONE = [ "balance" => Balance::class, "currency" => Currency::class ]; protected static array $HAS_MANY = []; protected static array $PATHS = [ ["http_method" => "get", "operation" => "count", "ids" => [], "path" => "gift_cards/count.json"], ["http_method" => "get", "operation" => "get", "ids" => [], "path" => "gift_cards.json"], ["http_method" => "get", "operation" => "get", "ids" => ["id"], "path" => "gift_cards/<id>.json"], ["http_method" => "get", "operation" => "search", "ids" => [], "path" => "gift_cards/search.json"], ["http_method" => "post", "operation" => "disable", "ids" => ["id"], "path" => "gift_cards/<id>/disable.json"], ["http_method" => "post", "operation" => "post", "ids" => [], "path" => "gift_cards.json"], ["http_method" => "put", "operation" => "put", "ids" => ["id"], "path" => "gift_cards/<id>.json"] ]; public static function find( Session $session, $id, array $urlIds = [], array $params = [] ): ?GiftCard { $result = parent::baseFind( $session, array_merge(["id" => $id], $urlIds), $params, ); return !empty($result) ? $result[0] : null; } 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 search( Session $session, array $urlIds = [], array $params = [] ): ?array { $response = parent::request( "get", "search", $session, [], $params, [], ); return $response->getDecodedBody(); } public function disable( array $params = [], $body = [] ): ?array { $response = parent::request( "post", "disable", $this->session, ["id" => $this->id], $params, $body, $this, ); return $response->getDecodedBody(); } } 