Skip to content

Commit

Permalink
Merge pull request #93 from developifynet/master
Browse files Browse the repository at this point in the history
Add Collect
  • Loading branch information
bakura10 authored Jul 20, 2019
2 parents 55f4fb9 + 7475897 commit 2cc20b7
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,14 @@ Here is a list of supported endpoints (more to come in the future):
* array updateCustomCollection(array $args = [])
* array deleteCustomCollection(array $args = [])

**COLLECT RELATED METHODS:**

* array getCollects(array $args = [])
* int getCollectCount(array $args = [])
* array getCollect(array $args = [])
* array createCollect(array $args = [])
* array deleteCollect(array $args = [])

**CUSTOMER RELATED METHODS:**

* array getCustomers(array $args = [])
Expand Down
122 changes: 122 additions & 0 deletions src/ServiceDescription/Shopify-v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,128 @@
]
],

/**
* --------------------------------------------------------------------------------
* COLLECTS RELATED METHODS
*
* DOC: https://help.shopify.com/en/api/reference/products/collect
* --------------------------------------------------------------------------------
*/

'GetCollects' => [
'httpMethod' => 'GET',
'uri' => 'admin/api/{version}/collects.json',
'responseModel' => 'GenericModel',
'summary' => 'Retrieve a list of collects',
'data' => ['root_key' => 'collects'],
'parameters' => [
'version' => [
'description' => 'API version',
'location' => 'uri',
'type' => 'string',
'required' => true
],
],
'additionalParameters' => [
'location' => 'query',
],
],

'GetCollectCount' => [
'httpMethod' => 'GET',
'uri' => 'admin/api/{version}/collects/count.json',
'responseModel' => 'GenericModel',
'summary' => 'Retrieve the number of collects',
'parameters' => [
'version' => [
'description' => 'API version',
'location' => 'uri',
'type' => 'string',
'required' => true
],
],
'additionalParameters' => [
'location' => 'query',
],
],

'GetCollect' => [
'httpMethod' => 'GET',
'uri' => 'admin/api/{version}/collects/{id}.json',
'responseModel' => 'GenericModel',
'summary' => 'Retrieve specific collect',
'data' => ['root_key' => 'collect'],
'parameters' => [
'version' => [
'description' => 'API version',
'location' => 'uri',
'type' => 'string',
'required' => true
],
'id' => [
'description' => 'Collect ID',
'location' => 'uri',
'type' => 'integer',
'required' => true
],
],
'additionalParameters' => [
'location' => 'query',
],
],

'CreateCollect' => [
'httpMethod' => 'POST',
'uri' => 'admin/api/{version}/collects.json',
'responseModel' => 'GenericModel',
'summary' => 'Adds a product to a custom collection',
'data' => ['root_key' => 'collect'],
'parameters' => [
'version' => [
'description' => 'API version',
'location' => 'uri',
'type' => 'string',
'required' => true
],
'product_id' => [
'description' => 'Product ID',
'location' => 'json',
'type' => 'integer',
'required' => true
],
'collection_id' => [
'description' => 'Custom collection ID',
'location' => 'json',
'type' => 'integer',
'required' => true
],
],
'additionalParameters' => [
'location' => 'json',
],
],

'DeleteCollect' => [
'httpMethod' => 'DELETE',
'uri' => 'admin/api/{version}/collects/{id}.json',
'responseModel' => 'GenericModel',
'summary' => 'Delete a collect',
'parameters' => [
'version' => [
'description' => 'API version',
'location' => 'uri',
'type' => 'string',
'required' => true
],
'id' => [
'description' => 'Collect ID',
'location' => 'uri',
'type' => 'integer',
'required' => true
]
]
],

/**
* --------------------------------------------------------------------------------
* CUSTOMER RELATED METHODS
Expand Down
10 changes: 10 additions & 0 deletions src/ShopifyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@
* @method array updateCustomCollection(array $args = []) {@command Shopify UpdateCustomCollection}
* @method array deleteCustomCollection(array $args = []) {@command Shopify DeleteCustomCollection}
*
* COLLECTS RELATED METHODS:
*
* @method array getCollects(array $args = []) {@command Shopify GetCollects}
* @method int getCollectCount(array $args = []) {@command Shopify GetCollectCount}
* @method array getCollect(array $args = []) {@command Shopify GetCollect}
* @method array createCollect(array $args = []) {@command Shopify CreateCollect}
* @method array updateCollect(array $args = []) {@command Shopify UpdateCollect}
* @method array deleteCollect(array $args = []) {@command Shopify DeleteCollect}
*
* CUSTOMER RELATED METHODS:
*
* @method array getCustomers(array $args = []) {@command Shopify GetCustomers}
Expand Down Expand Up @@ -337,6 +346,7 @@
* @method \Traversable getArticlesIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetArticles}
* @method \Traversable getBlogArticlesIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetBlogArticles}
* @method \Traversable getCustomCollectionsIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetCustomCollections}
* @method \Traversable getCollectsIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetCollects}
* @method \Traversable getCustomersIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetCustomersIterator}
* @method \Traversable getDiscountCodesIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetDiscountCodes}
* @method \Traversable getEventsIterator(array $commandArgs = [], array $iteratorArgs = []) {@command Shopify GetEvents}
Expand Down

0 comments on commit 2cc20b7

Please sign in to comment.