From e87b3de69928b8c8361fbff54e3e815e85003e39 Mon Sep 17 00:00:00 2001 From: "anna.adamchuk" Date: Wed, 10 May 2023 12:31:03 +0200 Subject: [PATCH] Latest Ingrid Delivery Checkout v2 changes --- README.md | 4 + docs/Model/BillingAddress.md | 1 + docs/Model/DeliveryAddress.md | 1 + docs/Model/DeliveryGroupShipping.md | 1 + docs/Model/LegLocation.md | 11 + docs/Model/LegLocationLocationType.md | 8 + docs/Model/ListSessionsSummariesResponse.md | 1 + docs/Model/Route.md | 9 + docs/Model/SessionSummary.md | 1 + docs/Model/ShippingLeg.md | 12 + lib/Model/BillingAddress.php | 30 ++ lib/Model/DeliveryAddress.php | 30 ++ lib/Model/DeliveryGroupShipping.php | 30 ++ lib/Model/LegLocation.php | 381 ++++++++++++++++ lib/Model/LegLocationLocationType.php | 68 +++ lib/Model/ListSessionsSummariesResponse.php | 30 ++ lib/Model/Route.php | 321 ++++++++++++++ lib/Model/SessionSummary.php | 30 ++ lib/Model/ShippingLeg.php | 411 ++++++++++++++++++ test/Model/BillingAddressTest.php | 9 + test/Model/DeliveryAddressTest.php | 9 + test/Model/DeliveryGroupShippingTest.php | 9 + test/Model/LegLocationLocationTypeTest.php | 81 ++++ test/Model/LegLocationTest.php | 108 +++++ .../ListSessionsSummariesResponseTest.php | 9 + test/Model/RouteTest.php | 90 ++++ test/Model/SessionSummaryTest.php | 9 + test/Model/ShippingLegTest.php | 117 +++++ 28 files changed, 1821 insertions(+) create mode 100644 docs/Model/LegLocation.md create mode 100644 docs/Model/LegLocationLocationType.md create mode 100644 docs/Model/Route.md create mode 100644 docs/Model/ShippingLeg.md create mode 100644 lib/Model/LegLocation.php create mode 100644 lib/Model/LegLocationLocationType.php create mode 100644 lib/Model/Route.php create mode 100644 lib/Model/ShippingLeg.php create mode 100644 test/Model/LegLocationLocationTypeTest.php create mode 100644 test/Model/LegLocationTest.php create mode 100644 test/Model/RouteTest.php create mode 100644 test/Model/ShippingLegTest.php diff --git a/README.md b/README.md index 2ce9d30..66c91c9 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,15 @@ Class | Method | HTTP request | Description - [Error](docs/Model/Error.md) - [GetSessionResponse](docs/Model/GetSessionResponse.md) - [GroupContent](docs/Model/GroupContent.md) +- [LegLocation](docs/Model/LegLocation.md) +- [LegLocationLocationType](docs/Model/LegLocationLocationType.md) - [ListSessionsSummariesResponse](docs/Model/ListSessionsSummariesResponse.md) - [OperationalHours](docs/Model/OperationalHours.md) - [PickupLocation](docs/Model/PickupLocation.md) - [PickupLocationType](docs/Model/PickupLocationType.md) - [PriceComponent](docs/Model/PriceComponent.md) - [PriceComponentType](docs/Model/PriceComponentType.md) +- [Route](docs/Model/Route.md) - [SearchAddress](docs/Model/SearchAddress.md) - [Section](docs/Model/Section.md) - [SectionColumnItem](docs/Model/SectionColumnItem.md) @@ -100,6 +103,7 @@ Class | Method | HTTP request | Description - [SessionSummary](docs/Model/SessionSummary.md) - [ShippingDate](docs/Model/ShippingDate.md) - [ShippingDateTag](docs/Model/ShippingDateTag.md) +- [ShippingLeg](docs/Model/ShippingLeg.md) - [Supports](docs/Model/Supports.md) - [Tag](docs/Model/Tag.md) - [UpdateSessionRequest](docs/Model/UpdateSessionRequest.md) diff --git a/docs/Model/BillingAddress.md b/docs/Model/BillingAddress.md index 930cb69..d38653b 100644 --- a/docs/Model/BillingAddress.md +++ b/docs/Model/BillingAddress.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **company_name** | **string** | | [optional] **country** | **string** | Country should be specified as two uppercase letters (ISO Alpha-2). Example `SE` for Sweden, `ES` for Spain. | [optional] **email** | **string** | Email address of the recipient. | [optional] +**external_id** | **string** | | [optional] **first_name** | **string** | | [optional] **last_name** | **string** | | [optional] **phone** | **string** | Phone number of the recipient. | [optional] diff --git a/docs/Model/DeliveryAddress.md b/docs/Model/DeliveryAddress.md index 58856bd..82f805d 100644 --- a/docs/Model/DeliveryAddress.md +++ b/docs/Model/DeliveryAddress.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **country** | **string** | Country should be specified as two uppercase letters (ISO Alpha-2). Example `SE` for Sweden, `ES` for Spain. | [optional] **door_code** | **string** | | [optional] **email** | **string** | Email address of the recipient. | [optional] +**external_id** | **string** | | [optional] **first_name** | **string** | | [optional] **last_name** | **string** | | [optional] **phone** | **string** | Phone number of the recipient. | [optional] diff --git a/docs/Model/DeliveryGroupShipping.md b/docs/Model/DeliveryGroupShipping.md index cc8a8e2..2256733 100644 --- a/docs/Model/DeliveryGroupShipping.md +++ b/docs/Model/DeliveryGroupShipping.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **delivery_type** | **string** | Type of delivery (pickup, instore, mailbox, delivery). | [optional] **meta** | **array** | Carrier specific metadata related to the shipping option, for example addons. | [optional] **product** | **string** | Name of the shipping product. | [optional] +**route** | [**\OpenAPI\Client\Model\Route**](Route.md) | | [optional] **supports** | [**\OpenAPI\Client\Model\Supports**](Supports.md) | | [optional] **warehouse** | [**\OpenAPI\Client\Model\DeliveryGroupWarehouse**](DeliveryGroupWarehouse.md) | | [optional] diff --git a/docs/Model/LegLocation.md b/docs/Model/LegLocation.md new file mode 100644 index 0000000..9264b95 --- /dev/null +++ b/docs/Model/LegLocation.md @@ -0,0 +1,11 @@ +# # LegLocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\OpenAPI\Client\Model\Address**](Address.md) | | [optional] +**external_id** | **string** | | [optional] +**location_type** | [**\OpenAPI\Client\Model\LegLocationLocationType**](LegLocationLocationType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegLocationLocationType.md b/docs/Model/LegLocationLocationType.md new file mode 100644 index 0000000..7a32f6c --- /dev/null +++ b/docs/Model/LegLocationLocationType.md @@ -0,0 +1,8 @@ +# # LegLocationLocationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSessionsSummariesResponse.md b/docs/Model/ListSessionsSummariesResponse.md index 2012cf6..5595e71 100644 --- a/docs/Model/ListSessionsSummariesResponse.md +++ b/docs/Model/ListSessionsSummariesResponse.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**external_id** | **string** | | [optional] **result** | [**\OpenAPI\Client\Model\SessionSummary**](SessionSummary.md) | | [optional] **tos_id** | **string** | | [optional] diff --git a/docs/Model/Route.md b/docs/Model/Route.md new file mode 100644 index 0000000..fa4723c --- /dev/null +++ b/docs/Model/Route.md @@ -0,0 +1,9 @@ +# # Route + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipping_legs** | [**\OpenAPI\Client\Model\ShippingLeg[]**](ShippingLeg.md) | ShippingLegs represent a list of delivery steps. For a non-chained delivery this will contain only one element. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SessionSummary.md b/docs/Model/SessionSummary.md index 06b8293..0c6cd58 100644 --- a/docs/Model/SessionSummary.md +++ b/docs/Model/SessionSummary.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**addresses** | [**\OpenAPI\Client\Model\Addresses**](Addresses.md) | | [optional] **category** | [**\OpenAPI\Client\Model\DeliveryGroupCategory**](DeliveryGroupCategory.md) | | [optional] **delivery_time** | [**\OpenAPI\Client\Model\DeliveryGroupDeliveryTime**](DeliveryGroupDeliveryTime.md) | | [optional] **pricing** | [**\OpenAPI\Client\Model\DeliveryGroupPricing**](DeliveryGroupPricing.md) | | [optional] diff --git a/docs/Model/ShippingLeg.md b/docs/Model/ShippingLeg.md new file mode 100644 index 0000000..b172f84 --- /dev/null +++ b/docs/Model/ShippingLeg.md @@ -0,0 +1,12 @@ +# # ShippingLeg + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**delivery_type** | **string** | | [optional] +**from** | [**\OpenAPI\Client\Model\LegLocation**](LegLocation.md) | | [optional] +**shipping_method** | **string** | | [optional] +**to** | [**\OpenAPI\Client\Model\LegLocation**](LegLocation.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Model/BillingAddress.php b/lib/Model/BillingAddress.php index 342975a..0cd05cb 100644 --- a/lib/Model/BillingAddress.php +++ b/lib/Model/BillingAddress.php @@ -67,6 +67,7 @@ class BillingAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'company_name' => 'string', 'country' => 'string', 'email' => 'string', + 'external_id' => 'string', 'first_name' => 'string', 'last_name' => 'string', 'phone' => 'string', @@ -94,6 +95,7 @@ class BillingAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'company_name' => null, 'country' => null, 'email' => null, + 'external_id' => null, 'first_name' => null, 'last_name' => null, 'phone' => null, @@ -140,6 +142,7 @@ public static function openAPIFormats() 'company_name' => 'company_name', 'country' => 'country', 'email' => 'email', + 'external_id' => 'external_id', 'first_name' => 'first_name', 'last_name' => 'last_name', 'phone' => 'phone', @@ -165,6 +168,7 @@ public static function openAPIFormats() 'company_name' => 'setCompanyName', 'country' => 'setCountry', 'email' => 'setEmail', + 'external_id' => 'setExternalId', 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'phone' => 'setPhone', @@ -190,6 +194,7 @@ public static function openAPIFormats() 'company_name' => 'getCompanyName', 'country' => 'getCountry', 'email' => 'getEmail', + 'external_id' => 'getExternalId', 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'phone' => 'getPhone', @@ -266,6 +271,7 @@ public function __construct(array $data = null) $this->container['company_name'] = $data['company_name'] ?? null; $this->container['country'] = $data['country'] ?? null; $this->container['email'] = $data['email'] ?? null; + $this->container['external_id'] = $data['external_id'] ?? null; $this->container['first_name'] = $data['first_name'] ?? null; $this->container['last_name'] = $data['last_name'] ?? null; $this->container['phone'] = $data['phone'] ?? null; @@ -493,6 +499,30 @@ public function setEmail($email) return $this; } + /** + * Gets external_id + * + * @return string|null + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string|null $external_id external_id + * + * @return self + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + /** * Gets first_name * diff --git a/lib/Model/DeliveryAddress.php b/lib/Model/DeliveryAddress.php index 2879d8d..03710df 100644 --- a/lib/Model/DeliveryAddress.php +++ b/lib/Model/DeliveryAddress.php @@ -69,6 +69,7 @@ class DeliveryAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => 'string', 'door_code' => 'string', 'email' => 'string', + 'external_id' => 'string', 'first_name' => 'string', 'last_name' => 'string', 'phone' => 'string', @@ -96,6 +97,7 @@ class DeliveryAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => null, 'door_code' => null, 'email' => null, + 'external_id' => null, 'first_name' => null, 'last_name' => null, 'phone' => null, @@ -142,6 +144,7 @@ public static function openAPIFormats() 'country' => 'country', 'door_code' => 'door_code', 'email' => 'email', + 'external_id' => 'external_id', 'first_name' => 'first_name', 'last_name' => 'last_name', 'phone' => 'phone', @@ -167,6 +170,7 @@ public static function openAPIFormats() 'country' => 'setCountry', 'door_code' => 'setDoorCode', 'email' => 'setEmail', + 'external_id' => 'setExternalId', 'first_name' => 'setFirstName', 'last_name' => 'setLastName', 'phone' => 'setPhone', @@ -192,6 +196,7 @@ public static function openAPIFormats() 'country' => 'getCountry', 'door_code' => 'getDoorCode', 'email' => 'getEmail', + 'external_id' => 'getExternalId', 'first_name' => 'getFirstName', 'last_name' => 'getLastName', 'phone' => 'getPhone', @@ -268,6 +273,7 @@ public function __construct(array $data = null) $this->container['country'] = $data['country'] ?? null; $this->container['door_code'] = $data['door_code'] ?? null; $this->container['email'] = $data['email'] ?? null; + $this->container['external_id'] = $data['external_id'] ?? null; $this->container['first_name'] = $data['first_name'] ?? null; $this->container['last_name'] = $data['last_name'] ?? null; $this->container['phone'] = $data['phone'] ?? null; @@ -541,6 +547,30 @@ public function setEmail($email) return $this; } + /** + * Gets external_id + * + * @return string|null + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string|null $external_id external_id + * + * @return self + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + /** * Gets first_name * diff --git a/lib/Model/DeliveryGroupShipping.php b/lib/Model/DeliveryGroupShipping.php index d616b69..b490fe8 100644 --- a/lib/Model/DeliveryGroupShipping.php +++ b/lib/Model/DeliveryGroupShipping.php @@ -67,6 +67,7 @@ class DeliveryGroupShipping implements ModelInterface, ArrayAccess, \JsonSeriali 'delivery_type' => 'string', 'meta' => 'array', 'product' => 'string', + 'route' => '\OpenAPI\Client\Model\Route', 'supports' => '\OpenAPI\Client\Model\Supports', 'warehouse' => '\OpenAPI\Client\Model\DeliveryGroupWarehouse' ]; @@ -86,6 +87,7 @@ class DeliveryGroupShipping implements ModelInterface, ArrayAccess, \JsonSeriali 'delivery_type' => null, 'meta' => null, 'product' => null, + 'route' => null, 'supports' => null, 'warehouse' => null ]; @@ -124,6 +126,7 @@ public static function openAPIFormats() 'delivery_type' => 'delivery_type', 'meta' => 'meta', 'product' => 'product', + 'route' => 'route', 'supports' => 'supports', 'warehouse' => 'warehouse' ]; @@ -141,6 +144,7 @@ public static function openAPIFormats() 'delivery_type' => 'setDeliveryType', 'meta' => 'setMeta', 'product' => 'setProduct', + 'route' => 'setRoute', 'supports' => 'setSupports', 'warehouse' => 'setWarehouse' ]; @@ -158,6 +162,7 @@ public static function openAPIFormats() 'delivery_type' => 'getDeliveryType', 'meta' => 'getMeta', 'product' => 'getProduct', + 'route' => 'getRoute', 'supports' => 'getSupports', 'warehouse' => 'getWarehouse' ]; @@ -226,6 +231,7 @@ public function __construct(array $data = null) $this->container['delivery_type'] = $data['delivery_type'] ?? null; $this->container['meta'] = $data['meta'] ?? null; $this->container['product'] = $data['product'] ?? null; + $this->container['route'] = $data['route'] ?? null; $this->container['supports'] = $data['supports'] ?? null; $this->container['warehouse'] = $data['warehouse'] ?? null; } @@ -422,6 +428,30 @@ public function setProduct($product) return $this; } + /** + * Gets route + * + * @return \OpenAPI\Client\Model\Route|null + */ + public function getRoute() + { + return $this->container['route']; + } + + /** + * Sets route + * + * @param \OpenAPI\Client\Model\Route|null $route route + * + * @return self + */ + public function setRoute($route) + { + $this->container['route'] = $route; + + return $this; + } + /** * Gets supports * diff --git a/lib/Model/LegLocation.php b/lib/Model/LegLocation.php new file mode 100644 index 0000000..20f8fab --- /dev/null +++ b/lib/Model/LegLocation.php @@ -0,0 +1,381 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LegLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LegLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'address' => '\OpenAPI\Client\Model\Address', + 'external_id' => 'string', + 'location_type' => '\OpenAPI\Client\Model\LegLocationLocationType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'address' => null, + 'external_id' => null, + 'location_type' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'external_id' => 'external_id', + 'location_type' => 'location_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'external_id' => 'setExternalId', + 'location_type' => 'setLocationType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'external_id' => 'getExternalId', + 'location_type' => 'getLocationType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = $data['address'] ?? null; + $this->container['external_id'] = $data['external_id'] ?? null; + $this->container['location_type'] = $data['location_type'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \OpenAPI\Client\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \OpenAPI\Client\Model\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets external_id + * + * @return string|null + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string|null $external_id external_id + * + * @return self + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + + /** + * Gets location_type + * + * @return \OpenAPI\Client\Model\LegLocationLocationType|null + */ + public function getLocationType() + { + return $this->container['location_type']; + } + + /** + * Sets location_type + * + * @param \OpenAPI\Client\Model\LegLocationLocationType|null $location_type location_type + * + * @return self + */ + public function setLocationType($location_type) + { + $this->container['location_type'] = $location_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LegLocationLocationType.php b/lib/Model/LegLocationLocationType.php new file mode 100644 index 0000000..8926141 --- /dev/null +++ b/lib/Model/LegLocationLocationType.php @@ -0,0 +1,68 @@ + 'string', 'result' => '\OpenAPI\Client\Model\SessionSummary', 'tos_id' => 'string' ]; @@ -72,6 +73,7 @@ class ListSessionsSummariesResponse implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ + 'external_id' => null, 'result' => null, 'tos_id' => null ]; @@ -103,6 +105,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'external_id' => 'external_id', 'result' => 'result', 'tos_id' => 'tos_id' ]; @@ -113,6 +116,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'external_id' => 'setExternalId', 'result' => 'setResult', 'tos_id' => 'setTosId' ]; @@ -123,6 +127,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'external_id' => 'getExternalId', 'result' => 'getResult', 'tos_id' => 'getTosId' ]; @@ -184,6 +189,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['external_id'] = $data['external_id'] ?? null; $this->container['result'] = $data['result'] ?? null; $this->container['tos_id'] = $data['tos_id'] ?? null; } @@ -212,6 +218,30 @@ public function valid() } + /** + * Gets external_id + * + * @return string|null + */ + public function getExternalId() + { + return $this->container['external_id']; + } + + /** + * Sets external_id + * + * @param string|null $external_id external_id + * + * @return self + */ + public function setExternalId($external_id) + { + $this->container['external_id'] = $external_id; + + return $this; + } + /** * Gets result * diff --git a/lib/Model/Route.php b/lib/Model/Route.php new file mode 100644 index 0000000..b8636bf --- /dev/null +++ b/lib/Model/Route.php @@ -0,0 +1,321 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Route implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Route'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'shipping_legs' => '\OpenAPI\Client\Model\ShippingLeg[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'shipping_legs' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'shipping_legs' => 'shipping_legs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'shipping_legs' => 'setShippingLegs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'shipping_legs' => 'getShippingLegs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['shipping_legs'] = $data['shipping_legs'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets shipping_legs + * + * @return \OpenAPI\Client\Model\ShippingLeg[]|null + */ + public function getShippingLegs() + { + return $this->container['shipping_legs']; + } + + /** + * Sets shipping_legs + * + * @param \OpenAPI\Client\Model\ShippingLeg[]|null $shipping_legs ShippingLegs represent a list of delivery steps. For a non-chained delivery this will contain only one element. + * + * @return self + */ + public function setShippingLegs($shipping_legs) + { + $this->container['shipping_legs'] = $shipping_legs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SessionSummary.php b/lib/Model/SessionSummary.php index 13e19fb..fa9efa7 100644 --- a/lib/Model/SessionSummary.php +++ b/lib/Model/SessionSummary.php @@ -59,6 +59,7 @@ class SessionSummary implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'addresses' => '\OpenAPI\Client\Model\Addresses', 'category' => '\OpenAPI\Client\Model\DeliveryGroupCategory', 'delivery_time' => '\OpenAPI\Client\Model\DeliveryGroupDeliveryTime', 'pricing' => '\OpenAPI\Client\Model\DeliveryGroupPricing', @@ -74,6 +75,7 @@ class SessionSummary implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'addresses' => null, 'category' => null, 'delivery_time' => null, 'pricing' => null, @@ -108,6 +110,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'addresses' => 'addresses', 'category' => 'category', 'delivery_time' => 'delivery_time', 'pricing' => 'pricing', @@ -121,6 +124,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'addresses' => 'setAddresses', 'category' => 'setCategory', 'delivery_time' => 'setDeliveryTime', 'pricing' => 'setPricing', @@ -134,6 +138,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'addresses' => 'getAddresses', 'category' => 'getCategory', 'delivery_time' => 'getDeliveryTime', 'pricing' => 'getPricing', @@ -198,6 +203,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['addresses'] = $data['addresses'] ?? null; $this->container['category'] = $data['category'] ?? null; $this->container['delivery_time'] = $data['delivery_time'] ?? null; $this->container['pricing'] = $data['pricing'] ?? null; @@ -229,6 +235,30 @@ public function valid() } + /** + * Gets addresses + * + * @return \OpenAPI\Client\Model\Addresses|null + */ + public function getAddresses() + { + return $this->container['addresses']; + } + + /** + * Sets addresses + * + * @param \OpenAPI\Client\Model\Addresses|null $addresses addresses + * + * @return self + */ + public function setAddresses($addresses) + { + $this->container['addresses'] = $addresses; + + return $this; + } + /** * Gets category * diff --git a/lib/Model/ShippingLeg.php b/lib/Model/ShippingLeg.php new file mode 100644 index 0000000..de08e05 --- /dev/null +++ b/lib/Model/ShippingLeg.php @@ -0,0 +1,411 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ShippingLeg implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ShippingLeg'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'delivery_type' => 'string', + 'from' => '\OpenAPI\Client\Model\LegLocation', + 'shipping_method' => 'string', + 'to' => '\OpenAPI\Client\Model\LegLocation' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'delivery_type' => null, + 'from' => null, + 'shipping_method' => null, + 'to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'delivery_type' => 'delivery_type', + 'from' => 'from', + 'shipping_method' => 'shipping_method', + 'to' => 'to' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'delivery_type' => 'setDeliveryType', + 'from' => 'setFrom', + 'shipping_method' => 'setShippingMethod', + 'to' => 'setTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'delivery_type' => 'getDeliveryType', + 'from' => 'getFrom', + 'shipping_method' => 'getShippingMethod', + 'to' => 'getTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['delivery_type'] = $data['delivery_type'] ?? null; + $this->container['from'] = $data['from'] ?? null; + $this->container['shipping_method'] = $data['shipping_method'] ?? null; + $this->container['to'] = $data['to'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets delivery_type + * + * @return string|null + */ + public function getDeliveryType() + { + return $this->container['delivery_type']; + } + + /** + * Sets delivery_type + * + * @param string|null $delivery_type delivery_type + * + * @return self + */ + public function setDeliveryType($delivery_type) + { + $this->container['delivery_type'] = $delivery_type; + + return $this; + } + + /** + * Gets from + * + * @return \OpenAPI\Client\Model\LegLocation|null + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param \OpenAPI\Client\Model\LegLocation|null $from from + * + * @return self + */ + public function setFrom($from) + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets shipping_method + * + * @return string|null + */ + public function getShippingMethod() + { + return $this->container['shipping_method']; + } + + /** + * Sets shipping_method + * + * @param string|null $shipping_method shipping_method + * + * @return self + */ + public function setShippingMethod($shipping_method) + { + $this->container['shipping_method'] = $shipping_method; + + return $this; + } + + /** + * Gets to + * + * @return \OpenAPI\Client\Model\LegLocation|null + */ + public function getTo() + { + return $this->container['to']; + } + + /** + * Sets to + * + * @param \OpenAPI\Client\Model\LegLocation|null $to to + * + * @return self + */ + public function setTo($to) + { + $this->container['to'] = $to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/test/Model/BillingAddressTest.php b/test/Model/BillingAddressTest.php index 4251707..0cbd974 100644 --- a/test/Model/BillingAddressTest.php +++ b/test/Model/BillingAddressTest.php @@ -151,6 +151,15 @@ public function testPropertyEmail() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "external_id" + */ + public function testPropertyExternalId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "first_name" */ diff --git a/test/Model/DeliveryAddressTest.php b/test/Model/DeliveryAddressTest.php index 4cb381a..2da04e0 100644 --- a/test/Model/DeliveryAddressTest.php +++ b/test/Model/DeliveryAddressTest.php @@ -169,6 +169,15 @@ public function testPropertyEmail() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "external_id" + */ + public function testPropertyExternalId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "first_name" */ diff --git a/test/Model/DeliveryGroupShippingTest.php b/test/Model/DeliveryGroupShippingTest.php index ecce7a6..788c9d7 100644 --- a/test/Model/DeliveryGroupShippingTest.php +++ b/test/Model/DeliveryGroupShippingTest.php @@ -142,6 +142,15 @@ public function testPropertyProduct() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "route" + */ + public function testPropertyRoute() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "supports" */ diff --git a/test/Model/LegLocationLocationTypeTest.php b/test/Model/LegLocationLocationTypeTest.php new file mode 100644 index 0000000..f613ede --- /dev/null +++ b/test/Model/LegLocationLocationTypeTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LegLocationTest.php b/test/Model/LegLocationTest.php new file mode 100644 index 0000000..c48269d --- /dev/null +++ b/test/Model/LegLocationTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "external_id" + */ + public function testPropertyExternalId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "location_type" + */ + public function testPropertyLocationType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListSessionsSummariesResponseTest.php b/test/Model/ListSessionsSummariesResponseTest.php index e577801..ebb665a 100644 --- a/test/Model/ListSessionsSummariesResponseTest.php +++ b/test/Model/ListSessionsSummariesResponseTest.php @@ -79,6 +79,15 @@ public function testListSessionsSummariesResponse() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "external_id" + */ + public function testPropertyExternalId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "result" */ diff --git a/test/Model/RouteTest.php b/test/Model/RouteTest.php new file mode 100644 index 0000000..eb91370 --- /dev/null +++ b/test/Model/RouteTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shipping_legs" + */ + public function testPropertyShippingLegs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SessionSummaryTest.php b/test/Model/SessionSummaryTest.php index 9424abb..f1f01b2 100644 --- a/test/Model/SessionSummaryTest.php +++ b/test/Model/SessionSummaryTest.php @@ -79,6 +79,15 @@ public function testSessionSummary() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "addresses" + */ + public function testPropertyAddresses() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "category" */ diff --git a/test/Model/ShippingLegTest.php b/test/Model/ShippingLegTest.php new file mode 100644 index 0000000..9dd5e7b --- /dev/null +++ b/test/Model/ShippingLegTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "delivery_type" + */ + public function testPropertyDeliveryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "shipping_method" + */ + public function testPropertyShippingMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to" + */ + public function testPropertyTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +}