GetApiV3Discussions200ResponseDataInner.php 35 KB

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