Skip to content

Commit

Permalink
Merge pull request #282 from whobutsb/feature/api-deprecations-query
Browse files Browse the repository at this point in the history
Feature - Added API Deprecations Resource
  • Loading branch information
tareqtms authored Dec 14, 2022
2 parents b815f08 + 676aaaf commit 38b31fc
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
39 changes: 39 additions & 0 deletions lib/ApiDeprecations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Created by PhpStorm.
* @author Tareq Mahmood <tareqtms@yahoo.com>
* @author Steve Barbera <whobutsb@gmail.com>
* 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';
}
}
3 changes: 3 additions & 0 deletions lib/ShopifySDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -172,6 +174,7 @@ class ShopifySDK
protected $resources = array(
'AbandonedCheckout',
'AccessScope',
'ApiDeprecations',
'ApplicationCharge',
'Blog',
'CarrierService',
Expand Down

0 comments on commit 38b31fc

Please sign in to comment.