GetApiV3AdminAgentFeedback200ResponseDataInner.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941
  1. <?php
  2. /**
  3. * GetApiV3AdminAgentFeedback200ResponseDataInner
  4. *
  5. * PHP version 8.1
  6. *
  7. * @category Class
  8. * @package WikipaliApi
  9. * @author OpenAPI Generator team
  10. * @link https://openapi-generator.tech
  11. */
  12. /**
  13. * MINT API
  14. *
  15. * International Academy Of Pali Tipitaka(国际巴利三藏学院) 由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
  16. *
  17. * The version of the OpenAPI document: 2026.11.12
  18. * Generated by: https://openapi-generator.tech
  19. * Generator version: 7.25.0
  20. */
  21. /**
  22. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
  23. * https://openapi-generator.tech
  24. * Do not edit the class manually.
  25. */
  26. namespace WikipaliApi\Model;
  27. use \ArrayAccess;
  28. use \WikipaliApi\ObjectSerializer;
  29. /**
  30. * GetApiV3AdminAgentFeedback200ResponseDataInner Class Doc Comment
  31. *
  32. * @category Class
  33. * @package WikipaliApi
  34. * @author OpenAPI Generator team
  35. * @link https://openapi-generator.tech
  36. * @implements \ArrayAccess<string, mixed>
  37. */
  38. class GetApiV3AdminAgentFeedback200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
  39. {
  40. public const DISCRIMINATOR = null;
  41. /**
  42. * The original name of the model.
  43. *
  44. * @var string
  45. */
  46. protected static $openAPIModelName = 'get_api_v3_admin_agent_feedback_200_response_data_inner';
  47. /**
  48. * Array of property to type mappings. Used for (de)serialization
  49. *
  50. * @var string[]
  51. */
  52. protected static $openAPITypes = [
  53. 'id' => 'int',
  54. 'message_id' => 'string',
  55. 'rating' => 'int',
  56. 'tags' => 'string[]',
  57. 'comment' => 'string',
  58. 'asked' => 'bool',
  59. 'client' => 'string',
  60. 'account_type' => 'string',
  61. 'updated_at' => 'string',
  62. 'run_id' => 'string',
  63. 'question' => 'string',
  64. 'route' => 'string',
  65. 'status' => 'string',
  66. 'deep' => 'bool',
  67. 'latency_ms' => 'int'
  68. ];
  69. /**
  70. * Array of property to format mappings. Used for (de)serialization
  71. *
  72. * @var string[]
  73. * @phpstan-var array<string, string|null>
  74. * @psalm-var array<string, string|null>
  75. */
  76. protected static $openAPIFormats = [
  77. 'id' => null,
  78. 'message_id' => null,
  79. 'rating' => null,
  80. 'tags' => null,
  81. 'comment' => null,
  82. 'asked' => null,
  83. 'client' => null,
  84. 'account_type' => null,
  85. 'updated_at' => null,
  86. 'run_id' => null,
  87. 'question' => null,
  88. 'route' => null,
  89. 'status' => null,
  90. 'deep' => null,
  91. 'latency_ms' => null
  92. ];
  93. /**
  94. * Array of nullable properties. Used for (de)serialization
  95. *
  96. * @var boolean[]
  97. */
  98. protected static array $openAPINullables = [
  99. 'id' => false,
  100. 'message_id' => false,
  101. 'rating' => false,
  102. 'tags' => false,
  103. 'comment' => true,
  104. 'asked' => false,
  105. 'client' => true,
  106. 'account_type' => false,
  107. 'updated_at' => false,
  108. 'run_id' => true,
  109. 'question' => true,
  110. 'route' => true,
  111. 'status' => true,
  112. 'deep' => true,
  113. 'latency_ms' => true
  114. ];
  115. /**
  116. * If a nullable field gets set to null, insert it here
  117. *
  118. * @var boolean[]
  119. */
  120. protected array $openAPINullablesSetToNull = [];
  121. /**
  122. * Array of property to type mappings. Used for (de)serialization
  123. *
  124. * @return array
  125. */
  126. public static function openAPITypes()
  127. {
  128. return self::$openAPITypes;
  129. }
  130. /**
  131. * Array of property to format mappings. Used for (de)serialization
  132. *
  133. * @return array
  134. */
  135. public static function openAPIFormats()
  136. {
  137. return self::$openAPIFormats;
  138. }
  139. /**
  140. * Array of nullable properties
  141. *
  142. * @return array
  143. */
  144. protected static function openAPINullables(): array
  145. {
  146. return self::$openAPINullables;
  147. }
  148. /**
  149. * Array of nullable field names deliberately set to null
  150. *
  151. * @return boolean[]
  152. */
  153. private function getOpenAPINullablesSetToNull(): array
  154. {
  155. return $this->openAPINullablesSetToNull;
  156. }
  157. /**
  158. * Setter - Array of nullable field names deliberately set to null
  159. *
  160. * @param boolean[] $openAPINullablesSetToNull
  161. */
  162. private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
  163. {
  164. $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
  165. }
  166. /**
  167. * Checks if a property is nullable
  168. *
  169. * @param string $property
  170. * @return bool
  171. */
  172. public static function isNullable(string $property): bool
  173. {
  174. return self::openAPINullables()[$property] ?? false;
  175. }
  176. /**
  177. * Checks if a nullable property is set to null.
  178. *
  179. * @param string $property
  180. * @return bool
  181. */
  182. public function isNullableSetToNull(string $property): bool
  183. {
  184. return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
  185. }
  186. /**
  187. * Array of attributes where the key is the local name,
  188. * and the value is the original name
  189. *
  190. * @var string[]
  191. */
  192. protected static $attributeMap = [
  193. 'id' => 'id',
  194. 'message_id' => 'message_id',
  195. 'rating' => 'rating',
  196. 'tags' => 'tags',
  197. 'comment' => 'comment',
  198. 'asked' => 'asked',
  199. 'client' => 'client',
  200. 'account_type' => 'account_type',
  201. 'updated_at' => 'updated_at',
  202. 'run_id' => 'run_id',
  203. 'question' => 'question',
  204. 'route' => 'route',
  205. 'status' => 'status',
  206. 'deep' => 'deep',
  207. 'latency_ms' => 'latency_ms'
  208. ];
  209. /**
  210. * Array of attributes to setter functions (for deserialization of responses)
  211. *
  212. * @var string[]
  213. */
  214. protected static $setters = [
  215. 'id' => 'setId',
  216. 'message_id' => 'setMessageId',
  217. 'rating' => 'setRating',
  218. 'tags' => 'setTags',
  219. 'comment' => 'setComment',
  220. 'asked' => 'setAsked',
  221. 'client' => 'setClient',
  222. 'account_type' => 'setAccountType',
  223. 'updated_at' => 'setUpdatedAt',
  224. 'run_id' => 'setRunId',
  225. 'question' => 'setQuestion',
  226. 'route' => 'setRoute',
  227. 'status' => 'setStatus',
  228. 'deep' => 'setDeep',
  229. 'latency_ms' => 'setLatencyMs'
  230. ];
  231. /**
  232. * Array of attributes to getter functions (for serialization of requests)
  233. *
  234. * @var string[]
  235. */
  236. protected static $getters = [
  237. 'id' => 'getId',
  238. 'message_id' => 'getMessageId',
  239. 'rating' => 'getRating',
  240. 'tags' => 'getTags',
  241. 'comment' => 'getComment',
  242. 'asked' => 'getAsked',
  243. 'client' => 'getClient',
  244. 'account_type' => 'getAccountType',
  245. 'updated_at' => 'getUpdatedAt',
  246. 'run_id' => 'getRunId',
  247. 'question' => 'getQuestion',
  248. 'route' => 'getRoute',
  249. 'status' => 'getStatus',
  250. 'deep' => 'getDeep',
  251. 'latency_ms' => 'getLatencyMs'
  252. ];
  253. /**
  254. * Array of attributes where the key is the local name,
  255. * and the value is the original name
  256. *
  257. * @return array
  258. */
  259. public static function attributeMap()
  260. {
  261. return self::$attributeMap;
  262. }
  263. /**
  264. * Array of attributes to setter functions (for deserialization of responses)
  265. *
  266. * @return array
  267. */
  268. public static function setters()
  269. {
  270. return self::$setters;
  271. }
  272. /**
  273. * Array of attributes to getter functions (for serialization of requests)
  274. *
  275. * @return array
  276. */
  277. public static function getters()
  278. {
  279. return self::$getters;
  280. }
  281. /**
  282. * The original name of the model.
  283. *
  284. * @return string
  285. */
  286. public function getModelName()
  287. {
  288. return self::$openAPIModelName;
  289. }
  290. /**
  291. * Associative array for storing property values
  292. *
  293. * @var mixed[]
  294. */
  295. protected $container = [];
  296. /**
  297. * Constructor
  298. *
  299. * @param mixed[]|null $data Associated array of property values
  300. * initializing the model
  301. */
  302. public function __construct(?array $data = null)
  303. {
  304. $this->setIfExists('id', $data ?? [], null);
  305. $this->setIfExists('message_id', $data ?? [], null);
  306. $this->setIfExists('rating', $data ?? [], null);
  307. $this->setIfExists('tags', $data ?? [], null);
  308. $this->setIfExists('comment', $data ?? [], null);
  309. $this->setIfExists('asked', $data ?? [], null);
  310. $this->setIfExists('client', $data ?? [], null);
  311. $this->setIfExists('account_type', $data ?? [], null);
  312. $this->setIfExists('updated_at', $data ?? [], null);
  313. $this->setIfExists('run_id', $data ?? [], null);
  314. $this->setIfExists('question', $data ?? [], null);
  315. $this->setIfExists('route', $data ?? [], null);
  316. $this->setIfExists('status', $data ?? [], null);
  317. $this->setIfExists('deep', $data ?? [], null);
  318. $this->setIfExists('latency_ms', $data ?? [], null);
  319. }
  320. /**
  321. * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
  322. * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
  323. * $this->openAPINullablesSetToNull array
  324. *
  325. * @param string $variableName
  326. * @param array $fields
  327. * @param mixed $defaultValue
  328. */
  329. private function setIfExists(string $variableName, array $fields, $defaultValue): void
  330. {
  331. if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
  332. $this->openAPINullablesSetToNull[] = $variableName;
  333. }
  334. $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
  335. }
  336. /**
  337. * Show all the invalid properties with reasons.
  338. *
  339. * @return array invalid properties with reasons
  340. */
  341. public function listInvalidProperties()
  342. {
  343. $invalidProperties = [];
  344. return $invalidProperties;
  345. }
  346. /**
  347. * Validate all the properties in the model
  348. * return true if all passed
  349. *
  350. * @return bool True if all properties are valid
  351. */
  352. public function valid()
  353. {
  354. return count($this->listInvalidProperties()) === 0;
  355. }
  356. /**
  357. * Gets id
  358. *
  359. * @return int|null
  360. */
  361. public function getId()
  362. {
  363. return $this->container['id'];
  364. }
  365. /**
  366. * Sets id
  367. *
  368. * @param int|null $id id
  369. *
  370. * @return self
  371. */
  372. public function setId($id)
  373. {
  374. if (is_null($id)) {
  375. throw new \InvalidArgumentException('non-nullable id cannot be null');
  376. }
  377. $this->container['id'] = $id;
  378. return $this;
  379. }
  380. /**
  381. * Gets message_id
  382. *
  383. * @return string|null
  384. */
  385. public function getMessageId()
  386. {
  387. return $this->container['message_id'];
  388. }
  389. /**
  390. * Sets message_id
  391. *
  392. * @param string|null $message_id message_id
  393. *
  394. * @return self
  395. */
  396. public function setMessageId($message_id)
  397. {
  398. if (is_null($message_id)) {
  399. throw new \InvalidArgumentException('non-nullable message_id cannot be null');
  400. }
  401. $this->container['message_id'] = $message_id;
  402. return $this;
  403. }
  404. /**
  405. * Gets rating
  406. *
  407. * @return int|null
  408. */
  409. public function getRating()
  410. {
  411. return $this->container['rating'];
  412. }
  413. /**
  414. * Sets rating
  415. *
  416. * @param int|null $rating rating
  417. *
  418. * @return self
  419. */
  420. public function setRating($rating)
  421. {
  422. if (is_null($rating)) {
  423. throw new \InvalidArgumentException('non-nullable rating cannot be null');
  424. }
  425. $this->container['rating'] = $rating;
  426. return $this;
  427. }
  428. /**
  429. * Gets tags
  430. *
  431. * @return string[]|null
  432. */
  433. public function getTags()
  434. {
  435. return $this->container['tags'];
  436. }
  437. /**
  438. * Sets tags
  439. *
  440. * @param string[]|null $tags tags
  441. *
  442. * @return self
  443. */
  444. public function setTags($tags)
  445. {
  446. if (is_null($tags)) {
  447. throw new \InvalidArgumentException('non-nullable tags cannot be null');
  448. }
  449. $this->container['tags'] = $tags;
  450. return $this;
  451. }
  452. /**
  453. * Gets comment
  454. *
  455. * @return string|null
  456. */
  457. public function getComment()
  458. {
  459. return $this->container['comment'];
  460. }
  461. /**
  462. * Sets comment
  463. *
  464. * @param string|null $comment comment
  465. *
  466. * @return self
  467. */
  468. public function setComment($comment)
  469. {
  470. if (is_null($comment)) {
  471. array_push($this->openAPINullablesSetToNull, 'comment');
  472. } else {
  473. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  474. $index = array_search('comment', $nullablesSetToNull);
  475. if ($index !== FALSE) {
  476. unset($nullablesSetToNull[$index]);
  477. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  478. }
  479. }
  480. $this->container['comment'] = $comment;
  481. return $this;
  482. }
  483. /**
  484. * Gets asked
  485. *
  486. * @return bool|null
  487. */
  488. public function getAsked()
  489. {
  490. return $this->container['asked'];
  491. }
  492. /**
  493. * Sets asked
  494. *
  495. * @param bool|null $asked asked
  496. *
  497. * @return self
  498. */
  499. public function setAsked($asked)
  500. {
  501. if (is_null($asked)) {
  502. throw new \InvalidArgumentException('non-nullable asked cannot be null');
  503. }
  504. $this->container['asked'] = $asked;
  505. return $this;
  506. }
  507. /**
  508. * Gets client
  509. *
  510. * @return string|null
  511. */
  512. public function getClient()
  513. {
  514. return $this->container['client'];
  515. }
  516. /**
  517. * Sets client
  518. *
  519. * @param string|null $client client
  520. *
  521. * @return self
  522. */
  523. public function setClient($client)
  524. {
  525. if (is_null($client)) {
  526. array_push($this->openAPINullablesSetToNull, 'client');
  527. } else {
  528. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  529. $index = array_search('client', $nullablesSetToNull);
  530. if ($index !== FALSE) {
  531. unset($nullablesSetToNull[$index]);
  532. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  533. }
  534. }
  535. $this->container['client'] = $client;
  536. return $this;
  537. }
  538. /**
  539. * Gets account_type
  540. *
  541. * @return string|null
  542. */
  543. public function getAccountType()
  544. {
  545. return $this->container['account_type'];
  546. }
  547. /**
  548. * Sets account_type
  549. *
  550. * @param string|null $account_type account_type
  551. *
  552. * @return self
  553. */
  554. public function setAccountType($account_type)
  555. {
  556. if (is_null($account_type)) {
  557. throw new \InvalidArgumentException('non-nullable account_type cannot be null');
  558. }
  559. $this->container['account_type'] = $account_type;
  560. return $this;
  561. }
  562. /**
  563. * Gets updated_at
  564. *
  565. * @return string|null
  566. */
  567. public function getUpdatedAt()
  568. {
  569. return $this->container['updated_at'];
  570. }
  571. /**
  572. * Sets updated_at
  573. *
  574. * @param string|null $updated_at updated_at
  575. *
  576. * @return self
  577. */
  578. public function setUpdatedAt($updated_at)
  579. {
  580. if (is_null($updated_at)) {
  581. throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
  582. }
  583. $this->container['updated_at'] = $updated_at;
  584. return $this;
  585. }
  586. /**
  587. * Gets run_id
  588. *
  589. * @return string|null
  590. */
  591. public function getRunId()
  592. {
  593. return $this->container['run_id'];
  594. }
  595. /**
  596. * Sets run_id
  597. *
  598. * @param string|null $run_id run_id
  599. *
  600. * @return self
  601. */
  602. public function setRunId($run_id)
  603. {
  604. if (is_null($run_id)) {
  605. array_push($this->openAPINullablesSetToNull, 'run_id');
  606. } else {
  607. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  608. $index = array_search('run_id', $nullablesSetToNull);
  609. if ($index !== FALSE) {
  610. unset($nullablesSetToNull[$index]);
  611. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  612. }
  613. }
  614. $this->container['run_id'] = $run_id;
  615. return $this;
  616. }
  617. /**
  618. * Gets question
  619. *
  620. * @return string|null
  621. */
  622. public function getQuestion()
  623. {
  624. return $this->container['question'];
  625. }
  626. /**
  627. * Sets question
  628. *
  629. * @param string|null $question question
  630. *
  631. * @return self
  632. */
  633. public function setQuestion($question)
  634. {
  635. if (is_null($question)) {
  636. array_push($this->openAPINullablesSetToNull, 'question');
  637. } else {
  638. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  639. $index = array_search('question', $nullablesSetToNull);
  640. if ($index !== FALSE) {
  641. unset($nullablesSetToNull[$index]);
  642. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  643. }
  644. }
  645. $this->container['question'] = $question;
  646. return $this;
  647. }
  648. /**
  649. * Gets route
  650. *
  651. * @return string|null
  652. */
  653. public function getRoute()
  654. {
  655. return $this->container['route'];
  656. }
  657. /**
  658. * Sets route
  659. *
  660. * @param string|null $route route
  661. *
  662. * @return self
  663. */
  664. public function setRoute($route)
  665. {
  666. if (is_null($route)) {
  667. array_push($this->openAPINullablesSetToNull, 'route');
  668. } else {
  669. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  670. $index = array_search('route', $nullablesSetToNull);
  671. if ($index !== FALSE) {
  672. unset($nullablesSetToNull[$index]);
  673. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  674. }
  675. }
  676. $this->container['route'] = $route;
  677. return $this;
  678. }
  679. /**
  680. * Gets status
  681. *
  682. * @return string|null
  683. */
  684. public function getStatus()
  685. {
  686. return $this->container['status'];
  687. }
  688. /**
  689. * Sets status
  690. *
  691. * @param string|null $status status
  692. *
  693. * @return self
  694. */
  695. public function setStatus($status)
  696. {
  697. if (is_null($status)) {
  698. array_push($this->openAPINullablesSetToNull, 'status');
  699. } else {
  700. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  701. $index = array_search('status', $nullablesSetToNull);
  702. if ($index !== FALSE) {
  703. unset($nullablesSetToNull[$index]);
  704. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  705. }
  706. }
  707. $this->container['status'] = $status;
  708. return $this;
  709. }
  710. /**
  711. * Gets deep
  712. *
  713. * @return bool|null
  714. */
  715. public function getDeep()
  716. {
  717. return $this->container['deep'];
  718. }
  719. /**
  720. * Sets deep
  721. *
  722. * @param bool|null $deep deep
  723. *
  724. * @return self
  725. */
  726. public function setDeep($deep)
  727. {
  728. if (is_null($deep)) {
  729. array_push($this->openAPINullablesSetToNull, 'deep');
  730. } else {
  731. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  732. $index = array_search('deep', $nullablesSetToNull);
  733. if ($index !== FALSE) {
  734. unset($nullablesSetToNull[$index]);
  735. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  736. }
  737. }
  738. $this->container['deep'] = $deep;
  739. return $this;
  740. }
  741. /**
  742. * Gets latency_ms
  743. *
  744. * @return int|null
  745. */
  746. public function getLatencyMs()
  747. {
  748. return $this->container['latency_ms'];
  749. }
  750. /**
  751. * Sets latency_ms
  752. *
  753. * @param int|null $latency_ms latency_ms
  754. *
  755. * @return self
  756. */
  757. public function setLatencyMs($latency_ms)
  758. {
  759. if (is_null($latency_ms)) {
  760. array_push($this->openAPINullablesSetToNull, 'latency_ms');
  761. } else {
  762. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  763. $index = array_search('latency_ms', $nullablesSetToNull);
  764. if ($index !== FALSE) {
  765. unset($nullablesSetToNull[$index]);
  766. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  767. }
  768. }
  769. $this->container['latency_ms'] = $latency_ms;
  770. return $this;
  771. }
  772. /**
  773. * Returns true if offset exists. False otherwise.
  774. *
  775. * @param integer|string $offset Offset
  776. *
  777. * @return boolean
  778. */
  779. public function offsetExists(mixed $offset): bool
  780. {
  781. return isset($this->container[$offset]);
  782. }
  783. /**
  784. * Gets offset.
  785. *
  786. * @param integer|string $offset Offset
  787. *
  788. * @return mixed|null
  789. */
  790. #[\ReturnTypeWillChange]
  791. public function offsetGet(mixed $offset)
  792. {
  793. return $this->container[$offset] ?? null;
  794. }
  795. /**
  796. * Sets value based on offset.
  797. *
  798. * @param int|null $offset Offset
  799. * @param mixed $value Value to be set
  800. *
  801. * @return void
  802. */
  803. public function offsetSet($offset, $value): void
  804. {
  805. if (is_null($offset)) {
  806. $this->container[] = $value;
  807. } else {
  808. $this->container[$offset] = $value;
  809. }
  810. }
  811. /**
  812. * Unsets offset.
  813. *
  814. * @param integer|string $offset Offset
  815. *
  816. * @return void
  817. */
  818. public function offsetUnset(mixed $offset): void
  819. {
  820. unset($this->container[$offset]);
  821. }
  822. /**
  823. * Serializes the object to a value that can be serialized natively by json_encode().
  824. * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
  825. *
  826. * @return mixed Returns data which can be serialized by json_encode(), which is a value
  827. * of any type other than a resource.
  828. */
  829. #[\ReturnTypeWillChange]
  830. public function jsonSerialize()
  831. {
  832. return ObjectSerializer::sanitizeForSerialization($this);
  833. }
  834. /**
  835. * Gets the string presentation of the object
  836. *
  837. * @return string
  838. */
  839. public function __toString()
  840. {
  841. return json_encode(
  842. ObjectSerializer::sanitizeForSerialization($this),
  843. JSON_PRETTY_PRINT
  844. );
  845. }
  846. /**
  847. * Gets a header-safe presentation of the object
  848. *
  849. * @return string
  850. */
  851. public function toHeaderValue()
  852. {
  853. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  854. }
  855. }