GetApiV3Discussions200ResponseDataInner.php 34 KB

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