From 958c35c0f67aab96b379e5727b8f7acded5c7a3d Mon Sep 17 00:00:00 2001 From: Steve Barbera Date: Tue, 13 Dec 2022 12:36:23 -0700 Subject: [PATCH 1/2] Removed the CurlCallback feature from the the API Deprecations Query --- lib/ApiDeprecations.php | 39 +++++++++++++++++++++++++++++++++++++++ lib/ShopifySDK.php | 3 +++ 2 files changed, 42 insertions(+) create mode 100644 lib/ApiDeprecations.php diff --git a/lib/ApiDeprecations.php b/lib/ApiDeprecations.php new file mode 100644 index 0000000..8d1b698 --- /dev/null +++ b/lib/ApiDeprecations.php @@ -0,0 +1,39 @@ + + * @author Steve Barbera + * Created at 8/18/16 3:39 PM UTC+06:00 + * + * @see https://shopify.dev/api/admin-rest/2022-04/resources/deprecated-api-calls#get-deprecated-api-calls Shopify API Reference for API Deprecations + */ + +namespace PHPShopify; + + +class ApiDeprecations extends ShopifyResource +{ + /** + * @inheritDoc + */ + protected $resourceKey = 'deprecated_api_calls'; + + /** + * @inheritDoc + */ + public $readOnly = true; + + /** + * @inheritDoc + */ + public $countEnabled = false; + + /** + * @inheritDoc + */ + public function pluralizeKey() + { + //Only api deprecations, so no pluralize + return 'deprecated_api_calls'; + } +} diff --git a/lib/ShopifySDK.php b/lib/ShopifySDK.php index 7dffb55..429f1ea 100644 --- a/lib/ShopifySDK.php +++ b/lib/ShopifySDK.php @@ -69,6 +69,7 @@ /** * @property-read AbandonedCheckout $AbandonedCheckout * @property-read AccessScope $AccessScope + * @property-read ApiDeprecations $ApiDeprecations * @property-read ApplicationCharge $ApplicationCharge * @property-read Blog $Blog * @property-read CarrierService $CarrierService @@ -116,6 +117,7 @@ * * @method AbandonedCheckout AbandonedCheckout(integer $id = null) * @method AccessScope AccessScope() + * @method ApiDeprecations ApiDeprecations() * @method ApplicationCharge ApplicationCharge(integer $id = null) * @method Blog Blog(integer $id = null) * @method CarrierService CarrierService(integer $id = null) @@ -172,6 +174,7 @@ class ShopifySDK protected $resources = array( 'AbandonedCheckout', 'AccessScope', + 'ApiDeprecations', 'ApplicationCharge', 'Blog', 'CarrierService', From 676aaaf7b88a7125711f793a2a475df27d78ebf5 Mon Sep 17 00:00:00 2001 From: Steve Barbera Date: Tue, 13 Dec 2022 12:45:34 -0700 Subject: [PATCH 2/2] Added API Deprecations documentation to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6a69c9f..96a9486 100644 --- a/README.md +++ b/README.md @@ -321,6 +321,7 @@ Some resources are available directly, some resources are only available through > Use the resources only by listed resource map. Trying to get a resource directly which is only available through parent resource may end up with errors. - [AbandonedCheckout](https://help.shopify.com/api/reference/abandoned_checkouts) +- [ApiDeprecations](https://shopify.dev/api/admin-rest/2022-04/resources/deprecated-api-calls#get-deprecated-api-calls) - [ApplicationCharge](https://help.shopify.com/api/reference/applicationcharge) - [Blog](https://help.shopify.com/api/reference/blog/) - Blog -> [Article](https://help.shopify.com/api/reference/article/)