|
| 1 | +<?php |
| 2 | + |
| 3 | +/*********************************************************************************************************************** |
| 4 | +* This file is auto-generated. If you have an issue, please create a GitHub issue. * |
| 5 | +***********************************************************************************************************************/ |
| 6 | + |
| 7 | +declare(strict_types=1); |
| 8 | + |
| 9 | +namespace Shopify\Rest\Admin2022_04; |
| 10 | + |
| 11 | +use Shopify\Auth\Session; |
| 12 | +use Shopify\Rest\Base; |
| 13 | + |
| 14 | +/** |
| 15 | + * @property string|null $created_at |
| 16 | + * @property int|null $id |
| 17 | + * @property string|null $name |
| 18 | + * @property string|null $query |
| 19 | + * @property string|null $updated_at |
| 20 | + */ |
| 21 | +class CustomerSavedSearch extends Base |
| 22 | +{ |
| 23 | + public static string $API_VERSION = "2022-04"; |
| 24 | + protected static array $HAS_ONE = []; |
| 25 | + protected static array $HAS_MANY = []; |
| 26 | + protected static array $PATHS = [ |
| 27 | + ["http_method" => "delete", "operation" => "delete", "ids" => ["id"], "path" => "customer_saved_searches/<id>.json"], |
| 28 | + ["http_method" => "get", "operation" => "count", "ids" => [], "path" => "customer_saved_searches/count.json"], |
| 29 | + ["http_method" => "get", "operation" => "customers", "ids" => ["id"], "path" => "customer_saved_searches/<id>/customers.json"], |
| 30 | + ["http_method" => "get", "operation" => "get", "ids" => [], "path" => "customer_saved_searches.json"], |
| 31 | + ["http_method" => "get", "operation" => "get", "ids" => ["id"], "path" => "customer_saved_searches/<id>.json"], |
| 32 | + ["http_method" => "post", "operation" => "post", "ids" => [], "path" => "customer_saved_searches.json"], |
| 33 | + ["http_method" => "put", "operation" => "put", "ids" => ["id"], "path" => "customer_saved_searches/<id>.json"] |
| 34 | + ]; |
| 35 | + |
| 36 | + /** |
| 37 | + * @param Session $session |
| 38 | + * @param int|string $id |
| 39 | + * @param array $urlIds |
| 40 | + * @param mixed[] $params Allowed indexes: |
| 41 | + * fields |
| 42 | + * |
| 43 | + * @return CustomerSavedSearch|null |
| 44 | + */ |
| 45 | + public static function find( |
| 46 | + Session $session, |
| 47 | + $id, |
| 48 | + array $urlIds = [], |
| 49 | + array $params = [] |
| 50 | + ): ?CustomerSavedSearch { |
| 51 | + $result = parent::baseFind( |
| 52 | + $session, |
| 53 | + array_merge(["id" => $id], $urlIds), |
| 54 | + $params, |
| 55 | + ); |
| 56 | + return !empty($result) ? $result[0] : null; |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * @param Session $session |
| 61 | + * @param int|string $id |
| 62 | + * @param array $urlIds |
| 63 | + * @param mixed[] $params |
| 64 | + * |
| 65 | + * @return array|null |
| 66 | + */ |
| 67 | + public static function delete( |
| 68 | + Session $session, |
| 69 | + $id, |
| 70 | + array $urlIds = [], |
| 71 | + array $params = [] |
| 72 | + ): ?array { |
| 73 | + $response = parent::request( |
| 74 | + "delete", |
| 75 | + "delete", |
| 76 | + $session, |
| 77 | + array_merge(["id" => $id], $urlIds), |
| 78 | + $params, |
| 79 | + ); |
| 80 | + |
| 81 | + return $response->getDecodedBody(); |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * @param Session $session |
| 86 | + * @param array $urlIds |
| 87 | + * @param mixed[] $params Allowed indexes: |
| 88 | + * limit, |
| 89 | + * since_id, |
| 90 | + * fields |
| 91 | + * |
| 92 | + * @return CustomerSavedSearch[] |
| 93 | + */ |
| 94 | + public static function all( |
| 95 | + Session $session, |
| 96 | + array $urlIds = [], |
| 97 | + array $params = [] |
| 98 | + ): array { |
| 99 | + return parent::baseFind( |
| 100 | + $session, |
| 101 | + [], |
| 102 | + $params, |
| 103 | + ); |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * @param Session $session |
| 108 | + * @param array $urlIds |
| 109 | + * @param mixed[] $params Allowed indexes: |
| 110 | + * since_id |
| 111 | + * |
| 112 | + * @return array|null |
| 113 | + */ |
| 114 | + public static function count( |
| 115 | + Session $session, |
| 116 | + array $urlIds = [], |
| 117 | + array $params = [] |
| 118 | + ): ?array { |
| 119 | + $response = parent::request( |
| 120 | + "get", |
| 121 | + "count", |
| 122 | + $session, |
| 123 | + [], |
| 124 | + $params, |
| 125 | + [], |
| 126 | + ); |
| 127 | + |
| 128 | + return $response->getDecodedBody(); |
| 129 | + } |
| 130 | + |
| 131 | + /** |
| 132 | + * @param Session $session |
| 133 | + * @param int|string $id |
| 134 | + * @param array $urlIds |
| 135 | + * @param mixed[] $params Allowed indexes: |
| 136 | + * order, |
| 137 | + * limit, |
| 138 | + * fields |
| 139 | + * |
| 140 | + * @return array|null |
| 141 | + */ |
| 142 | + public static function customers( |
| 143 | + Session $session, |
| 144 | + $id, |
| 145 | + array $urlIds = [], |
| 146 | + array $params = [] |
| 147 | + ): ?array { |
| 148 | + $response = parent::request( |
| 149 | + "get", |
| 150 | + "customers", |
| 151 | + $session, |
| 152 | + array_merge(["id" => $id], $urlIds), |
| 153 | + $params, |
| 154 | + [], |
| 155 | + ); |
| 156 | + |
| 157 | + return $response->getDecodedBody(); |
| 158 | + } |
| 159 | + |
| 160 | +} |
0 commit comments