<?php
/**
* GameResponse
*
* PHP version 7.4
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* GameBrain API
*
* GameBrain API
*
* The version of the OpenAPI document: 1.0.1
* Contact: mail@gamebrain.co
* Generated by: https://openapi-generator.tech
* Generator version: 7.8.0-SNAPSHOT
*/
/**
* 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;
/**
* GameResponse Class Doc Comment
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements \ArrayAccess<string, mixed>
*/
class GameResponse implements ModelInterface, ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'GameResponse';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPITypes = [
'id' => 'int',
'name' => 'string',
'image' => 'string',
'gameplay' => 'string',
'link' => 'string',
'x_url' => 'string',
'rating' => '\OpenAPI\Client\Model\GameResponseRating',
'description' => 'string',
'short_description' => 'string',
'release_date' => '\DateTime',
'developer' => 'string',
'playtime' => '\OpenAPI\Client\Model\GameResponsePlaytime',
'platforms' => '\OpenAPI\Client\Model\GameResponsePlatformsInner[]',
'tags' => 'string[]',
'genres' => '\OpenAPI\Client\Model\GameResponsePlatformsInner[]',
'genre' => 'string',
'themes' => '\OpenAPI\Client\Model\GameResponsePlatformsInner[]',
'adult_only' => 'bool',
'play_modes' => '\OpenAPI\Client\Model\GameResponsePlatformsInner[]',
'screenshots' => 'string[]',
'videos' => 'string[]',
'offers' => '\OpenAPI\Client\Model\GameResponseOffersInner[]',
'official_stores' => '\OpenAPI\Client\Model\GameResponseOfficialStoresInner[]',
'micro_trailer' => 'string'
];
/**
* 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 = [
'id' => null,
'name' => null,
'image' => 'uri',
'gameplay' => 'uri',
'link' => 'uri',
'x_url' => 'uri',
'rating' => null,
'description' => null,
'short_description' => null,
'release_date' => 'date',
'developer' => null,
'playtime' => null,
'platforms' => null,
'tags' => null,
'genres' => null,
'genre' => null,
'themes' => null,
'adult_only' => null,
'play_modes' => null,
'screenshots' => 'uri',
'videos' => 'uri',
'offers' => null,
'official_stores' => null,
'micro_trailer' => 'uri'
];
/**
* Array of nullable properties. Used for (de)serialization
*
* @var boolean[]
*/
protected static array $openAPINullables = [
'id' => false,
'name' => false,
'image' => false,
'gameplay' => false,
'link' => false,
'x_url' => false,
'rating' => false,
'description' => false,
'short_description' => false,
'release_date' => false,
'developer' => false,
'playtime' => false,
'platforms' => false,
'tags' => false,
'genres' => false,
'genre' => false,
'themes' => false,
'adult_only' => false,
'play_modes' => false,
'screenshots' => false,
'videos' => false,
'offers' => false,
'official_stores' => false,
'micro_trailer' => false
];
/**
* If a nullable field gets set to null, insert it here
*
* @var boolean[]
*/
protected array $openAPINullablesSetToNull = [];
/**
* 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 nullable properties
*
* @return array
*/
protected static function openAPINullables(): array
{
return self::$openAPINullables;
}
/**
* Array of nullable field names deliberately set to null
*
* @return boolean[]
*/
private function getOpenAPINullablesSetToNull(): array
{
return $this->openAPINullablesSetToNull;
}
/**
* Setter - Array of nullable field names deliberately set to null
*
* @param boolean[] $openAPINullablesSetToNull
*/
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
{
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
}
/**
* Checks if a property is nullable
*
* @param string $property
* @return bool
*/
public static function isNullable(string $property): bool
{
return self::openAPINullables()[$property] ?? false;
}
/**
* Checks if a nullable property is set to null.
*
* @param string $property
* @return bool
*/
public function isNullableSetToNull(string $property): bool
{
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'id' => 'id',
'name' => 'name',
'image' => 'image',
'gameplay' => 'gameplay',
'link' => 'link',
'x_url' => 'x_url',
'rating' => 'rating',
'description' => 'description',
'short_description' => 'short_description',
'release_date' => 'release_date',
'developer' => 'developer',
'playtime' => 'playtime',
'platforms' => 'platforms',
'tags' => 'tags',
'genres' => 'genres',
'genre' => 'genre',
'themes' => 'themes',
'adult_only' => 'adult_only',
'play_modes' => 'play_modes',
'screenshots' => 'screenshots',
'videos' => 'videos',
'offers' => 'offers',
'official_stores' => 'official_stores',
'micro_trailer' => 'micro_trailer'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'id' => 'setId',
'name' => 'setName',
'image' => 'setImage',
'gameplay' => 'setGameplay',
'link' => 'setLink',
'x_url' => 'setXUrl',
'rating' => 'setRating',
'description' => 'setDescription',
'short_description' => 'setShortDescription',
'release_date' => 'setReleaseDate',
'developer' => 'setDeveloper',
'playtime' => 'setPlaytime',
'platforms' => 'setPlatforms',
'tags' => 'setTags',
'genres' => 'setGenres',
'genre' => 'setGenre',
'themes' => 'setThemes',
'adult_only' => 'setAdultOnly',
'play_modes' => 'setPlayModes',
'screenshots' => 'setScreenshots',
'videos' => 'setVideos',
'offers' => 'setOffers',
'official_stores' => 'setOfficialStores',
'micro_trailer' => 'setMicroTrailer'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'id' => 'getId',
'name' => 'getName',
'image' => 'getImage',
'gameplay' => 'getGameplay',
'link' => 'getLink',
'x_url' => 'getXUrl',
'rating' => 'getRating',
'description' => 'getDescription',
'short_description' => 'getShortDescription',
'release_date' => 'getReleaseDate',
'developer' => 'getDeveloper',
'playtime' => 'getPlaytime',
'platforms' => 'getPlatforms',
'tags' => 'getTags',
'genres' => 'getGenres',
'genre' => 'getGenre',
'themes' => 'getThemes',
'adult_only' => 'getAdultOnly',
'play_modes' => 'getPlayModes',
'screenshots' => 'getScreenshots',
'videos' => 'getVideos',
'offers' => 'getOffers',
'official_stores' => 'getOfficialStores',
'micro_trailer' => 'getMicroTrailer'
];
/**
* 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->setIfExists('id', $data ?? [], null);
$this->setIfExists('name', $data ?? [], null);
$this->setIfExists('image', $data ?? [], null);
$this->setIfExists('gameplay', $data ?? [], null);
$this->setIfExists('link', $data ?? [], null);
$this->setIfExists('x_url', $data ?? [], null);
$this->setIfExists('rating', $data ?? [], null);
$this->setIfExists('description', $data ?? [], null);
$this->setIfExists('short_description', $data ?? [], null);
$this->setIfExists('release_date', $data ?? [], null);
$this->setIfExists('developer', $data ?? [], null);
$this->setIfExists('playtime', $data ?? [], null);
$this->setIfExists('platforms', $data ?? [], null);
$this->setIfExists('tags', $data ?? [], null);
$this->setIfExists('genres', $data ?? [], null);
$this->setIfExists('genre', $data ?? [], null);
$this->setIfExists('themes', $data ?? [], null);
$this->setIfExists('adult_only', $data ?? [], null);
$this->setIfExists('play_modes', $data ?? [], null);
$this->setIfExists('screenshots', $data ?? [], null);
$this->setIfExists('videos', $data ?? [], null);
$this->setIfExists('offers', $data ?? [], null);
$this->setIfExists('official_stores', $data ?? [], null);
$this->setIfExists('micro_trailer', $data ?? [], null);
}
/**
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
* $this->openAPINullablesSetToNull array
*
* @param string $variableName
* @param array $fields
* @param mixed $defaultValue
*/
private function setIfExists(string $variableName, array $fields, $defaultValue): void
{
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
$this->openAPINullablesSetToNull[] = $variableName;
}
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
if (!is_null($this->container['platforms']) && (count($this->container['platforms']) > 100)) {
$invalidProperties[] = "invalid value for 'platforms', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['tags']) && (count($this->container['tags']) > 100)) {
$invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['genres']) && (count($this->container['genres']) > 100)) {
$invalidProperties[] = "invalid value for 'genres', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['themes']) && (count($this->container['themes']) > 100)) {
$invalidProperties[] = "invalid value for 'themes', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['play_modes']) && (count($this->container['play_modes']) > 100)) {
$invalidProperties[] = "invalid value for 'play_modes', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['screenshots']) && (count($this->container['screenshots']) > 100)) {
$invalidProperties[] = "invalid value for 'screenshots', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['videos']) && (count($this->container['videos']) > 100)) {
$invalidProperties[] = "invalid value for 'videos', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['offers']) && (count($this->container['offers']) > 100)) {
$invalidProperties[] = "invalid value for 'offers', number of items must be less than or equal to 100.";
}
if (!is_null($this->container['official_stores']) && (count($this->container['official_stores']) > 100)) {
$invalidProperties[] = "invalid value for 'official_stores', number of items must be less than or equal to 100.";
}
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 int|null
*/
public function getId()
{
return $this->container['id'];
}
/**
* Sets id
*
* @param int|null $id id
*
* @return self
*/
public function setId($id)
{
if (is_null($id)) {
throw new \InvalidArgumentException('non-nullable id cannot be null');
}
$this->container['id'] = $id;
return $this;
}
/**
* Gets name
*
* @return string|null
*/
public function getName()
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string|null $name name
*
* @return self
*/
public function setName($name)
{
if (is_null($name)) {
throw new \InvalidArgumentException('non-nullable name cannot be null');
}
$this->container['name'] = $name;
return $this;
}
/**
* Gets image
*
* @return string|null
*/
public function getImage()
{
return $this->container['image'];
}
/**
* Sets image
*
* @param string|null $image image
*
* @return self
*/
public function setImage($image)
{
if (is_null($image)) {
throw new \InvalidArgumentException('non-nullable image cannot be null');
}
$this->container['image'] = $image;
return $this;
}
/**
* Gets gameplay
*
* @return string|null
*/
public function getGameplay()
{
return $this->container['gameplay'];
}
/**
* Sets gameplay
*
* @param string|null $gameplay gameplay
*
* @return self
*/
public function setGameplay($gameplay)
{
if (is_null($gameplay)) {
throw new \InvalidArgumentException('non-nullable gameplay cannot be null');
}
$this->container['gameplay'] = $gameplay;
return $this;
}
/**
* Gets link
*
* @return string|null
*/
public function getLink()
{
return $this->container['link'];
}
/**
* Sets link
*
* @param string|null $link link
*
* @return self
*/
public function setLink($link)
{
if (is_null($link)) {
throw new \InvalidArgumentException('non-nullable link cannot be null');
}
$this->container['link'] = $link;
return $this;
}
/**
* Gets x_url
*
* @return string|null
*/
public function getXUrl()
{
return $this->container['x_url'];
}
/**
* Sets x_url
*
* @param string|null $x_url x_url
*
* @return self
*/
public function setXUrl($x_url)
{
if (is_null($x_url)) {
throw new \InvalidArgumentException('non-nullable x_url cannot be null');
}
$this->container['x_url'] = $x_url;
return $this;
}
/**
* Gets rating
*
* @return \OpenAPI\Client\Model\GameResponseRating|null
*/
public function getRating()
{
return $this->container['rating'];
}
/**
* Sets rating
*
* @param \OpenAPI\Client\Model\GameResponseRating|null $rating rating
*
* @return self
*/
public function setRating($rating)
{
if (is_null($rating)) {
throw new \InvalidArgumentException('non-nullable rating cannot be null');
}
$this->container['rating'] = $rating;
return $this;
}
/**
* Gets description
*
* @return string|null
*/
public function getDescription()
{
return $this->container['description'];
}
/**
* Sets description
*
* @param string|null $description description
*
* @return self
*/
public function setDescription($description)
{
if (is_null($description)) {
throw new \InvalidArgumentException('non-nullable description cannot be null');
}
$this->container['description'] = $description;
return $this;
}
/**
* Gets short_description
*
* @return string|null
*/
public function getShortDescription()
{
return $this->container['short_description'];
}
/**
* Sets short_description
*
* @param string|null $short_description short_description
*
* @return self
*/
public function setShortDescription($short_description)
{
if (is_null($short_description)) {
throw new \InvalidArgumentException('non-nullable short_description cannot be null');
}
$this->container['short_description'] = $short_description;
return $this;
}
/**
* Gets release_date
*
* @return \DateTime|null
*/
public function getReleaseDate()
{
return $this->container['release_date'];
}
/**
* Sets release_date
*
* @param \DateTime|null $release_date release_date
*
* @return self
*/
public function setReleaseDate($release_date)
{
if (is_null($release_date)) {
throw new \InvalidArgumentException('non-nullable release_date cannot be null');
}
$this->container['release_date'] = $release_date;
return $this;
}
/**
* Gets developer
*
* @return string|null
*/
public function getDeveloper()
{
return $this->container['developer'];
}
/**
* Sets developer
*
* @param string|null $developer developer
*
* @return self
*/
public function setDeveloper($developer)
{
if (is_null($developer)) {
throw new \InvalidArgumentException('non-nullable developer cannot be null');
}
$this->container['developer'] = $developer;
return $this;
}
/**
* Gets playtime
*
* @return \OpenAPI\Client\Model\GameResponsePlaytime|null
*/
public function getPlaytime()
{
return $this->container['playtime'];
}
/**
* Sets playtime
*
* @param \OpenAPI\Client\Model\GameResponsePlaytime|null $playtime playtime
*
* @return self
*/
public function setPlaytime($playtime)
{
if (is_null($playtime)) {
throw new \InvalidArgumentException('non-nullable playtime cannot be null');
}
$this->container['playtime'] = $playtime;
return $this;
}
/**
* Gets platforms
*
* @return \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null
*/
public function getPlatforms()
{
return $this->container['platforms'];
}
/**
* Sets platforms
*
* @param \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null $platforms platforms
*
* @return self
*/
public function setPlatforms($platforms)
{
if (is_null($platforms)) {
throw new \InvalidArgumentException('non-nullable platforms cannot be null');
}
if ((count($platforms) > 100)) {
throw new \InvalidArgumentException('invalid value for $platforms when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['platforms'] = $platforms;
return $this;
}
/**
* Gets tags
*
* @return string[]|null
*/
public function getTags()
{
return $this->container['tags'];
}
/**
* Sets tags
*
* @param string[]|null $tags tags
*
* @return self
*/
public function setTags($tags)
{
if (is_null($tags)) {
throw new \InvalidArgumentException('non-nullable tags cannot be null');
}
if ((count($tags) > 100)) {
throw new \InvalidArgumentException('invalid value for $tags when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['tags'] = $tags;
return $this;
}
/**
* Gets genres
*
* @return \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null
*/
public function getGenres()
{
return $this->container['genres'];
}
/**
* Sets genres
*
* @param \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null $genres genres
*
* @return self
*/
public function setGenres($genres)
{
if (is_null($genres)) {
throw new \InvalidArgumentException('non-nullable genres cannot be null');
}
if ((count($genres) > 100)) {
throw new \InvalidArgumentException('invalid value for $genres when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['genres'] = $genres;
return $this;
}
/**
* Gets genre
*
* @return string|null
*/
public function getGenre()
{
return $this->container['genre'];
}
/**
* Sets genre
*
* @param string|null $genre genre
*
* @return self
*/
public function setGenre($genre)
{
if (is_null($genre)) {
throw new \InvalidArgumentException('non-nullable genre cannot be null');
}
$this->container['genre'] = $genre;
return $this;
}
/**
* Gets themes
*
* @return \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null
*/
public function getThemes()
{
return $this->container['themes'];
}
/**
* Sets themes
*
* @param \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null $themes themes
*
* @return self
*/
public function setThemes($themes)
{
if (is_null($themes)) {
throw new \InvalidArgumentException('non-nullable themes cannot be null');
}
if ((count($themes) > 100)) {
throw new \InvalidArgumentException('invalid value for $themes when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['themes'] = $themes;
return $this;
}
/**
* Gets adult_only
*
* @return bool|null
*/
public function getAdultOnly()
{
return $this->container['adult_only'];
}
/**
* Sets adult_only
*
* @param bool|null $adult_only adult_only
*
* @return self
*/
public function setAdultOnly($adult_only)
{
if (is_null($adult_only)) {
throw new \InvalidArgumentException('non-nullable adult_only cannot be null');
}
$this->container['adult_only'] = $adult_only;
return $this;
}
/**
* Gets play_modes
*
* @return \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null
*/
public function getPlayModes()
{
return $this->container['play_modes'];
}
/**
* Sets play_modes
*
* @param \OpenAPI\Client\Model\GameResponsePlatformsInner[]|null $play_modes play_modes
*
* @return self
*/
public function setPlayModes($play_modes)
{
if (is_null($play_modes)) {
throw new \InvalidArgumentException('non-nullable play_modes cannot be null');
}
if ((count($play_modes) > 100)) {
throw new \InvalidArgumentException('invalid value for $play_modes when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['play_modes'] = $play_modes;
return $this;
}
/**
* Gets screenshots
*
* @return string[]|null
*/
public function getScreenshots()
{
return $this->container['screenshots'];
}
/**
* Sets screenshots
*
* @param string[]|null $screenshots screenshots
*
* @return self
*/
public function setScreenshots($screenshots)
{
if (is_null($screenshots)) {
throw new \InvalidArgumentException('non-nullable screenshots cannot be null');
}
if ((count($screenshots) > 100)) {
throw new \InvalidArgumentException('invalid value for $screenshots when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['screenshots'] = $screenshots;
return $this;
}
/**
* Gets videos
*
* @return string[]|null
*/
public function getVideos()
{
return $this->container['videos'];
}
/**
* Sets videos
*
* @param string[]|null $videos videos
*
* @return self
*/
public function setVideos($videos)
{
if (is_null($videos)) {
throw new \InvalidArgumentException('non-nullable videos cannot be null');
}
if ((count($videos) > 100)) {
throw new \InvalidArgumentException('invalid value for $videos when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['videos'] = $videos;
return $this;
}
/**
* Gets offers
*
* @return \OpenAPI\Client\Model\GameResponseOffersInner[]|null
*/
public function getOffers()
{
return $this->container['offers'];
}
/**
* Sets offers
*
* @param \OpenAPI\Client\Model\GameResponseOffersInner[]|null $offers offers
*
* @return self
*/
public function setOffers($offers)
{
if (is_null($offers)) {
throw new \InvalidArgumentException('non-nullable offers cannot be null');
}
if ((count($offers) > 100)) {
throw new \InvalidArgumentException('invalid value for $offers when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['offers'] = $offers;
return $this;
}
/**
* Gets official_stores
*
* @return \OpenAPI\Client\Model\GameResponseOfficialStoresInner[]|null
*/
public function getOfficialStores()
{
return $this->container['official_stores'];
}
/**
* Sets official_stores
*
* @param \OpenAPI\Client\Model\GameResponseOfficialStoresInner[]|null $official_stores official_stores
*
* @return self
*/
public function setOfficialStores($official_stores)
{
if (is_null($official_stores)) {
throw new \InvalidArgumentException('non-nullable official_stores cannot be null');
}
if ((count($official_stores) > 100)) {
throw new \InvalidArgumentException('invalid value for $official_stores when calling GameResponse., number of items must be less than or equal to 100.');
}
$this->container['official_stores'] = $official_stores;
return $this;
}
/**
* Gets micro_trailer
*
* @return string|null
*/
public function getMicroTrailer()
{
return $this->container['micro_trailer'];
}
/**
* Sets micro_trailer
*
* @param string|null $micro_trailer micro_trailer
*
* @return self
*/
public function setMicroTrailer($micro_trailer)
{
if (is_null($micro_trailer)) {
throw new \InvalidArgumentException('non-nullable micro_trailer cannot be null');
}
$this->container['micro_trailer'] = $micro_trailer;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
public function offsetExists($offset): bool
{
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
*/
public function offsetSet($offset, $value): void
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*
* @return void
*/
public function offsetUnset($offset): void
{
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));
}
}