<?php
 declare(strict_types=1); namespace Shopify\Rest\Admin2022_04; use Shopify\Auth\Session; use Shopify\Rest\Base; class Fulfillment extends Base { public static string $API_VERSION = "2022-04"; protected static array $HAS_ONE = []; protected static array $HAS_MANY = []; protected static array $PATHS = [ ["http_method" => "get", "operation" => "count", "ids" => ["order_id"], "path" => "orders/<order_id>/fulfillments/count.json"], ["http_method" => "get", "operation" => "get", "ids" => ["fulfillment_order_id"], "path" => "fulfillment_orders/<fulfillment_order_id>/fulfillments.json"], ["http_method" => "get", "operation" => "get", "ids" => ["order_id"], "path" => "orders/<order_id>/fulfillments.json"], ["http_method" => "get", "operation" => "get", "ids" => ["order_id", "id"], "path" => "orders/<order_id>/fulfillments/<id>.json"], ["http_method" => "post", "operation" => "cancel", "ids" => ["id"], "path" => "fulfillments/<id>/cancel.json"], ["http_method" => "post", "operation" => "cancel", "ids" => ["order_id", "id"], "path" => "orders/<order_id>/fulfillments/<id>/cancel.json"], ["http_method" => "post", "operation" => "complete", "ids" => ["order_id", "id"], "path" => "orders/<order_id>/fulfillments/<id>/complete.json"], ["http_method" => "post", "operation" => "open", "ids" => ["order_id", "id"], "path" => "orders/<order_id>/fulfillments/<id>/open.json"], ["http_method" => "post", "operation" => "post", "ids" => [], "path" => "fulfillments.json"], ["http_method" => "post", "operation" => "post", "ids" => ["order_id"], "path" => "orders/<order_id>/fulfillments.json"], ["http_method" => "post", "operation" => "update_tracking", "ids" => ["id"], "path" => "fulfillments/<id>/update_tracking.json"], ["http_method" => "put", "operation" => "put", "ids" => ["order_id", "id"], "path" => "orders/<order_id>/fulfillments/<id>.json"] ]; public static function find( Session $session, $id, array $urlIds = [], array $params = [] ): ?Fulfillment { $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, $urlIds, $params, ); } public static function count( Session $session, array $urlIds = [], array $params = [] ): ?array { $response = parent::request( "get", "count", $session, $urlIds, $params, [], ); return $response->getDecodedBody(); } public function cancel( array $params = [], $body = [] ): ?array { $response = parent::request( "post", "cancel", $this->session, ["id" => $this->id, "order_id" => $this->order_id], $params, $body, $this, ); return $response->getDecodedBody(); } public function complete( array $params = [], $body = [] ): ?array { $response = parent::request( "post", "complete", $this->session, ["order_id" => $this->order_id, "id" => $this->id], $params, $body, $this, ); return $response->getDecodedBody(); } public function open( array $params = [], $body = [] ): ?array { $response = parent::request( "post", "open", $this->session, ["order_id" => $this->order_id, "id" => $this->id], $params, $body, $this, ); return $response->getDecodedBody(); } public function update_tracking( array $params = [], $body = [] ): ?array { $response = parent::request( "post", "update_tracking", $this->session, ["id" => $this->id], $params, $body, $this, ); return $response->getDecodedBody(); } } 