Skip to content

Commit

Permalink
Merge pull request #318 from Shopify/add_2024_01_support
Browse files Browse the repository at this point in the history
Add 2024-01 API support
  • Loading branch information
paulomarg authored Jan 10, 2024
2 parents 3c7a4ff + 1eabf13 commit bfbc3a1
Show file tree
Hide file tree
Showing 411 changed files with 34,195 additions and 2,820 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

- [#318](https://github.com/Shopify/shopify-api-php/pull/318) [Minor] Adding support for 2024-01 API version

## v5.2.0 - 2023-10-24

- [#306](https://github.com/Shopify/shopify-api-php/pull/306) [Minor] Adding support for 2023-10 API version
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "^8.0",
"ext-ctype": "*",
"ext-hash": "*",
"ext-json": "*",
Expand Down
861 changes: 408 additions & 453 deletions composer.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/ApiVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class ApiVersion
/** @var string */
public const OCTOBER_2023 = "2023-10";
/** @var string */
public const LATEST = self::OCTOBER_2023;
public const JANUARY_2024 = "2024-01";
/** @var string */
public const LATEST = self::JANUARY_2024;

private static $ALL_VERSIONS = [
self::UNSTABLE,
Expand All @@ -34,6 +36,7 @@ class ApiVersion
self::APRIL_2023,
self::JULY_2023,
self::OCTOBER_2023,
self::JANUARY_2024,
];

public static function isValid(string $version): bool
Expand Down
160 changes: 160 additions & 0 deletions src/Rest/Admin2022_04/CustomerSavedSearch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?php

/***********************************************************************************************************************
* This file is auto-generated. If you have an issue, please create a GitHub issue. *
***********************************************************************************************************************/

declare(strict_types=1);

namespace Shopify\Rest\Admin2022_04;

use Shopify\Auth\Session;
use Shopify\Rest\Base;

/**
* @property string|null $created_at
* @property int|null $id
* @property string|null $name
* @property string|null $query
* @property string|null $updated_at
*/
class CustomerSavedSearch 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" => "delete", "operation" => "delete", "ids" => ["id"], "path" => "customer_saved_searches/<id>.json"],
["http_method" => "get", "operation" => "count", "ids" => [], "path" => "customer_saved_searches/count.json"],
["http_method" => "get", "operation" => "customers", "ids" => ["id"], "path" => "customer_saved_searches/<id>/customers.json"],
["http_method" => "get", "operation" => "get", "ids" => [], "path" => "customer_saved_searches.json"],
["http_method" => "get", "operation" => "get", "ids" => ["id"], "path" => "customer_saved_searches/<id>.json"],
["http_method" => "post", "operation" => "post", "ids" => [], "path" => "customer_saved_searches.json"],
["http_method" => "put", "operation" => "put", "ids" => ["id"], "path" => "customer_saved_searches/<id>.json"]
];

/**
* @param Session $session
* @param int|string $id
* @param array $urlIds
* @param mixed[] $params Allowed indexes:
* fields
*
* @return CustomerSavedSearch|null
*/
public static function find(
Session $session,
$id,
array $urlIds = [],
array $params = []
): ?CustomerSavedSearch {
$result = parent::baseFind(
$session,
array_merge(["id" => $id], $urlIds),
$params,
);
return !empty($result) ? $result[0] : null;
}

/**
* @param Session $session
* @param int|string $id
* @param array $urlIds
* @param mixed[] $params
*
* @return array|null
*/
public static function delete(
Session $session,
$id,
array $urlIds = [],
array $params = []
): ?array {
$response = parent::request(
"delete",
"delete",
$session,
array_merge(["id" => $id], $urlIds),
$params,
);

return $response->getDecodedBody();
}

/**
* @param Session $session
* @param array $urlIds
* @param mixed[] $params Allowed indexes:
* limit,
* since_id,
* fields
*
* @return CustomerSavedSearch[]
*/
public static function all(
Session $session,
array $urlIds = [],
array $params = []
): array {
return parent::baseFind(
$session,
[],
$params,
);
}

/**
* @param Session $session
* @param array $urlIds
* @param mixed[] $params Allowed indexes:
* since_id
*
* @return array|null
*/
public static function count(
Session $session,
array $urlIds = [],
array $params = []
): ?array {
$response = parent::request(
"get",
"count",
$session,
[],
$params,
[],
);

return $response->getDecodedBody();
}

/**
* @param Session $session
* @param int|string $id
* @param array $urlIds
* @param mixed[] $params Allowed indexes:
* order,
* limit,
* fields
*
* @return array|null
*/
public static function customers(
Session $session,
$id,
array $urlIds = [],
array $params = []
): ?array {
$response = parent::request(
"get",
"customers",
$session,
array_merge(["id" => $id], $urlIds),
$params,
[],
);

return $response->getDecodedBody();
}

}
5 changes: 3 additions & 2 deletions src/Rest/Admin2023_01/FulfillmentOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @property int|null $shop_id
* @property string|null $status
* @property string[]|null $supported_actions
* @property array|null $updated_at
* @property string|null $updated_at
*/
class FulfillmentOrder extends Base
{
Expand Down Expand Up @@ -233,7 +233,8 @@ public function release_hold(
}

/**
* @param mixed[] $params
* @param mixed[] $params Allowed indexes:
* new_fulfill_at
* @param array|string $body
*
* @return array|null
Expand Down
3 changes: 2 additions & 1 deletion src/Rest/Admin2023_01/PaymentTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Shopify\Rest\Base;

/**
* @property array[]|null $adjustment_order_transactions
* @property string|null $amount
* @property Currency|null $currency
* @property string|null $fee
Expand All @@ -22,7 +23,7 @@
* @property string|null $processed_at
* @property int|null $source_id
* @property int|null $source_order_id
* @property int|null $source_order_transaction_id
* @property string|null $source_order_transaction_id
* @property string|null $source_type
* @property bool|null $test
* @property string|null $type
Expand Down
5 changes: 3 additions & 2 deletions src/Rest/Admin2023_04/FulfillmentOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @property int|null $shop_id
* @property string|null $status
* @property string[]|null $supported_actions
* @property array|null $updated_at
* @property string|null $updated_at
*/
class FulfillmentOrder extends Base
{
Expand Down Expand Up @@ -233,7 +233,8 @@ public function release_hold(
}

/**
* @param mixed[] $params
* @param mixed[] $params Allowed indexes:
* new_fulfill_at
* @param array|string $body
*
* @return array|null
Expand Down
2 changes: 0 additions & 2 deletions src/Rest/Admin2023_04/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@
* @property string|null $order_status_url
* @property array|null $original_total_additional_fees_set
* @property array|null $original_total_duties_set
* @property array|null $payment_details
* @property string[]|null $payment_gateway_names
* @property array|null $payment_terms
* @property string|null $phone
* @property string|null $presentment_currency
* @property string|null $processed_at
* @property string|null $processing_method
* @property string|null $referring_site
* @property Refund[]|null $refunds
* @property array|null $shipping_address
Expand Down
3 changes: 2 additions & 1 deletion src/Rest/Admin2023_04/PaymentTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Shopify\Rest\Base;

/**
* @property array[]|null $adjustment_order_transactions
* @property string|null $amount
* @property Currency|null $currency
* @property string|null $fee
Expand All @@ -22,7 +23,7 @@
* @property string|null $processed_at
* @property int|null $source_id
* @property int|null $source_order_id
* @property int|null $source_order_transaction_id
* @property string|null $source_order_transaction_id
* @property string|null $source_type
* @property bool|null $test
* @property string|null $type
Expand Down
5 changes: 3 additions & 2 deletions src/Rest/Admin2023_07/FulfillmentOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @property int|null $shop_id
* @property string|null $status
* @property string[]|null $supported_actions
* @property array|null $updated_at
* @property string|null $updated_at
*/
class FulfillmentOrder extends Base
{
Expand Down Expand Up @@ -233,7 +233,8 @@ public function release_hold(
}

/**
* @param mixed[] $params
* @param mixed[] $params Allowed indexes:
* new_fulfill_at
* @param array|string $body
*
* @return array|null
Expand Down
2 changes: 0 additions & 2 deletions src/Rest/Admin2023_07/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@
* @property string|null $order_status_url
* @property array|null $original_total_additional_fees_set
* @property array|null $original_total_duties_set
* @property array|null $payment_details
* @property string[]|null $payment_gateway_names
* @property array|null $payment_terms
* @property string|null $phone
* @property string|null $po_number
* @property string|null $presentment_currency
* @property string|null $processed_at
* @property string|null $processing_method
* @property string|null $referring_site
* @property Refund[]|null $refunds
* @property array|null $shipping_address
Expand Down
3 changes: 2 additions & 1 deletion src/Rest/Admin2023_07/PaymentTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Shopify\Rest\Base;

/**
* @property array[]|null $adjustment_order_transactions
* @property string|null $amount
* @property Currency|null $currency
* @property string|null $fee
Expand All @@ -22,7 +23,7 @@
* @property string|null $processed_at
* @property int|null $source_id
* @property int|null $source_order_id
* @property int|null $source_order_transaction_id
* @property string|null $source_order_transaction_id
* @property string|null $source_type
* @property bool|null $test
* @property string|null $type
Expand Down
5 changes: 3 additions & 2 deletions src/Rest/Admin2023_10/FulfillmentOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @property int|null $shop_id
* @property string|null $status
* @property string[]|null $supported_actions
* @property array|null $updated_at
* @property string|null $updated_at
*/
class FulfillmentOrder extends Base
{
Expand Down Expand Up @@ -233,7 +233,8 @@ public function release_hold(
}

/**
* @param mixed[] $params
* @param mixed[] $params Allowed indexes:
* new_fulfill_at
* @param array|string $body
*
* @return array|null
Expand Down
2 changes: 0 additions & 2 deletions src/Rest/Admin2023_10/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@
* @property string|null $order_status_url
* @property array|null $original_total_additional_fees_set
* @property array|null $original_total_duties_set
* @property array|null $payment_details
* @property string[]|null $payment_gateway_names
* @property array|null $payment_terms
* @property string|null $phone
* @property string|null $po_number
* @property string|null $presentment_currency
* @property string|null $processed_at
* @property string|null $processing_method
* @property string|null $referring_site
* @property Refund[]|null $refunds
* @property array|null $shipping_address
Expand Down
3 changes: 2 additions & 1 deletion src/Rest/Admin2023_10/PaymentTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Shopify\Rest\Base;

/**
* @property array[]|null $adjustment_order_transactions
* @property string|null $amount
* @property Currency|null $currency
* @property string|null $fee
Expand All @@ -22,7 +23,7 @@
* @property string|null $processed_at
* @property int|null $source_id
* @property int|null $source_order_id
* @property int|null $source_order_transaction_id
* @property string|null $source_order_transaction_id
* @property string|null $source_type
* @property bool|null $test
* @property string|null $type
Expand Down
Loading

0 comments on commit bfbc3a1

Please sign in to comment.