GetApiV3Discussions200ResponseDataInner.php 33 KB

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