GetApiV3Search200ResponseDataInner.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  1. <?php
  2. /**
  3. * GetApiV3Search200ResponseDataInner
  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: 1.0.0
  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. * GetApiV3Search200ResponseDataInner 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 GetApiV3Search200ResponseDataInner 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_search_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' => 'string',
  54. 'resource_type' => 'string',
  55. 'resource_id' => 'string',
  56. 'granularity' => 'string',
  57. 'language' => 'string',
  58. 'related_id' => 'string',
  59. 'score' => 'float',
  60. 'title' => 'string',
  61. 'content' => 'string',
  62. 'highlight' => 'string',
  63. 'bold' => 'string[]',
  64. 'path' => 'string',
  65. 'category' => 'string[]',
  66. 'tags' => 'string[]',
  67. 'updated_at' => 'string',
  68. 'display' => 'string'
  69. ];
  70. /**
  71. * Array of property to format mappings. Used for (de)serialization
  72. *
  73. * @var string[]
  74. * @phpstan-var array<string, string|null>
  75. * @psalm-var array<string, string|null>
  76. */
  77. protected static $openAPIFormats = [
  78. 'id' => null,
  79. 'resource_type' => null,
  80. 'resource_id' => null,
  81. 'granularity' => null,
  82. 'language' => null,
  83. 'related_id' => null,
  84. 'score' => null,
  85. 'title' => null,
  86. 'content' => null,
  87. 'highlight' => null,
  88. 'bold' => null,
  89. 'path' => null,
  90. 'category' => null,
  91. 'tags' => null,
  92. 'updated_at' => null,
  93. 'display' => null
  94. ];
  95. /**
  96. * Array of nullable properties. Used for (de)serialization
  97. *
  98. * @var boolean[]
  99. */
  100. protected static array $openAPINullables = [
  101. 'id' => false,
  102. 'resource_type' => false,
  103. 'resource_id' => true,
  104. 'granularity' => true,
  105. 'language' => true,
  106. 'related_id' => true,
  107. 'score' => true,
  108. 'title' => false,
  109. 'content' => false,
  110. 'highlight' => true,
  111. 'bold' => false,
  112. 'path' => true,
  113. 'category' => false,
  114. 'tags' => false,
  115. 'updated_at' => true,
  116. 'display' => false
  117. ];
  118. /**
  119. * If a nullable field gets set to null, insert it here
  120. *
  121. * @var boolean[]
  122. */
  123. protected array $openAPINullablesSetToNull = [];
  124. /**
  125. * Array of property to type mappings. Used for (de)serialization
  126. *
  127. * @return array
  128. */
  129. public static function openAPITypes()
  130. {
  131. return self::$openAPITypes;
  132. }
  133. /**
  134. * Array of property to format mappings. Used for (de)serialization
  135. *
  136. * @return array
  137. */
  138. public static function openAPIFormats()
  139. {
  140. return self::$openAPIFormats;
  141. }
  142. /**
  143. * Array of nullable properties
  144. *
  145. * @return array
  146. */
  147. protected static function openAPINullables(): array
  148. {
  149. return self::$openAPINullables;
  150. }
  151. /**
  152. * Array of nullable field names deliberately set to null
  153. *
  154. * @return boolean[]
  155. */
  156. private function getOpenAPINullablesSetToNull(): array
  157. {
  158. return $this->openAPINullablesSetToNull;
  159. }
  160. /**
  161. * Setter - Array of nullable field names deliberately set to null
  162. *
  163. * @param boolean[] $openAPINullablesSetToNull
  164. */
  165. private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
  166. {
  167. $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
  168. }
  169. /**
  170. * Checks if a property is nullable
  171. *
  172. * @param string $property
  173. * @return bool
  174. */
  175. public static function isNullable(string $property): bool
  176. {
  177. return self::openAPINullables()[$property] ?? false;
  178. }
  179. /**
  180. * Checks if a nullable property is set to null.
  181. *
  182. * @param string $property
  183. * @return bool
  184. */
  185. public function isNullableSetToNull(string $property): bool
  186. {
  187. return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
  188. }
  189. /**
  190. * Array of attributes where the key is the local name,
  191. * and the value is the original name
  192. *
  193. * @var string[]
  194. */
  195. protected static $attributeMap = [
  196. 'id' => 'id',
  197. 'resource_type' => 'resource_type',
  198. 'resource_id' => 'resource_id',
  199. 'granularity' => 'granularity',
  200. 'language' => 'language',
  201. 'related_id' => 'related_id',
  202. 'score' => 'score',
  203. 'title' => 'title',
  204. 'content' => 'content',
  205. 'highlight' => 'highlight',
  206. 'bold' => 'bold',
  207. 'path' => 'path',
  208. 'category' => 'category',
  209. 'tags' => 'tags',
  210. 'updated_at' => 'updated_at',
  211. 'display' => 'display'
  212. ];
  213. /**
  214. * Array of attributes to setter functions (for deserialization of responses)
  215. *
  216. * @var string[]
  217. */
  218. protected static $setters = [
  219. 'id' => 'setId',
  220. 'resource_type' => 'setResourceType',
  221. 'resource_id' => 'setResourceId',
  222. 'granularity' => 'setGranularity',
  223. 'language' => 'setLanguage',
  224. 'related_id' => 'setRelatedId',
  225. 'score' => 'setScore',
  226. 'title' => 'setTitle',
  227. 'content' => 'setContent',
  228. 'highlight' => 'setHighlight',
  229. 'bold' => 'setBold',
  230. 'path' => 'setPath',
  231. 'category' => 'setCategory',
  232. 'tags' => 'setTags',
  233. 'updated_at' => 'setUpdatedAt',
  234. 'display' => 'setDisplay'
  235. ];
  236. /**
  237. * Array of attributes to getter functions (for serialization of requests)
  238. *
  239. * @var string[]
  240. */
  241. protected static $getters = [
  242. 'id' => 'getId',
  243. 'resource_type' => 'getResourceType',
  244. 'resource_id' => 'getResourceId',
  245. 'granularity' => 'getGranularity',
  246. 'language' => 'getLanguage',
  247. 'related_id' => 'getRelatedId',
  248. 'score' => 'getScore',
  249. 'title' => 'getTitle',
  250. 'content' => 'getContent',
  251. 'highlight' => 'getHighlight',
  252. 'bold' => 'getBold',
  253. 'path' => 'getPath',
  254. 'category' => 'getCategory',
  255. 'tags' => 'getTags',
  256. 'updated_at' => 'getUpdatedAt',
  257. 'display' => 'getDisplay'
  258. ];
  259. /**
  260. * Array of attributes where the key is the local name,
  261. * and the value is the original name
  262. *
  263. * @return array
  264. */
  265. public static function attributeMap()
  266. {
  267. return self::$attributeMap;
  268. }
  269. /**
  270. * Array of attributes to setter functions (for deserialization of responses)
  271. *
  272. * @return array
  273. */
  274. public static function setters()
  275. {
  276. return self::$setters;
  277. }
  278. /**
  279. * Array of attributes to getter functions (for serialization of requests)
  280. *
  281. * @return array
  282. */
  283. public static function getters()
  284. {
  285. return self::$getters;
  286. }
  287. /**
  288. * The original name of the model.
  289. *
  290. * @return string
  291. */
  292. public function getModelName()
  293. {
  294. return self::$openAPIModelName;
  295. }
  296. /**
  297. * Associative array for storing property values
  298. *
  299. * @var mixed[]
  300. */
  301. protected $container = [];
  302. /**
  303. * Constructor
  304. *
  305. * @param mixed[]|null $data Associated array of property values
  306. * initializing the model
  307. */
  308. public function __construct(?array $data = null)
  309. {
  310. $this->setIfExists('id', $data ?? [], null);
  311. $this->setIfExists('resource_type', $data ?? [], null);
  312. $this->setIfExists('resource_id', $data ?? [], null);
  313. $this->setIfExists('granularity', $data ?? [], null);
  314. $this->setIfExists('language', $data ?? [], null);
  315. $this->setIfExists('related_id', $data ?? [], null);
  316. $this->setIfExists('score', $data ?? [], null);
  317. $this->setIfExists('title', $data ?? [], null);
  318. $this->setIfExists('content', $data ?? [], null);
  319. $this->setIfExists('highlight', $data ?? [], null);
  320. $this->setIfExists('bold', $data ?? [], null);
  321. $this->setIfExists('path', $data ?? [], null);
  322. $this->setIfExists('category', $data ?? [], null);
  323. $this->setIfExists('tags', $data ?? [], null);
  324. $this->setIfExists('updated_at', $data ?? [], null);
  325. $this->setIfExists('display', $data ?? [], null);
  326. }
  327. /**
  328. * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
  329. * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
  330. * $this->openAPINullablesSetToNull array
  331. *
  332. * @param string $variableName
  333. * @param array $fields
  334. * @param mixed $defaultValue
  335. */
  336. private function setIfExists(string $variableName, array $fields, $defaultValue): void
  337. {
  338. if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
  339. $this->openAPINullablesSetToNull[] = $variableName;
  340. }
  341. $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
  342. }
  343. /**
  344. * Show all the invalid properties with reasons.
  345. *
  346. * @return array invalid properties with reasons
  347. */
  348. public function listInvalidProperties()
  349. {
  350. $invalidProperties = [];
  351. return $invalidProperties;
  352. }
  353. /**
  354. * Validate all the properties in the model
  355. * return true if all passed
  356. *
  357. * @return bool True if all properties are valid
  358. */
  359. public function valid()
  360. {
  361. return count($this->listInvalidProperties()) === 0;
  362. }
  363. /**
  364. * Gets id
  365. *
  366. * @return string|null
  367. */
  368. public function getId()
  369. {
  370. return $this->container['id'];
  371. }
  372. /**
  373. * Sets id
  374. *
  375. * @param string|null $id id
  376. *
  377. * @return self
  378. */
  379. public function setId($id)
  380. {
  381. if (is_null($id)) {
  382. throw new \InvalidArgumentException('non-nullable id cannot be null');
  383. }
  384. $this->container['id'] = $id;
  385. return $this;
  386. }
  387. /**
  388. * Gets resource_type
  389. *
  390. * @return string|null
  391. */
  392. public function getResourceType()
  393. {
  394. return $this->container['resource_type'];
  395. }
  396. /**
  397. * Sets resource_type
  398. *
  399. * @param string|null $resource_type resource_type
  400. *
  401. * @return self
  402. */
  403. public function setResourceType($resource_type)
  404. {
  405. if (is_null($resource_type)) {
  406. throw new \InvalidArgumentException('non-nullable resource_type cannot be null');
  407. }
  408. $this->container['resource_type'] = $resource_type;
  409. return $this;
  410. }
  411. /**
  412. * Gets resource_id
  413. *
  414. * @return string|null
  415. */
  416. public function getResourceId()
  417. {
  418. return $this->container['resource_id'];
  419. }
  420. /**
  421. * Sets resource_id
  422. *
  423. * @param string|null $resource_id resource_id
  424. *
  425. * @return self
  426. */
  427. public function setResourceId($resource_id)
  428. {
  429. if (is_null($resource_id)) {
  430. array_push($this->openAPINullablesSetToNull, 'resource_id');
  431. } else {
  432. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  433. $index = array_search('resource_id', $nullablesSetToNull);
  434. if ($index !== FALSE) {
  435. unset($nullablesSetToNull[$index]);
  436. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  437. }
  438. }
  439. $this->container['resource_id'] = $resource_id;
  440. return $this;
  441. }
  442. /**
  443. * Gets granularity
  444. *
  445. * @return string|null
  446. */
  447. public function getGranularity()
  448. {
  449. return $this->container['granularity'];
  450. }
  451. /**
  452. * Sets granularity
  453. *
  454. * @param string|null $granularity granularity
  455. *
  456. * @return self
  457. */
  458. public function setGranularity($granularity)
  459. {
  460. if (is_null($granularity)) {
  461. array_push($this->openAPINullablesSetToNull, 'granularity');
  462. } else {
  463. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  464. $index = array_search('granularity', $nullablesSetToNull);
  465. if ($index !== FALSE) {
  466. unset($nullablesSetToNull[$index]);
  467. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  468. }
  469. }
  470. $this->container['granularity'] = $granularity;
  471. return $this;
  472. }
  473. /**
  474. * Gets language
  475. *
  476. * @return string|null
  477. */
  478. public function getLanguage()
  479. {
  480. return $this->container['language'];
  481. }
  482. /**
  483. * Sets language
  484. *
  485. * @param string|null $language language
  486. *
  487. * @return self
  488. */
  489. public function setLanguage($language)
  490. {
  491. if (is_null($language)) {
  492. array_push($this->openAPINullablesSetToNull, 'language');
  493. } else {
  494. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  495. $index = array_search('language', $nullablesSetToNull);
  496. if ($index !== FALSE) {
  497. unset($nullablesSetToNull[$index]);
  498. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  499. }
  500. }
  501. $this->container['language'] = $language;
  502. return $this;
  503. }
  504. /**
  505. * Gets related_id
  506. *
  507. * @return string|null
  508. */
  509. public function getRelatedId()
  510. {
  511. return $this->container['related_id'];
  512. }
  513. /**
  514. * Sets related_id
  515. *
  516. * @param string|null $related_id related_id
  517. *
  518. * @return self
  519. */
  520. public function setRelatedId($related_id)
  521. {
  522. if (is_null($related_id)) {
  523. array_push($this->openAPINullablesSetToNull, 'related_id');
  524. } else {
  525. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  526. $index = array_search('related_id', $nullablesSetToNull);
  527. if ($index !== FALSE) {
  528. unset($nullablesSetToNull[$index]);
  529. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  530. }
  531. }
  532. $this->container['related_id'] = $related_id;
  533. return $this;
  534. }
  535. /**
  536. * Gets score
  537. *
  538. * @return float|null
  539. */
  540. public function getScore()
  541. {
  542. return $this->container['score'];
  543. }
  544. /**
  545. * Sets score
  546. *
  547. * @param float|null $score score
  548. *
  549. * @return self
  550. */
  551. public function setScore($score)
  552. {
  553. if (is_null($score)) {
  554. array_push($this->openAPINullablesSetToNull, 'score');
  555. } else {
  556. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  557. $index = array_search('score', $nullablesSetToNull);
  558. if ($index !== FALSE) {
  559. unset($nullablesSetToNull[$index]);
  560. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  561. }
  562. }
  563. $this->container['score'] = $score;
  564. return $this;
  565. }
  566. /**
  567. * Gets title
  568. *
  569. * @return string|null
  570. */
  571. public function getTitle()
  572. {
  573. return $this->container['title'];
  574. }
  575. /**
  576. * Sets title
  577. *
  578. * @param string|null $title title
  579. *
  580. * @return self
  581. */
  582. public function setTitle($title)
  583. {
  584. if (is_null($title)) {
  585. throw new \InvalidArgumentException('non-nullable title cannot be null');
  586. }
  587. $this->container['title'] = $title;
  588. return $this;
  589. }
  590. /**
  591. * Gets content
  592. *
  593. * @return string|null
  594. */
  595. public function getContent()
  596. {
  597. return $this->container['content'];
  598. }
  599. /**
  600. * Sets content
  601. *
  602. * @param string|null $content content
  603. *
  604. * @return self
  605. */
  606. public function setContent($content)
  607. {
  608. if (is_null($content)) {
  609. throw new \InvalidArgumentException('non-nullable content cannot be null');
  610. }
  611. $this->container['content'] = $content;
  612. return $this;
  613. }
  614. /**
  615. * Gets highlight
  616. *
  617. * @return string|null
  618. */
  619. public function getHighlight()
  620. {
  621. return $this->container['highlight'];
  622. }
  623. /**
  624. * Sets highlight
  625. *
  626. * @param string|null $highlight highlight
  627. *
  628. * @return self
  629. */
  630. public function setHighlight($highlight)
  631. {
  632. if (is_null($highlight)) {
  633. array_push($this->openAPINullablesSetToNull, 'highlight');
  634. } else {
  635. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  636. $index = array_search('highlight', $nullablesSetToNull);
  637. if ($index !== FALSE) {
  638. unset($nullablesSetToNull[$index]);
  639. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  640. }
  641. }
  642. $this->container['highlight'] = $highlight;
  643. return $this;
  644. }
  645. /**
  646. * Gets bold
  647. *
  648. * @return string[]|null
  649. */
  650. public function getBold()
  651. {
  652. return $this->container['bold'];
  653. }
  654. /**
  655. * Sets bold
  656. *
  657. * @param string[]|null $bold bold
  658. *
  659. * @return self
  660. */
  661. public function setBold($bold)
  662. {
  663. if (is_null($bold)) {
  664. throw new \InvalidArgumentException('non-nullable bold cannot be null');
  665. }
  666. $this->container['bold'] = $bold;
  667. return $this;
  668. }
  669. /**
  670. * Gets path
  671. *
  672. * @return string|null
  673. */
  674. public function getPath()
  675. {
  676. return $this->container['path'];
  677. }
  678. /**
  679. * Sets path
  680. *
  681. * @param string|null $path path
  682. *
  683. * @return self
  684. */
  685. public function setPath($path)
  686. {
  687. if (is_null($path)) {
  688. array_push($this->openAPINullablesSetToNull, 'path');
  689. } else {
  690. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  691. $index = array_search('path', $nullablesSetToNull);
  692. if ($index !== FALSE) {
  693. unset($nullablesSetToNull[$index]);
  694. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  695. }
  696. }
  697. $this->container['path'] = $path;
  698. return $this;
  699. }
  700. /**
  701. * Gets category
  702. *
  703. * @return string[]|null
  704. */
  705. public function getCategory()
  706. {
  707. return $this->container['category'];
  708. }
  709. /**
  710. * Sets category
  711. *
  712. * @param string[]|null $category category
  713. *
  714. * @return self
  715. */
  716. public function setCategory($category)
  717. {
  718. if (is_null($category)) {
  719. throw new \InvalidArgumentException('non-nullable category cannot be null');
  720. }
  721. $this->container['category'] = $category;
  722. return $this;
  723. }
  724. /**
  725. * Gets tags
  726. *
  727. * @return string[]|null
  728. */
  729. public function getTags()
  730. {
  731. return $this->container['tags'];
  732. }
  733. /**
  734. * Sets tags
  735. *
  736. * @param string[]|null $tags tags
  737. *
  738. * @return self
  739. */
  740. public function setTags($tags)
  741. {
  742. if (is_null($tags)) {
  743. throw new \InvalidArgumentException('non-nullable tags cannot be null');
  744. }
  745. $this->container['tags'] = $tags;
  746. return $this;
  747. }
  748. /**
  749. * Gets updated_at
  750. *
  751. * @return string|null
  752. */
  753. public function getUpdatedAt()
  754. {
  755. return $this->container['updated_at'];
  756. }
  757. /**
  758. * Sets updated_at
  759. *
  760. * @param string|null $updated_at updated_at
  761. *
  762. * @return self
  763. */
  764. public function setUpdatedAt($updated_at)
  765. {
  766. if (is_null($updated_at)) {
  767. array_push($this->openAPINullablesSetToNull, 'updated_at');
  768. } else {
  769. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  770. $index = array_search('updated_at', $nullablesSetToNull);
  771. if ($index !== FALSE) {
  772. unset($nullablesSetToNull[$index]);
  773. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  774. }
  775. }
  776. $this->container['updated_at'] = $updated_at;
  777. return $this;
  778. }
  779. /**
  780. * Gets display
  781. *
  782. * @return string|null
  783. */
  784. public function getDisplay()
  785. {
  786. return $this->container['display'];
  787. }
  788. /**
  789. * Sets display
  790. *
  791. * @param string|null $display 仅在部分查询口径下返回。
  792. *
  793. * @return self
  794. */
  795. public function setDisplay($display)
  796. {
  797. if (is_null($display)) {
  798. throw new \InvalidArgumentException('non-nullable display cannot be null');
  799. }
  800. $this->container['display'] = $display;
  801. return $this;
  802. }
  803. /**
  804. * Returns true if offset exists. False otherwise.
  805. *
  806. * @param integer|string $offset Offset
  807. *
  808. * @return boolean
  809. */
  810. public function offsetExists(mixed $offset): bool
  811. {
  812. return isset($this->container[$offset]);
  813. }
  814. /**
  815. * Gets offset.
  816. *
  817. * @param integer|string $offset Offset
  818. *
  819. * @return mixed|null
  820. */
  821. #[\ReturnTypeWillChange]
  822. public function offsetGet(mixed $offset)
  823. {
  824. return $this->container[$offset] ?? null;
  825. }
  826. /**
  827. * Sets value based on offset.
  828. *
  829. * @param int|null $offset Offset
  830. * @param mixed $value Value to be set
  831. *
  832. * @return void
  833. */
  834. public function offsetSet($offset, $value): void
  835. {
  836. if (is_null($offset)) {
  837. $this->container[] = $value;
  838. } else {
  839. $this->container[$offset] = $value;
  840. }
  841. }
  842. /**
  843. * Unsets offset.
  844. *
  845. * @param integer|string $offset Offset
  846. *
  847. * @return void
  848. */
  849. public function offsetUnset(mixed $offset): void
  850. {
  851. unset($this->container[$offset]);
  852. }
  853. /**
  854. * Serializes the object to a value that can be serialized natively by json_encode().
  855. * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
  856. *
  857. * @return mixed Returns data which can be serialized by json_encode(), which is a value
  858. * of any type other than a resource.
  859. */
  860. #[\ReturnTypeWillChange]
  861. public function jsonSerialize()
  862. {
  863. return ObjectSerializer::sanitizeForSerialization($this);
  864. }
  865. /**
  866. * Gets the string presentation of the object
  867. *
  868. * @return string
  869. */
  870. public function __toString()
  871. {
  872. return json_encode(
  873. ObjectSerializer::sanitizeForSerialization($this),
  874. JSON_PRETTY_PRINT
  875. );
  876. }
  877. /**
  878. * Gets a header-safe presentation of the object
  879. *
  880. * @return string
  881. */
  882. public function toHeaderValue()
  883. {
  884. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  885. }
  886. }