From 35ea0b867e3800ee76fd9b4aad4823833b6b0a19 Mon Sep 17 00:00:00 2001 From: Siddharth Date: Fri, 13 Oct 2023 12:27:31 -0600 Subject: [PATCH] GC-1583: updated sdk --- lib/Api/BuckslipsApi.php | 24 +- lib/Api/LettersApi.php | 27 +- lib/Api/UploadsApi.php | 24 +- lib/Model/LetterEditableCustomEnvelope.php | 452 --------------------- lib/Model/SortBy4.php | 434 -------------------- lib/Model/SortBy5.php | 434 -------------------- lib/Model/TrackingEventNormal.php | 10 +- 7 files changed, 40 insertions(+), 1365 deletions(-) delete mode 100755 lib/Model/LetterEditableCustomEnvelope.php delete mode 100755 lib/Model/SortBy4.php delete mode 100755 lib/Model/SortBy5.php diff --git a/lib/Api/BuckslipsApi.php b/lib/Api/BuckslipsApi.php index 3c3e57d..9e10a1e 100755 --- a/lib/Api/BuckslipsApi.php +++ b/lib/Api/BuckslipsApi.php @@ -188,19 +188,17 @@ public function createWithHttpInfo($buckslip_editable, $front = null) $options = $this->createHttpClientOption(); $requestError = null; try { - if(file != null) { - $response = $this->client->request( - 'POST', - $request->getUri()->__toString(), - [ - 'multipart' => [[ - 'name' => 'file', - 'contents' => Utils::tryFopen($file, 'r') - ]], - 'auth' => $options['auth'] - ] - ); - } + $response = $this->client->request( + 'POST', + $request->getUri()->__toString(), + [ + 'multipart' => [[ + 'name' => 'file', + 'contents' => Utils::tryFopen($file, 'r') + ]], + 'auth' => $options['auth'] + ] + ); } catch (RequestException $e) { $errorBody = json_decode($e->getResponse()->getBody()->getContents())->error; $requestError = new LobError(); diff --git a/lib/Api/LettersApi.php b/lib/Api/LettersApi.php index 2df7743..b3dd3da 100755 --- a/lib/Api/LettersApi.php +++ b/lib/Api/LettersApi.php @@ -340,22 +340,17 @@ public function createWithHttpInfo($letter_editable, $idempotency_key = null, $f $options = $this->createHttpClientOption(); $requestError = null; try { - if($file != null) { - $response = $this->client->request( - 'POST', - $request->getUri()->__toString(), - [ - 'multipart' => [[ - 'name' => 'file', - 'contents' => Utils::tryFopen($file, 'r') - ]], - 'auth' => $options['auth'] - ] - ); - } - else { - $response = $this->client->send($request, $options); - } + $response = $this->client->request( + 'POST', + $request->getUri()->__toString(), + [ + 'multipart' => [[ + 'name' => 'file', + 'contents' => Utils::tryFopen($file, 'r') + ]], + 'auth' => $options['auth'] + ] + ); } catch (RequestException $e) { $errorBody = json_decode($e->getResponse()->getBody()->getContents())->error; $requestError = new LobError(); diff --git a/lib/Api/UploadsApi.php b/lib/Api/UploadsApi.php index db25a25..48ade92 100755 --- a/lib/Api/UploadsApi.php +++ b/lib/Api/UploadsApi.php @@ -955,19 +955,17 @@ public function upload_fileWithHttpInfo($upl_id, $file) $options = $this->createHttpClientOption(); $requestError = null; try { - if(file != null) { - $response = $this->client->request( - 'POST', - $request->getUri()->__toString(), - [ - 'multipart' => [[ - 'name' => 'file', - 'contents' => Utils::tryFopen($file, 'r') - ]], - 'auth' => $options['auth'] - ] - ); - } + $response = $this->client->request( + 'POST', + $request->getUri()->__toString(), + [ + 'multipart' => [[ + 'name' => 'file', + 'contents' => Utils::tryFopen($file, 'r') + ]], + 'auth' => $options['auth'] + ] + ); } catch (RequestException $e) { $errorBody = json_decode($e->getResponse()->getBody()->getContents())->error; $requestError = new LobError(); diff --git a/lib/Model/LetterEditableCustomEnvelope.php b/lib/Model/LetterEditableCustomEnvelope.php deleted file mode 100755 index 61dc0d3..0000000 --- a/lib/Model/LetterEditableCustomEnvelope.php +++ /dev/null @@ -1,452 +0,0 @@ - Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? - * - * The version of the OpenAPI document: 1.3.0 - * Contact: lob-openapi@lob.com - * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.2.1 - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -namespace OpenAPI\Client\Model; - -use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; - -/** - * LetterEditableCustomEnvelope Class Doc Comment - * - * @category Class - * @description A nested custom envelope object containing more information about the custom envelope used or `null` if a custom envelope was not used. Accepts an envelope ID for any customized envelope with available inventory. If no inventory is available for the specified ID, the letter will not be sent, and an error will be returned. If the letter has more than 6 sheets, it will be sent in a blank flat envelope. Custom envelopes may be created and ordered from the dashboard. This feature is exclusive to certain customers. Upgrade to the appropriate [Print & Mail Edition](https://dashboard.lob.com/#/settings/editions) to gain access. - * @package OpenAPI\Client - * @author OpenAPI Generator team - * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - */ -class LetterEditableCustomEnvelope implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'letter_editable_custom_envelope'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'url' => 'string', - 'object' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'url' => null, - 'object' => 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 = [ - 'id' => 'id', - 'url' => 'url', - 'object' => 'object' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'url' => 'setUrl', - 'object' => 'setObject' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'url' => 'getUrl', - 'object' => 'getObject' - ]; - - /** - * 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; - } - - const OBJECT_ENVELOPE = 'envelope'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getObjectAllowableValues() - { - return [ - self::OBJECT_ENVELOPE, - ]; - } - - /** - * 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['id'] = $data['id'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['object'] = $data['object'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - } - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if ((mb_strlen($this->container['id']) > 40)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 40."; - } - - } - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if ($this->container['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - } - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if ($this->container['object'] === null) { - $invalidProperties[] = "'object' can't be null"; - } - } - $allowedValues = $this->getObjectAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($this->container['object']) && !in_array($this->container['object'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'object', must be one of '%s'", - $this->container['object'], - implode("', '", $allowedValues) - ); - } - } - - 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 id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id The unique identifier of the custom envelope used. - * - * @return self - */ - public function setId($id) - { - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if ((mb_strlen($id) > 40)) { - throw new \InvalidArgumentException('invalid length for $id when calling LetterEditableCustomEnvelope., must be smaller than or equal to 40.'); - } - - } - $this->container['id'] = $id; - - return $this; - } - - - /** - * Gets url - * - * @return string - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string $url The url of the envelope asset used. - * - * @return self - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - - /** - * Gets object - * - * @return string - */ - public function getObject() - { - return $this->container['object']; - } - - /** - * Sets object - * - * @param string $object object - * - * @return self - */ - public function setObject($object) - { - $allowedValues = $this->getObjectAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!in_array($object, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'object', must be one of '%s'", - $object, - implode("', '", $allowedValues) - ) - ); - } - } - - $this->container['object'] = $object; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - 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 - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - */ - #[\ReturnTypeWillChange] - 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. - */ - #[\ReturnTypeWillChange] - 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/SortBy4.php b/lib/Model/SortBy4.php deleted file mode 100755 index ef8cc80..0000000 --- a/lib/Model/SortBy4.php +++ /dev/null @@ -1,434 +0,0 @@ - Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? - * - * The version of the OpenAPI document: 1.3.0 - * Contact: lob-openapi@lob.com - * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.2.1 - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -namespace OpenAPI\Client\Model; - -use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; - -/** - * SortBy4 Class Doc Comment - * - * @category Class - * @package OpenAPI\Client - * @author OpenAPI Generator team - * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - */ -class SortBy4 implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'sort_by_4'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'date_created' => 'string', - 'send_date' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'date_created' => null, - 'send_date' => 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 = [ - 'date_created' => 'date_created', - 'send_date' => 'send_date' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'date_created' => 'setDateCreated', - 'send_date' => 'setSendDate' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'date_created' => 'getDateCreated', - 'send_date' => 'getSendDate' - ]; - - /** - * 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; - } - - const DATE_CREATED_ASC = 'asc'; - const DATE_CREATED_DESC = 'desc'; - const SEND_DATE_ASC = 'asc'; - const SEND_DATE_DESC = 'desc'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getDateCreatedAllowableValues() - { - return [ - self::DATE_CREATED_ASC, - self::DATE_CREATED_DESC, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getSendDateAllowableValues() - { - return [ - self::SEND_DATE_ASC, - self::SEND_DATE_DESC, - ]; - } - - /** - * 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['date_created'] = $data['date_created'] ?? null; - $this->container['send_date'] = $data['send_date'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getDateCreatedAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($this->container['date_created']) && !in_array($this->container['date_created'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'date_created', must be one of '%s'", - $this->container['date_created'], - implode("', '", $allowedValues) - ); - } - } - - $allowedValues = $this->getSendDateAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($this->container['send_date']) && !in_array($this->container['send_date'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'send_date', must be one of '%s'", - $this->container['send_date'], - implode("', '", $allowedValues) - ); - } - } - - 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 date_created - * - * @return string|null - */ - public function getDateCreated() - { - return $this->container['date_created']; - } - - /** - * Sets date_created - * - * @param string|null $date_created date_created - * - * @return self - */ - public function setDateCreated($date_created) - { - $allowedValues = $this->getDateCreatedAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($date_created) && !in_array($date_created, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'date_created', must be one of '%s'", - $date_created, - implode("', '", $allowedValues) - ) - ); - } - } - - $this->container['date_created'] = $date_created; - - return $this; - } - - - /** - * Gets send_date - * - * @return string|null - */ - public function getSendDate() - { - return $this->container['send_date']; - } - - /** - * Sets send_date - * - * @param string|null $send_date send_date - * - * @return self - */ - public function setSendDate($send_date) - { - $allowedValues = $this->getSendDateAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($send_date) && !in_array($send_date, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'send_date', must be one of '%s'", - $send_date, - implode("', '", $allowedValues) - ) - ); - } - } - - $this->container['send_date'] = $send_date; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - 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 - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - */ - #[\ReturnTypeWillChange] - 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. - */ - #[\ReturnTypeWillChange] - 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/SortBy5.php b/lib/Model/SortBy5.php deleted file mode 100755 index 08b7680..0000000 --- a/lib/Model/SortBy5.php +++ /dev/null @@ -1,434 +0,0 @@ - Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? - * - * The version of the OpenAPI document: 1.3.0 - * Contact: lob-openapi@lob.com - * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.2.1 - */ - -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -namespace OpenAPI\Client\Model; - -use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; - -/** - * SortBy5 Class Doc Comment - * - * @category Class - * @package OpenAPI\Client - * @author OpenAPI Generator team - * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null - */ -class SortBy5 implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'sort_by_5'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'date_created' => 'string', - 'send_date' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'date_created' => null, - 'send_date' => 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 = [ - 'date_created' => 'date_created', - 'send_date' => 'send_date' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'date_created' => 'setDateCreated', - 'send_date' => 'setSendDate' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'date_created' => 'getDateCreated', - 'send_date' => 'getSendDate' - ]; - - /** - * 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; - } - - const DATE_CREATED_ASC = 'asc'; - const DATE_CREATED_DESC = 'desc'; - const SEND_DATE_ASC = 'asc'; - const SEND_DATE_DESC = 'desc'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getDateCreatedAllowableValues() - { - return [ - self::DATE_CREATED_ASC, - self::DATE_CREATED_DESC, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getSendDateAllowableValues() - { - return [ - self::SEND_DATE_ASC, - self::SEND_DATE_DESC, - ]; - } - - /** - * 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['date_created'] = $data['date_created'] ?? null; - $this->container['send_date'] = $data['send_date'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getDateCreatedAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($this->container['date_created']) && !in_array($this->container['date_created'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'date_created', must be one of '%s'", - $this->container['date_created'], - implode("', '", $allowedValues) - ); - } - } - - $allowedValues = $this->getSendDateAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($this->container['send_date']) && !in_array($this->container['send_date'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'send_date', must be one of '%s'", - $this->container['send_date'], - implode("', '", $allowedValues) - ); - } - } - - 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 date_created - * - * @return string|null - */ - public function getDateCreated() - { - return $this->container['date_created']; - } - - /** - * Sets date_created - * - * @param string|null $date_created date_created - * - * @return self - */ - public function setDateCreated($date_created) - { - $allowedValues = $this->getDateCreatedAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($date_created) && !in_array($date_created, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'date_created', must be one of '%s'", - $date_created, - implode("', '", $allowedValues) - ) - ); - } - } - - $this->container['date_created'] = $date_created; - - return $this; - } - - - /** - * Gets send_date - * - * @return string|null - */ - public function getSendDate() - { - return $this->container['send_date']; - } - - /** - * Sets send_date - * - * @param string|null $send_date send_date - * - * @return self - */ - public function setSendDate($send_date) - { - $allowedValues = $this->getSendDateAllowableValues(); - if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) { - if (!is_null($send_date) && !in_array($send_date, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'send_date', must be one of '%s'", - $send_date, - implode("', '", $allowedValues) - ) - ); - } - } - - $this->container['send_date'] = $send_date; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - 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 - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - */ - #[\ReturnTypeWillChange] - 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. - */ - #[\ReturnTypeWillChange] - 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/TrackingEventNormal.php b/lib/Model/TrackingEventNormal.php index 7ddda09..bde9bfc 100755 --- a/lib/Model/TrackingEventNormal.php +++ b/lib/Model/TrackingEventNormal.php @@ -204,12 +204,14 @@ public function getModelName() } const TYPE_NORMAL = 'normal'; + const NAME_MAILED = 'Mailed'; const NAME_IN_TRANSIT = 'In Transit'; const NAME_IN_LOCAL_AREA = 'In Local Area'; const NAME_PROCESSED_FOR_DELIVERY = 'Processed for Delivery'; + const NAME_DELIVERED = 'Delivered'; const NAME_RE_ROUTED = 'Re-Routed'; const NAME_RETURNED_TO_SENDER = 'Returned to Sender'; - const NAME_MAILED = 'Mailed'; + const NAME_INTERNATIONAL_EXIT = 'International Exit'; const DETAILS_NULL = 'null'; const OBJECT_TRACKING_EVENT = 'tracking_event'; @@ -233,12 +235,14 @@ public function getTypeAllowableValues() public function getNameAllowableValues() { return [ + self::NAME_MAILED, self::NAME_IN_TRANSIT, self::NAME_IN_LOCAL_AREA, self::NAME_PROCESSED_FOR_DELIVERY, + self::NAME_DELIVERED, self::NAME_RE_ROUTED, self::NAME_RETURNED_TO_SENDER, - self::NAME_MAILED, + self::NAME_INTERNATIONAL_EXIT, ]; } @@ -428,7 +432,7 @@ public function getName() /** * Sets name * - * @param string $name Name of tracking event (for normal postcards, self mailers, letters, and checks): * `In Transit` - The mailpiece is being processed at the entry/origin facility. * `In Local Area` - The mailpiece is being processed at the destination facility. * `Processed for Delivery` - The mailpiece has been greenlit for delivery at the recipient's nearest postal facility. The mailpiece should reach the mailbox within 1 business day of this tracking event. * `Re-Routed` - The mailpiece is re-routed due to recipient change of address, address errors, or USPS relabeling of barcode/ID tag area. * `Returned to Sender` - The mailpiece is being returned to sender due to barcode, ID tag area, or address errors. * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. [More about Mailed.](https://support.lob.com/hc/en-us/articles/360001724400-What-does-a-Mailed-tracking-event-mean-) Note this data is only available in Enterprise editions of Lob. [Contact Sales](https://lob.com/support/contact#contact) if you want access to this feature. [More about tracking](https://support.lob.com/hc/en-us/articles/115000097404-Can-I-track-my-mail-) + * @param string $name Name of tracking event (for normal postcards, self mailers, letters, and checks): * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. More about Mailed. Note this data is only available in Enterprise editions of Lob. Contact Sales if you want access to this feature. * `In Transit` - The mailpiece is being processed at the entry/origin facility. * `In Local Area` - The mailpiece is being processed at the destination facility. * `Processed for Delivery` - The mailpiece has been greenlit for delivery at the recipient's nearest postal facility. The mailpiece should reach the mailbox within 1 business day of this tracking event. * `Delivered` - The mail piece has been delivered to the recipients address. The final scan is generated when the mail carrier's GPS unit leaves the delivery area. * `Re-Routed` - The mailpiece is re-routed due to recipient change of address, address errors, or USPS relabeling of barcode/ID tag area. * `Returned to Sender` - The mailpiece is being returned to sender due to barcode, ID tag area, or address errors. * `International Exit` - The mail piece has been processed to ship to a destination abroad. This is typically the last scan a US-originated international mail piece will receive from the USPS. [More about tracking](https://support.lob.com/hc/en-us/articles/115000097404-Can-I-track-my-mail-) * * @return self */