GetApiV3Discussions200ResponseDataInner.php 26 KB

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