src/Buy/FeedBeta/V1/Model/ItemGroup.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);
/**
* ItemGroup.
*
* PHP version ^7.2 || ^8.0
*
* @category Class
*
* @author OpenAPI Generator team
*
* @see https://openapi-generator.tech
*/
/**
* Item Feed Service.
*
* <span class=\"tablenote\"><b>Note:</b> This is a <a href=\"https://developer.ebay.com/api-docs/static/versioning.html#limited \" target=\"_blank\"> <img src=\"/cms/img/docs/partners-api.svg\" class=\"legend-icon partners-icon\" title=\"Limited Release\" alt=\"Limited Release\" />(Limited Release)</a> API available only to select developers approved by business units.</span><br /><br />The Feed API provides the ability to download TSV_GZIP feed files containing eBay items and an hourly snapshot file of the items that have changed within an hour for a specific category, date and marketplace. <p>In addition to the API, there is an open source <a href=\"https://github.com/eBay/FeedSDK \" target=\"_blank\">Feed SDK</a> written in Java that downloads, combines files into a single file when needed, and unzips the entire feed file. It also lets you specify field filters to curate the items in the file.</p>
*
* The version of the OpenAPI document: v1_beta.33.0
* 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\Buy\FeedBeta\V1\Model;
use TNT\Ebay\Buy\FeedBeta\V1\ObjectSerializer;
/**
* ItemGroup Class Doc Comment.
*
* @category Class
*
* @description The type that defines the columns returned in the <b>Item Group</b> feed file.
*
* @author OpenAPI Generator team
*
* @see https://openapi-generator.tech
*
* @implements \ArrayAccess<TKey, TValue>
*
* @template TKey int|null
* @template TValue mixed|null
*/
class ItemGroup implements ModelInterface, \ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'ItemGroup';
/**
* Array of property to type mappings. Used for (de)serialization.
*
* @var string[]
*/
protected static $openAPITypes = [
'item_group_id' => 'string',
'item_group_type' => 'string',
'title' => 'string',
'varies_by_localized_aspects' => 'string',
'image_url' => 'string',
'additional_image_urls' => 'string',
'image_altering_prohibited' => 'bool',
];
/**
* 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 = [
'item_group_id' => null,
'item_group_type' => null,
'title' => null,
'varies_by_localized_aspects' => null,
'image_url' => null,
'additional_image_urls' => null,
'image_altering_prohibited' => 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 = [
'item_group_id' => 'itemGroupId',
'item_group_type' => 'itemGroupType',
'title' => 'title',
'varies_by_localized_aspects' => 'variesByLocalizedAspects',
'image_url' => 'imageUrl',
'additional_image_urls' => 'additionalImageUrls',
'image_altering_prohibited' => 'imageAlteringProhibited',
];
/**
* Array of attributes to setter functions (for deserialization of responses).
*
* @var string[]
*/
protected static $setters = [
'item_group_id' => 'setItemGroupId',
'item_group_type' => 'setItemGroupType',
'title' => 'setTitle',
'varies_by_localized_aspects' => 'setVariesByLocalizedAspects',
'image_url' => 'setImageUrl',
'additional_image_urls' => 'setAdditionalImageUrls',
'image_altering_prohibited' => 'setImageAlteringProhibited',
];
/**
* Array of attributes to getter functions (for serialization of requests).
*
* @var string[]
*/
protected static $getters = [
'item_group_id' => 'getItemGroupId',
'item_group_type' => 'getItemGroupType',
'title' => 'getTitle',
'varies_by_localized_aspects' => 'getVariesByLocalizedAspects',
'image_url' => 'getImageUrl',
'additional_image_urls' => 'getAdditionalImageUrls',
'image_altering_prohibited' => 'getImageAlteringProhibited',
];
/**
* 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['item_group_id'] = $data['item_group_id'] ?? null;
$this->container['item_group_type'] = $data['item_group_type'] ?? null;
$this->container['title'] = $data['title'] ?? null;
$this->container['varies_by_localized_aspects'] = $data['varies_by_localized_aspects'] ?? null;
$this->container['image_url'] = $data['image_url'] ?? null;
$this->container['additional_image_urls'] = $data['additional_image_urls'] ?? null;
$this->container['image_altering_prohibited'] = $data['image_altering_prohibited'] ?? 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 item_group_id.
*
* @return string|null
*/
public function getItemGroupId()
{
return $this->container['item_group_id'];
}
/**
* Sets item_group_id.
*
* @param string|null $item_group_id The unique identifier for the item group. This ID is returned in the <b> primaryItemGroupId</b> column of the <a href=\"/api-docs/buy/feed/resources/item/methods/getItemFeed\">Item Feed</a> file.
*
* @return self
*/
public function setItemGroupId($item_group_id)
{
$this->container['item_group_id'] = $item_group_id;
return $this;
}
/**
* Gets item_group_type.
*
* @return string|null
*/
public function getItemGroupType()
{
return $this->container['item_group_type'];
}
/**
* Sets item_group_type.
*
* @param string|null $item_group_type The item group type. For example:<code> SELLER_DEFINED_VARIATIONS</code>, indicates that the item group was created by the seller. <br /><br />Code so that your app gracefully handles any future changes to this list.
*
* @return self
*/
public function setItemGroupType($item_group_type)
{
$this->container['item_group_type'] = $item_group_type;
return $this;
}
/**
* Gets title.
*
* @return string|null
*/
public function getTitle()
{
return $this->container['title'];
}
/**
* Sets title.
*
* @param string|null $title The seller created title of the item group. This text is an escaped string when special characters are present, using the following rules:</p> <ul> <li>Double quotes (") and backslashes (\) in the Title are escaped with a backslash (\) character</li> <li>If there are any tabs (\t), double quotes ("), or backslashes (\) in the Title, the entire Title will be wrapped in double quotes.</li> </ul> <p><b>For example</b></p> <p>Before:</p> <p><code>Misty Rainforest Modern Masters 2017 MTG Magic Fetch Land Free Ship W<b>\</b>Tracking</code> </p> <p><code>Marvel Legends HULK 8<b>"</b> Figure Avengers Age of Ultron Studios 6<b>"</b> Series</code> </p> <p>After:</p> <p><code>"Misty Rainforest Modern Masters 2017 MTG Magic Fetch Land Free Ship W<b>\\</b> Tracking"</code> </p> <p><code>"Marvel Legends HULK 8<b>\"</b> Figure Avengers Age of Ultron Studios 6<b>\"</b> Series<b>"</b> </code> </p>
*
* @return self
*/
public function setTitle($title)
{
$this->container['title'] = $title;
return $this;
}
/**
* Gets varies_by_localized_aspects.
*
* @return string|null
*/
public function getVariesByLocalizedAspects()
{
return $this->container['varies_by_localized_aspects'];
}
/**
* Sets varies_by_localized_aspects.
*
* @param string|null $varies_by_localized_aspects A pipe separated (<code>|</code>) list of the aspect (variation) names for this item group. The aspect name is BASE64 encoded. <b>Note: </b> This column can contain multiple values. <p> <b> Encoded Format:</b> <br /> <code><em>aspectName</em>|<em>aspectName</em></code> </p> <p> <b> Encoded Example</b> (The delimiters are <b style=\"font-family: 'Arial Black';\">emphasized</b>): <br /> <code>Q29sb3I=<b style=\"font-family: 'Arial Black';\">|</b>U2l6ZQ==</code> </p> <p> <b> Decoded: </b> <br /> Color|Size </p>
*
* @return self
*/
public function setVariesByLocalizedAspects($varies_by_localized_aspects)
{
$this->container['varies_by_localized_aspects'] = $varies_by_localized_aspects;
return $this;
}
/**
* Gets image_url.
*
* @return string|null
*/
public function getImageUrl()
{
return $this->container['image_url'];
}
/**
* Sets image_url.
*
* @param string|null $image_url The URL to the primary image of the item. The other images of the item group are returned in the <b> additionalImageUrls</b> column.
*
* @return self
*/
public function setImageUrl($image_url)
{
$this->container['image_url'] = $image_url;
return $this;
}
/**
* Gets additional_image_urls.
*
* @return string|null
*/
public function getAdditionalImageUrls()
{
return $this->container['additional_image_urls'];
}
/**
* Sets additional_image_urls.
*
* @param string|null $additional_image_urls A pipe separated (<code>|</code>) list of URLs for the additional images for the item group. These images are in addition to the primary image, which is returned in the <b>imageUrl</b> column. <b>Note: </b> This column can contain multiple values.
*
* @return self
*/
public function setAdditionalImageUrls($additional_image_urls)
{
$this->container['additional_image_urls'] = $additional_image_urls;
return $this;
}
/**
* Gets image_altering_prohibited.
*
* @return bool|null
*/
public function getImageAlteringProhibited()
{
return $this->container['image_altering_prohibited'];
}
/**
* Sets image_altering_prohibited.
*
* @param bool|null $image_altering_prohibited A boolean that indicates whether the images can be altered. If the value is <code>true</code>, you cannot modify the image. <p><span class=\"tablenote\"><b>Note: </b> Due to image licensing agreements and other legal concerns, modification (including resizing) of some images is strictly prohibited. These images are for display as-is only. </span></p>
*
* @return self
*/
public function setImageAlteringProhibited($image_altering_prohibited)
{
$this->container['image_altering_prohibited'] = $image_altering_prohibited;
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));
}
}