src/Sell/Inventory/V1/Model/GetInventoryItemResponse.php
<?php
/**
* This file is part of the trollandtoad/ebay-sdk-php package.
*
* MIT License
*
* Copyright (c) 2022 Brandon Clothier
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
declare(strict_types=1);
/**
* GetInventoryItemResponse.
*
* PHP version ^7.2 || ^8.0
*
* @category Class
*
* @author OpenAPI Generator team
*
* @see https://openapi-generator.tech
*/
/**
* Inventory API.
*
* The Inventory API is used to create and manage inventory, and then to publish and manage this inventory on an eBay marketplace. There are also methods in this API that will convert eligible, active eBay listings into the Inventory API model.
*
* The version of the OpenAPI document: 1.16.1
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 5.4.0
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace TNT\Ebay\Sell\Inventory\V1\Model;
use TNT\Ebay\Sell\Inventory\V1\ObjectSerializer;
/**
* GetInventoryItemResponse Class Doc Comment.
*
* @category Class
*
* @description This type is used by the response of the <strong>bulkGetInventoryItem</strong> method to give the status of each inventory item record that the user tried to retrieve.
*
* @author OpenAPI Generator team
*
* @see https://openapi-generator.tech
*
* @implements \ArrayAccess<TKey, TValue>
*
* @template TKey int|null
* @template TValue mixed|null
*/
class GetInventoryItemResponse implements ModelInterface, \ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'GetInventoryItemResponse';
/**
* Array of property to type mappings. Used for (de)serialization.
*
* @var string[]
*/
protected static $openAPITypes = [
'errors' => '\TNT\Ebay\Sell\Inventory\V1\Model\Error[]',
'inventory_item' => '\TNT\Ebay\Sell\Inventory\V1\Model\InventoryItemWithSkuLocaleGroupKeys',
'sku' => 'string',
'status_code' => 'int',
'warnings' => '\TNT\Ebay\Sell\Inventory\V1\Model\Error[]',
];
/**
* Array of property to format mappings. Used for (de)serialization.
*
* @var string[]
*
* @phpstan-var array<string, string|null>
*
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'errors' => null,
'inventory_item' => null,
'sku' => null,
'status_code' => 'int32',
'warnings' => 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 = [
'errors' => 'errors',
'inventory_item' => 'inventoryItem',
'sku' => 'sku',
'status_code' => 'statusCode',
'warnings' => 'warnings',
];
/**
* Array of attributes to setter functions (for deserialization of responses).
*
* @var string[]
*/
protected static $setters = [
'errors' => 'setErrors',
'inventory_item' => 'setInventoryItem',
'sku' => 'setSku',
'status_code' => 'setStatusCode',
'warnings' => 'setWarnings',
];
/**
* Array of attributes to getter functions (for serialization of requests).
*
* @var string[]
*/
protected static $getters = [
'errors' => 'getErrors',
'inventory_item' => 'getInventoryItem',
'sku' => 'getSku',
'status_code' => 'getStatusCode',
'warnings' => 'getWarnings',
];
/**
* 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['errors'] = $data['errors'] ?? null;
$this->container['inventory_item'] = $data['inventory_item'] ?? null;
$this->container['sku'] = $data['sku'] ?? null;
$this->container['status_code'] = $data['status_code'] ?? null;
$this->container['warnings'] = $data['warnings'] ?? 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 errors.
*
* @return \TNT\Ebay\Sell\Inventory\V1\Model\Error[]|null
*/
public function getErrors()
{
return $this->container['errors'];
}
/**
* Sets errors.
*
* @param \TNT\Ebay\Sell\Inventory\V1\Model\Error[]|null $errors this container will be returned if there were one or more errors associated with retrieving the inventory item record
*
* @return self
*/
public function setErrors($errors)
{
$this->container['errors'] = $errors;
return $this;
}
/**
* Gets inventory_item.
*
* @return \TNT\Ebay\Sell\Inventory\V1\Model\InventoryItemWithSkuLocaleGroupKeys|null
*/
public function getInventoryItem()
{
return $this->container['inventory_item'];
}
/**
* Sets inventory_item.
*
* @param \TNT\Ebay\Sell\Inventory\V1\Model\InventoryItemWithSkuLocaleGroupKeys|null $inventory_item inventory_item
*
* @return self
*/
public function setInventoryItem($inventory_item)
{
$this->container['inventory_item'] = $inventory_item;
return $this;
}
/**
* Gets sku.
*
* @return string|null
*/
public function getSku()
{
return $this->container['sku'];
}
/**
* Sets sku.
*
* @param string|null $sku The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell.
*
* @return self
*/
public function setSku($sku)
{
$this->container['sku'] = $sku;
return $this;
}
/**
* Gets status_code.
*
* @return int|null
*/
public function getStatusCode()
{
return $this->container['status_code'];
}
/**
* Sets status_code.
*
* @param int|null $status_code The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the <strong>sku</strong> field. See the <strong>HTTP status codes</strong> table to see which each status code indicates.
*
* @return self
*/
public function setStatusCode($status_code)
{
$this->container['status_code'] = $status_code;
return $this;
}
/**
* Gets warnings.
*
* @return \TNT\Ebay\Sell\Inventory\V1\Model\Error[]|null
*/
public function getWarnings()
{
return $this->container['warnings'];
}
/**
* Sets warnings.
*
* @param \TNT\Ebay\Sell\Inventory\V1\Model\Error[]|null $warnings this container will be returned if there were one or more warnings associated with retrieving the inventory item record
*
* @return self
*/
public function setWarnings($warnings)
{
$this->container['warnings'] = $warnings;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param int $offset Offset
*/
public function offsetExists($offset): bool
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param int $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
*/
public function offsetSet($offset, $value): void
{
if (null === $offset) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param int $offset Offset
*/
public function offsetUnset($offset): void
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
*
* @see 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));
}
}