brandon14/ebay-sdk-php

View on GitHub
src/Buy/MarketplaceInsightsBeta/V1/Model/ItemSales.php

Summary

Maintainability
D
2 days
Test Coverage
<?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);

/**
 * ItemSales.
 *
 * PHP version ^7.2 || ^8.0
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Marketplace Insights API.
 *
 * <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> The Marketplace Insights API provides the ability to search for sold items on eBay by keyword, GTIN, category, and product and returns the of sales history of those items.
 *
 * The version of the OpenAPI document: v1_beta.2.2
 * 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\MarketplaceInsightsBeta\V1\Model;

use TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\ObjectSerializer;

/**
 * ItemSales Class Doc Comment.
 *
 * @category Class
 *
 * @description This type defines the fields for the sold items sales history information.
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 *
 * @implements \ArrayAccess<TKey, TValue>
 *
 * @template TKey int|null
 * @template TValue mixed|null
 */
class ItemSales implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
     * The original name of the model.
     *
     * @var string
     */
    protected static $openAPIModelName = 'ItemSales';

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'additional_images' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image[]',
        'adult_only' => 'bool',
        'bid_count' => 'int',
        'buying_options' => 'string[]',
        'categories' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Category[]',
        'condition' => 'string',
        'condition_id' => 'string',
        'epid' => 'string',
        'image' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image',
        'item_affiliate_web_url' => 'string',
        'item_group_href' => 'string',
        'item_group_type' => 'string',
        'item_href' => 'string',
        'item_id' => 'string',
        'item_location' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\ItemLocation',
        'item_web_url' => 'string',
        'last_sold_date' => 'string',
        'last_sold_price' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\ConvertedAmount',
        'seller' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Seller',
        'thumbnail_images' => '\TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image[]',
        'title' => 'string',
        'total_sold_quantity' => 'int',
    ];

    /**
     * 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 = [
        'additional_images' => null,
        'adult_only' => null,
        'bid_count' => 'int32',
        'buying_options' => null,
        'categories' => null,
        'condition' => null,
        'condition_id' => null,
        'epid' => null,
        'image' => null,
        'item_affiliate_web_url' => null,
        'item_group_href' => null,
        'item_group_type' => null,
        'item_href' => null,
        'item_id' => null,
        'item_location' => null,
        'item_web_url' => null,
        'last_sold_date' => null,
        'last_sold_price' => null,
        'seller' => null,
        'thumbnail_images' => null,
        'title' => null,
        'total_sold_quantity' => 'int32',
    ];

    /**
     * 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 = [
        'additional_images' => 'additionalImages',
        'adult_only' => 'adultOnly',
        'bid_count' => 'bidCount',
        'buying_options' => 'buyingOptions',
        'categories' => 'categories',
        'condition' => 'condition',
        'condition_id' => 'conditionId',
        'epid' => 'epid',
        'image' => 'image',
        'item_affiliate_web_url' => 'itemAffiliateWebUrl',
        'item_group_href' => 'itemGroupHref',
        'item_group_type' => 'itemGroupType',
        'item_href' => 'itemHref',
        'item_id' => 'itemId',
        'item_location' => 'itemLocation',
        'item_web_url' => 'itemWebUrl',
        'last_sold_date' => 'lastSoldDate',
        'last_sold_price' => 'lastSoldPrice',
        'seller' => 'seller',
        'thumbnail_images' => 'thumbnailImages',
        'title' => 'title',
        'total_sold_quantity' => 'totalSoldQuantity',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'additional_images' => 'setAdditionalImages',
        'adult_only' => 'setAdultOnly',
        'bid_count' => 'setBidCount',
        'buying_options' => 'setBuyingOptions',
        'categories' => 'setCategories',
        'condition' => 'setCondition',
        'condition_id' => 'setConditionId',
        'epid' => 'setEpid',
        'image' => 'setImage',
        'item_affiliate_web_url' => 'setItemAffiliateWebUrl',
        'item_group_href' => 'setItemGroupHref',
        'item_group_type' => 'setItemGroupType',
        'item_href' => 'setItemHref',
        'item_id' => 'setItemId',
        'item_location' => 'setItemLocation',
        'item_web_url' => 'setItemWebUrl',
        'last_sold_date' => 'setLastSoldDate',
        'last_sold_price' => 'setLastSoldPrice',
        'seller' => 'setSeller',
        'thumbnail_images' => 'setThumbnailImages',
        'title' => 'setTitle',
        'total_sold_quantity' => 'setTotalSoldQuantity',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'additional_images' => 'getAdditionalImages',
        'adult_only' => 'getAdultOnly',
        'bid_count' => 'getBidCount',
        'buying_options' => 'getBuyingOptions',
        'categories' => 'getCategories',
        'condition' => 'getCondition',
        'condition_id' => 'getConditionId',
        'epid' => 'getEpid',
        'image' => 'getImage',
        'item_affiliate_web_url' => 'getItemAffiliateWebUrl',
        'item_group_href' => 'getItemGroupHref',
        'item_group_type' => 'getItemGroupType',
        'item_href' => 'getItemHref',
        'item_id' => 'getItemId',
        'item_location' => 'getItemLocation',
        'item_web_url' => 'getItemWebUrl',
        'last_sold_date' => 'getLastSoldDate',
        'last_sold_price' => 'getLastSoldPrice',
        'seller' => 'getSeller',
        'thumbnail_images' => 'getThumbnailImages',
        'title' => 'getTitle',
        'total_sold_quantity' => 'getTotalSoldQuantity',
    ];

    /**
     * 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['additional_images'] = $data['additional_images'] ?? null;
        $this->container['adult_only'] = $data['adult_only'] ?? null;
        $this->container['bid_count'] = $data['bid_count'] ?? null;
        $this->container['buying_options'] = $data['buying_options'] ?? null;
        $this->container['categories'] = $data['categories'] ?? null;
        $this->container['condition'] = $data['condition'] ?? null;
        $this->container['condition_id'] = $data['condition_id'] ?? null;
        $this->container['epid'] = $data['epid'] ?? null;
        $this->container['image'] = $data['image'] ?? null;
        $this->container['item_affiliate_web_url'] = $data['item_affiliate_web_url'] ?? null;
        $this->container['item_group_href'] = $data['item_group_href'] ?? null;
        $this->container['item_group_type'] = $data['item_group_type'] ?? null;
        $this->container['item_href'] = $data['item_href'] ?? null;
        $this->container['item_id'] = $data['item_id'] ?? null;
        $this->container['item_location'] = $data['item_location'] ?? null;
        $this->container['item_web_url'] = $data['item_web_url'] ?? null;
        $this->container['last_sold_date'] = $data['last_sold_date'] ?? null;
        $this->container['last_sold_price'] = $data['last_sold_price'] ?? null;
        $this->container['seller'] = $data['seller'] ?? null;
        $this->container['thumbnail_images'] = $data['thumbnail_images'] ?? null;
        $this->container['title'] = $data['title'] ?? null;
        $this->container['total_sold_quantity'] = $data['total_sold_quantity'] ?? 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 additional_images.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image[]|null
     */
    public function getAdditionalImages()
    {
        return $this->container['additional_images'];
    }

    /**
     * Sets additional_images.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image[]|null $additional_images An array of containers with the URLs for the images that are in addition to the primary image.  The primary image is returned in the <b> image.imageUrl</b> field.
     *
     * @return self
     */
    public function setAdditionalImages($additional_images)
    {
        $this->container['additional_images'] = $additional_images;

        return $this;
    }

    /**
     * Gets adult_only.
     *
     * @return bool|null
     */
    public function getAdultOnly()
    {
        return $this->container['adult_only'];
    }

    /**
     * Sets adult_only.
     *
     * @param bool|null $adult_only This indicates if the item is for  adults only. For more information about adult-only items on eBay, see <a href=\"https://pages.ebay.com/help/policies/adult-only.html\" target=\"_blank\">Adult items policy</a> for sellers and <a href=\"https://www.ebay.com/help/terms-conditions/default/searching-adult-items?id=4661\" target=\"_blank\">Adult-Only items on eBay</a> for buyers.
     *
     * @return self
     */
    public function setAdultOnly($adult_only)
    {
        $this->container['adult_only'] = $adult_only;

        return $this;
    }

    /**
     * Gets bid_count.
     *
     * @return int|null
     */
    public function getBidCount()
    {
        return $this->container['bid_count'];
    }

    /**
     * Sets bid_count.
     *
     * @param int|null $bid_count This integer value indicates the total number of bids that have been placed for an auction item. This field is only returned for auction items.
     *
     * @return self
     */
    public function setBidCount($bid_count)
    {
        $this->container['bid_count'] = $bid_count;

        return $this;
    }

    /**
     * Gets buying_options.
     *
     * @return string[]|null
     */
    public function getBuyingOptions()
    {
        return $this->container['buying_options'];
    }

    /**
     * Sets buying_options.
     *
     * @param string[]|null $buying_options A comma separated list of the purchase options available for the item, such as FIXED_PRICE, AUCTION.  <ul> <li><code>FIXED_PRICE</code> - Returned for fixed-price items (non-auction)</li>  <li><code>AUCTION</code> - Returned for auction items without Buy It Now feature</li>  <li><code>FIXED_PRICE</code> and <code>AUCTION</code> - Returned for auction items enabled with the Buy It Now feature</li> </ul> Code so that your app gracefully handles any future changes to this list.
     *
     * @return self
     */
    public function setBuyingOptions($buying_options)
    {
        $this->container['buying_options'] = $buying_options;

        return $this;
    }

    /**
     * Gets categories.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Category[]|null
     */
    public function getCategories()
    {
        return $this->container['categories'];
    }

    /**
     * Sets categories.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Category[]|null $categories this container returns the primary category ID of the item, as well as the secondary category if the item was listed in two categories
     *
     * @return self
     */
    public function setCategories($categories)
    {
        $this->container['categories'] = $categories;

        return $this;
    }

    /**
     * Gets condition.
     *
     * @return string|null
     */
    public function getCondition()
    {
        return $this->container['condition'];
    }

    /**
     * Sets condition.
     *
     * @param string|null $condition The text describing the condition of the item, such as New or Used. For a list of condition names, see <a href=\"https://developer.ebay.com/devzone/finding/callref/enums/conditionIdList.html\" target=\"_blank\">Item Condition IDs and Names</a>.  <br /><br />Code so that your app gracefully handles any future changes to this list.
     *
     * @return self
     */
    public function setCondition($condition)
    {
        $this->container['condition'] = $condition;

        return $this;
    }

    /**
     * Gets condition_id.
     *
     * @return string|null
     */
    public function getConditionId()
    {
        return $this->container['condition_id'];
    }

    /**
     * Sets condition_id.
     *
     * @param string|null $condition_id The identifier of the condition of the item. For example, 1000 is the identifier for NEW. For a list of condition names and IDs, see <a href=\"https://developer.ebay.com/devzone/finding/callref/enums/conditionIdList.html\" target=\"_blank\">Item Condition IDs and Names</a>. <br /><br />Code so that your app gracefully handles any future changes to this list.
     *
     * @return self
     */
    public function setConditionId($condition_id)
    {
        $this->container['condition_id'] = $condition_id;

        return $this;
    }

    /**
     * Gets epid.
     *
     * @return string|null
     */
    public function getEpid()
    {
        return $this->container['epid'];
    }

    /**
     * Sets epid.
     *
     * @param string|null $epid An ePID is the eBay product identifier of a product from the eBay product catalog.  This indicates the product in which the item belongs.
     *
     * @return self
     */
    public function setEpid($epid)
    {
        $this->container['epid'] = $epid;

        return $this;
    }

    /**
     * Gets image.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image|null
     */
    public function getImage()
    {
        return $this->container['image'];
    }

    /**
     * Sets image.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image|null $image image
     *
     * @return self
     */
    public function setImage($image)
    {
        $this->container['image'] = $image;

        return $this;
    }

    /**
     * Gets item_affiliate_web_url.
     *
     * @return string|null
     */
    public function getItemAffiliateWebUrl()
    {
        return $this->container['item_affiliate_web_url'];
    }

    /**
     * Sets item_affiliate_web_url.
     *
     * @param string|null $item_affiliate_web_url The URL to the View Item page of the item, which includes the affiliate tracking ID. This field is only returned if the eBay partner  enables affiliate tracking for the item by including the <code><a href=\"/api-docs/buy/static/api-browse.html#Headers\">X-EBAY-C-ENDUSERCTX</a></code> request header in the method.
     *
     * @return self
     */
    public function setItemAffiliateWebUrl($item_affiliate_web_url)
    {
        $this->container['item_affiliate_web_url'] = $item_affiliate_web_url;

        return $this;
    }

    /**
     * Gets item_group_href.
     *
     * @return string|null
     */
    public function getItemGroupHref()
    {
        return $this->container['item_group_href'];
    }

    /**
     * Sets item_group_href.
     *
     * @param string|null $item_group_href The HATEOAS reference of the parent page of the item group. An item group is an item that has various aspect differences, such as color, size, storage capacity, etc. <br /> <br /><span class=\"tablenote\"> <b>  Note: </b>This field is returned only for item groups.</span>
     *
     * @return self
     */
    public function setItemGroupHref($item_group_href)
    {
        $this->container['item_group_href'] = $item_group_href;

        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 Indicates the item group type. An item group is an item that has various aspect differences, such as color, size, storage capacity, etc. <br /><br />Currently, only the <code>SELLER_DEFINED_VARIATIONS</code> group type is supported and indicates that this is an item group created by the seller.<br /> <br /><span class=\"tablenote\"> <b> Note: </b>This field is returned only for item groups.</span><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 item_href.
     *
     * @return string|null
     */
    public function getItemHref()
    {
        return $this->container['item_href'];
    }

    /**
     * Sets item_href.
     *
     * @param string|null $item_href the URI of the item
     *
     * @return self
     */
    public function setItemHref($item_href)
    {
        $this->container['item_href'] = $item_href;

        return $this;
    }

    /**
     * Gets item_id.
     *
     * @return string|null
     */
    public function getItemId()
    {
        return $this->container['item_id'];
    }

    /**
     * Sets item_id.
     *
     * @param string|null $item_id the unique RESTful identifier of the item
     *
     * @return self
     */
    public function setItemId($item_id)
    {
        $this->container['item_id'] = $item_id;

        return $this;
    }

    /**
     * Gets item_location.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\ItemLocation|null
     */
    public function getItemLocation()
    {
        return $this->container['item_location'];
    }

    /**
     * Sets item_location.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\ItemLocation|null $item_location item_location
     *
     * @return self
     */
    public function setItemLocation($item_location)
    {
        $this->container['item_location'] = $item_location;

        return $this;
    }

    /**
     * Gets item_web_url.
     *
     * @return string|null
     */
    public function getItemWebUrl()
    {
        return $this->container['item_web_url'];
    }

    /**
     * Sets item_web_url.
     *
     * @param string|null $item_web_url the URL to the View Item page of the item
     *
     * @return self
     */
    public function setItemWebUrl($item_web_url)
    {
        $this->container['item_web_url'] = $item_web_url;

        return $this;
    }

    /**
     * Gets last_sold_date.
     *
     * @return string|null
     */
    public function getLastSoldDate()
    {
        return $this->container['last_sold_date'];
    }

    /**
     * Sets last_sold_date.
     *
     * @param string|null $last_sold_date The date the last item was purchased within the last 90 days. The <b>totalSoldQuantity</b> returns the total number of items that were sold. This field returns the date the last item in that group was sold.
     *
     * @return self
     */
    public function setLastSoldDate($last_sold_date)
    {
        $this->container['last_sold_date'] = $last_sold_date;

        return $this;
    }

    /**
     * Gets last_sold_price.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\ConvertedAmount|null
     */
    public function getLastSoldPrice()
    {
        return $this->container['last_sold_price'];
    }

    /**
     * Sets last_sold_price.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\ConvertedAmount|null $last_sold_price last_sold_price
     *
     * @return self
     */
    public function setLastSoldPrice($last_sold_price)
    {
        $this->container['last_sold_price'] = $last_sold_price;

        return $this;
    }

    /**
     * Gets seller.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Seller|null
     */
    public function getSeller()
    {
        return $this->container['seller'];
    }

    /**
     * Sets seller.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Seller|null $seller seller
     *
     * @return self
     */
    public function setSeller($seller)
    {
        $this->container['seller'] = $seller;

        return $this;
    }

    /**
     * Gets thumbnail_images.
     *
     * @return \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image[]|null
     */
    public function getThumbnailImages()
    {
        return $this->container['thumbnail_images'];
    }

    /**
     * Sets thumbnail_images.
     *
     * @param \TNT\Ebay\Buy\MarketplaceInsightsBeta\V1\Model\Image[]|null $thumbnail_images an array of thumbnail images for the item
     *
     * @return self
     */
    public function setThumbnailImages($thumbnail_images)
    {
        $this->container['thumbnail_images'] = $thumbnail_images;

        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.  <br><br><b>Maximum Length: </b> 80 characters
     *
     * @return self
     */
    public function setTitle($title)
    {
        $this->container['title'] = $title;

        return $this;
    }

    /**
     * Gets total_sold_quantity.
     *
     * @return int|null
     */
    public function getTotalSoldQuantity()
    {
        return $this->container['total_sold_quantity'];
    }

    /**
     * Sets total_sold_quantity.
     *
     * @param int|null $total_sold_quantity the total number of this item that have been sold
     *
     * @return self
     */
    public function setTotalSoldQuantity($total_sold_quantity)
    {
        $this->container['total_sold_quantity'] = $total_sold_quantity;

        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));
    }
}