PostApiV3DiscussionsRequest.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. <?php
  2. /**
  3. * PostApiV3DiscussionsRequest
  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. * PostApiV3DiscussionsRequest 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 PostApiV3DiscussionsRequest 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 = 'post_api_v3_discussions_request';
  47. /**
  48. * Array of property to type mappings. Used for (de)serialization
  49. *
  50. * @var string[]
  51. */
  52. protected static $openAPITypes = [
  53. 'target_type' => 'string',
  54. 'target_id' => 'string',
  55. 'type' => 'string',
  56. 'title' => 'string',
  57. 'content' => 'string',
  58. 'severity' => 'string',
  59. 'score' => 'float',
  60. 'pos_start' => 'int',
  61. 'pos_end' => 'int',
  62. 'quote_exact' => 'string',
  63. 'quote_prefix' => 'string',
  64. 'quote_suffix' => 'string',
  65. 'tpl_id' => 'string',
  66. 'notify' => 'bool'
  67. ];
  68. /**
  69. * Array of property to format mappings. Used for (de)serialization
  70. *
  71. * @var string[]
  72. * @phpstan-var array<string, string|null>
  73. * @psalm-var array<string, string|null>
  74. */
  75. protected static $openAPIFormats = [
  76. 'target_type' => null,
  77. 'target_id' => null,
  78. 'type' => null,
  79. 'title' => null,
  80. 'content' => null,
  81. 'severity' => null,
  82. 'score' => null,
  83. 'pos_start' => null,
  84. 'pos_end' => null,
  85. 'quote_exact' => null,
  86. 'quote_prefix' => null,
  87. 'quote_suffix' => null,
  88. 'tpl_id' => null,
  89. 'notify' => null
  90. ];
  91. /**
  92. * Array of nullable properties. Used for (de)serialization
  93. *
  94. * @var boolean[]
  95. */
  96. protected static array $openAPINullables = [
  97. 'target_type' => false,
  98. 'target_id' => false,
  99. 'type' => false,
  100. 'title' => false,
  101. 'content' => false,
  102. 'severity' => false,
  103. 'score' => false,
  104. 'pos_start' => false,
  105. 'pos_end' => false,
  106. 'quote_exact' => false,
  107. 'quote_prefix' => false,
  108. 'quote_suffix' => false,
  109. 'tpl_id' => false,
  110. 'notify' => false
  111. ];
  112. /**
  113. * If a nullable field gets set to null, insert it here
  114. *
  115. * @var boolean[]
  116. */
  117. protected array $openAPINullablesSetToNull = [];
  118. /**
  119. * Array of property to type mappings. Used for (de)serialization
  120. *
  121. * @return array
  122. */
  123. public static function openAPITypes()
  124. {
  125. return self::$openAPITypes;
  126. }
  127. /**
  128. * Array of property to format mappings. Used for (de)serialization
  129. *
  130. * @return array
  131. */
  132. public static function openAPIFormats()
  133. {
  134. return self::$openAPIFormats;
  135. }
  136. /**
  137. * Array of nullable properties
  138. *
  139. * @return array
  140. */
  141. protected static function openAPINullables(): array
  142. {
  143. return self::$openAPINullables;
  144. }
  145. /**
  146. * Array of nullable field names deliberately set to null
  147. *
  148. * @return boolean[]
  149. */
  150. private function getOpenAPINullablesSetToNull(): array
  151. {
  152. return $this->openAPINullablesSetToNull;
  153. }
  154. /**
  155. * Setter - Array of nullable field names deliberately set to null
  156. *
  157. * @param boolean[] $openAPINullablesSetToNull
  158. */
  159. private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
  160. {
  161. $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
  162. }
  163. /**
  164. * Checks if a property is nullable
  165. *
  166. * @param string $property
  167. * @return bool
  168. */
  169. public static function isNullable(string $property): bool
  170. {
  171. return self::openAPINullables()[$property] ?? false;
  172. }
  173. /**
  174. * Checks if a nullable property is set to null.
  175. *
  176. * @param string $property
  177. * @return bool
  178. */
  179. public function isNullableSetToNull(string $property): bool
  180. {
  181. return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
  182. }
  183. /**
  184. * Array of attributes where the key is the local name,
  185. * and the value is the original name
  186. *
  187. * @var string[]
  188. */
  189. protected static $attributeMap = [
  190. 'target_type' => 'target_type',
  191. 'target_id' => 'target_id',
  192. 'type' => 'type',
  193. 'title' => 'title',
  194. 'content' => 'content',
  195. 'severity' => 'severity',
  196. 'score' => 'score',
  197. 'pos_start' => 'pos_start',
  198. 'pos_end' => 'pos_end',
  199. 'quote_exact' => 'quote_exact',
  200. 'quote_prefix' => 'quote_prefix',
  201. 'quote_suffix' => 'quote_suffix',
  202. 'tpl_id' => 'tpl_id',
  203. 'notify' => 'notify'
  204. ];
  205. /**
  206. * Array of attributes to setter functions (for deserialization of responses)
  207. *
  208. * @var string[]
  209. */
  210. protected static $setters = [
  211. 'target_type' => 'setTargetType',
  212. 'target_id' => 'setTargetId',
  213. 'type' => 'setType',
  214. 'title' => 'setTitle',
  215. 'content' => 'setContent',
  216. 'severity' => 'setSeverity',
  217. 'score' => 'setScore',
  218. 'pos_start' => 'setPosStart',
  219. 'pos_end' => 'setPosEnd',
  220. 'quote_exact' => 'setQuoteExact',
  221. 'quote_prefix' => 'setQuotePrefix',
  222. 'quote_suffix' => 'setQuoteSuffix',
  223. 'tpl_id' => 'setTplId',
  224. 'notify' => 'setNotify'
  225. ];
  226. /**
  227. * Array of attributes to getter functions (for serialization of requests)
  228. *
  229. * @var string[]
  230. */
  231. protected static $getters = [
  232. 'target_type' => 'getTargetType',
  233. 'target_id' => 'getTargetId',
  234. 'type' => 'getType',
  235. 'title' => 'getTitle',
  236. 'content' => 'getContent',
  237. 'severity' => 'getSeverity',
  238. 'score' => 'getScore',
  239. 'pos_start' => 'getPosStart',
  240. 'pos_end' => 'getPosEnd',
  241. 'quote_exact' => 'getQuoteExact',
  242. 'quote_prefix' => 'getQuotePrefix',
  243. 'quote_suffix' => 'getQuoteSuffix',
  244. 'tpl_id' => 'getTplId',
  245. 'notify' => 'getNotify'
  246. ];
  247. /**
  248. * Array of attributes where the key is the local name,
  249. * and the value is the original name
  250. *
  251. * @return array
  252. */
  253. public static function attributeMap()
  254. {
  255. return self::$attributeMap;
  256. }
  257. /**
  258. * Array of attributes to setter functions (for deserialization of responses)
  259. *
  260. * @return array
  261. */
  262. public static function setters()
  263. {
  264. return self::$setters;
  265. }
  266. /**
  267. * Array of attributes to getter functions (for serialization of requests)
  268. *
  269. * @return array
  270. */
  271. public static function getters()
  272. {
  273. return self::$getters;
  274. }
  275. /**
  276. * The original name of the model.
  277. *
  278. * @return string
  279. */
  280. public function getModelName()
  281. {
  282. return self::$openAPIModelName;
  283. }
  284. public const TARGET_TYPE_SENTENCE = 'sentence';
  285. public const TARGET_TYPE_WBW = 'wbw';
  286. public const TARGET_TYPE_ARTICLE = 'article';
  287. public const TARGET_TYPE_TERM = 'term';
  288. public const TARGET_TYPE_TASK = 'task';
  289. public const TYPE_DISCUSSION = 'discussion';
  290. public const TYPE_QA = 'qa';
  291. public const TYPE_HELP = 'help';
  292. public const TYPE_ISSUE = 'issue';
  293. public const TYPE_GLOSSARY = 'glossary';
  294. public const TYPE_NOTE = 'note';
  295. public const TYPE_COMMENTARY = 'commentary';
  296. public const TYPE_ASSESSMENT = 'assessment';
  297. /**
  298. * Gets allowable values of the enum
  299. *
  300. * @return string[]
  301. */
  302. public function getTargetTypeAllowableValues()
  303. {
  304. return [
  305. self::TARGET_TYPE_SENTENCE,
  306. self::TARGET_TYPE_WBW,
  307. self::TARGET_TYPE_ARTICLE,
  308. self::TARGET_TYPE_TERM,
  309. self::TARGET_TYPE_TASK,
  310. ];
  311. }
  312. /**
  313. * Gets allowable values of the enum
  314. *
  315. * @return string[]
  316. */
  317. public function getTypeAllowableValues()
  318. {
  319. return [
  320. self::TYPE_DISCUSSION,
  321. self::TYPE_QA,
  322. self::TYPE_HELP,
  323. self::TYPE_ISSUE,
  324. self::TYPE_GLOSSARY,
  325. self::TYPE_NOTE,
  326. self::TYPE_COMMENTARY,
  327. self::TYPE_ASSESSMENT,
  328. ];
  329. }
  330. /**
  331. * Associative array for storing property values
  332. *
  333. * @var mixed[]
  334. */
  335. protected $container = [];
  336. /**
  337. * Constructor
  338. *
  339. * @param mixed[]|null $data Associated array of property values
  340. * initializing the model
  341. */
  342. public function __construct(?array $data = null)
  343. {
  344. $this->setIfExists('target_type', $data ?? [], null);
  345. $this->setIfExists('target_id', $data ?? [], null);
  346. $this->setIfExists('type', $data ?? [], 'discussion');
  347. $this->setIfExists('title', $data ?? [], null);
  348. $this->setIfExists('content', $data ?? [], null);
  349. $this->setIfExists('severity', $data ?? [], null);
  350. $this->setIfExists('score', $data ?? [], null);
  351. $this->setIfExists('pos_start', $data ?? [], null);
  352. $this->setIfExists('pos_end', $data ?? [], null);
  353. $this->setIfExists('quote_exact', $data ?? [], null);
  354. $this->setIfExists('quote_prefix', $data ?? [], null);
  355. $this->setIfExists('quote_suffix', $data ?? [], null);
  356. $this->setIfExists('tpl_id', $data ?? [], null);
  357. $this->setIfExists('notify', $data ?? [], true);
  358. }
  359. /**
  360. * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
  361. * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
  362. * $this->openAPINullablesSetToNull array
  363. *
  364. * @param string $variableName
  365. * @param array $fields
  366. * @param mixed $defaultValue
  367. */
  368. private function setIfExists(string $variableName, array $fields, $defaultValue): void
  369. {
  370. if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
  371. $this->openAPINullablesSetToNull[] = $variableName;
  372. }
  373. $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
  374. }
  375. /**
  376. * Show all the invalid properties with reasons.
  377. *
  378. * @return array invalid properties with reasons
  379. */
  380. public function listInvalidProperties()
  381. {
  382. $invalidProperties = [];
  383. if ($this->container['target_type'] === null) {
  384. $invalidProperties[] = "'target_type' can't be null";
  385. }
  386. $allowedValues = $this->getTargetTypeAllowableValues();
  387. if (!is_null($this->container['target_type']) && !in_array($this->container['target_type'], $allowedValues, true)) {
  388. $invalidProperties[] = sprintf(
  389. "invalid value '%s' for 'target_type', must be one of '%s'",
  390. $this->container['target_type'],
  391. implode("', '", $allowedValues)
  392. );
  393. }
  394. if ($this->container['target_id'] === null) {
  395. $invalidProperties[] = "'target_id' can't be null";
  396. }
  397. $allowedValues = $this->getTypeAllowableValues();
  398. if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
  399. $invalidProperties[] = sprintf(
  400. "invalid value '%s' for 'type', must be one of '%s'",
  401. $this->container['type'],
  402. implode("', '", $allowedValues)
  403. );
  404. }
  405. return $invalidProperties;
  406. }
  407. /**
  408. * Validate all the properties in the model
  409. * return true if all passed
  410. *
  411. * @return bool True if all properties are valid
  412. */
  413. public function valid()
  414. {
  415. return count($this->listInvalidProperties()) === 0;
  416. }
  417. /**
  418. * Gets target_type
  419. *
  420. * @return string
  421. */
  422. public function getTargetType()
  423. {
  424. return $this->container['target_type'];
  425. }
  426. /**
  427. * Sets target_type
  428. *
  429. * @param string $target_type 挂靠对象的类型
  430. *
  431. * @return self
  432. */
  433. public function setTargetType($target_type)
  434. {
  435. if (is_null($target_type)) {
  436. throw new \InvalidArgumentException('non-nullable target_type cannot be null');
  437. }
  438. $allowedValues = $this->getTargetTypeAllowableValues();
  439. if (!in_array($target_type, $allowedValues, true)) {
  440. throw new \InvalidArgumentException(
  441. sprintf(
  442. "Invalid value '%s' for 'target_type', must be one of '%s'",
  443. $target_type,
  444. implode("', '", $allowedValues)
  445. )
  446. );
  447. }
  448. $this->container['target_type'] = $target_type;
  449. return $this;
  450. }
  451. /**
  452. * Gets target_id
  453. *
  454. * @return string
  455. */
  456. public function getTargetId()
  457. {
  458. return $this->container['target_id'];
  459. }
  460. /**
  461. * Sets target_id
  462. *
  463. * @param string $target_id 挂靠对象的 uuid
  464. *
  465. * @return self
  466. */
  467. public function setTargetId($target_id)
  468. {
  469. if (is_null($target_id)) {
  470. throw new \InvalidArgumentException('non-nullable target_id cannot be null');
  471. }
  472. $this->container['target_id'] = $target_id;
  473. return $this;
  474. }
  475. /**
  476. * Gets type
  477. *
  478. * @return string|null
  479. */
  480. public function getType()
  481. {
  482. return $this->container['type'];
  483. }
  484. /**
  485. * Sets type
  486. *
  487. * @param string|null $type 类型
  488. *
  489. * @return self
  490. */
  491. public function setType($type)
  492. {
  493. if (is_null($type)) {
  494. throw new \InvalidArgumentException('non-nullable type cannot be null');
  495. }
  496. $allowedValues = $this->getTypeAllowableValues();
  497. if (!in_array($type, $allowedValues, true)) {
  498. throw new \InvalidArgumentException(
  499. sprintf(
  500. "Invalid value '%s' for 'type', must be one of '%s'",
  501. $type,
  502. implode("', '", $allowedValues)
  503. )
  504. );
  505. }
  506. $this->container['type'] = $type;
  507. return $this;
  508. }
  509. /**
  510. * Gets title
  511. *
  512. * @return string|null
  513. */
  514. public function getTitle()
  515. {
  516. return $this->container['title'];
  517. }
  518. /**
  519. * Sets title
  520. *
  521. * @param string|null $title 标题,最长 256 字符;评论线程必填(glossary 填术语词头),批注与评估可省
  522. *
  523. * @return self
  524. */
  525. public function setTitle($title)
  526. {
  527. if (is_null($title)) {
  528. throw new \InvalidArgumentException('non-nullable title cannot be null');
  529. }
  530. $this->container['title'] = $title;
  531. return $this;
  532. }
  533. /**
  534. * Gets content
  535. *
  536. * @return string|null
  537. */
  538. public function getContent()
  539. {
  540. return $this->container['content'];
  541. }
  542. /**
  543. * Sets content
  544. *
  545. * @param string|null $content 正文(markdown);批注必填,评估写打分理由
  546. *
  547. * @return self
  548. */
  549. public function setContent($content)
  550. {
  551. if (is_null($content)) {
  552. throw new \InvalidArgumentException('non-nullable content cannot be null');
  553. }
  554. $this->container['content'] = $content;
  555. return $this;
  556. }
  557. /**
  558. * Gets severity
  559. *
  560. * @return string|null
  561. */
  562. public function getSeverity()
  563. {
  564. return $this->container['severity'];
  565. }
  566. /**
  567. * Sets severity
  568. *
  569. * @param string|null $severity 严重程度:issue 为 error / warning / suggestion,help 为 urgent / normal;assessment 必填,填评估方法(1–16 位字母数字 . _ -)
  570. *
  571. * @return self
  572. */
  573. public function setSeverity($severity)
  574. {
  575. if (is_null($severity)) {
  576. throw new \InvalidArgumentException('non-nullable severity cannot be null');
  577. }
  578. $this->container['severity'] = $severity;
  579. return $this;
  580. }
  581. /**
  582. * Gets score
  583. *
  584. * @return float|null
  585. */
  586. public function getScore()
  587. {
  588. return $this->container['score'];
  589. }
  590. /**
  591. * Sets score
  592. *
  593. * @param float|null $score 评估分数 0–100(只限且必填于 assessment)
  594. *
  595. * @return self
  596. */
  597. public function setScore($score)
  598. {
  599. if (is_null($score)) {
  600. throw new \InvalidArgumentException('non-nullable score cannot be null');
  601. }
  602. $this->container['score'] = $score;
  603. return $this;
  604. }
  605. /**
  606. * Gets pos_start
  607. *
  608. * @return int|null
  609. */
  610. public function getPosStart()
  611. {
  612. return $this->container['pos_start'];
  613. }
  614. /**
  615. * Sets pos_start
  616. *
  617. * @param int|null $pos_start 锚点在句子文本中的起始偏移(只限 note / commentary / issue / glossary)
  618. *
  619. * @return self
  620. */
  621. public function setPosStart($pos_start)
  622. {
  623. if (is_null($pos_start)) {
  624. throw new \InvalidArgumentException('non-nullable pos_start cannot be null');
  625. }
  626. $this->container['pos_start'] = $pos_start;
  627. return $this;
  628. }
  629. /**
  630. * Gets pos_end
  631. *
  632. * @return int|null
  633. */
  634. public function getPosEnd()
  635. {
  636. return $this->container['pos_end'];
  637. }
  638. /**
  639. * Sets pos_end
  640. *
  641. * @param int|null $pos_end 锚点的结束偏移,批注插在这里(只限 note / commentary / issue / glossary)
  642. *
  643. * @return self
  644. */
  645. public function setPosEnd($pos_end)
  646. {
  647. if (is_null($pos_end)) {
  648. throw new \InvalidArgumentException('non-nullable pos_end cannot be null');
  649. }
  650. $this->container['pos_end'] = $pos_end;
  651. return $this;
  652. }
  653. /**
  654. * Gets quote_exact
  655. *
  656. * @return string|null
  657. */
  658. public function getQuoteExact()
  659. {
  660. return $this->container['quote_exact'];
  661. }
  662. /**
  663. * Sets quote_exact
  664. *
  665. * @param string|null $quote_exact 锚定的原文片段(只限 note / commentary / issue / glossary)
  666. *
  667. * @return self
  668. */
  669. public function setQuoteExact($quote_exact)
  670. {
  671. if (is_null($quote_exact)) {
  672. throw new \InvalidArgumentException('non-nullable quote_exact cannot be null');
  673. }
  674. $this->container['quote_exact'] = $quote_exact;
  675. return $this;
  676. }
  677. /**
  678. * Gets quote_prefix
  679. *
  680. * @return string|null
  681. */
  682. public function getQuotePrefix()
  683. {
  684. return $this->container['quote_prefix'];
  685. }
  686. /**
  687. * Sets quote_prefix
  688. *
  689. * @param string|null $quote_prefix 锚定片段前的上下文,用于重新定位(只限 note / commentary / issue / glossary)
  690. *
  691. * @return self
  692. */
  693. public function setQuotePrefix($quote_prefix)
  694. {
  695. if (is_null($quote_prefix)) {
  696. throw new \InvalidArgumentException('non-nullable quote_prefix cannot be null');
  697. }
  698. $this->container['quote_prefix'] = $quote_prefix;
  699. return $this;
  700. }
  701. /**
  702. * Gets quote_suffix
  703. *
  704. * @return string|null
  705. */
  706. public function getQuoteSuffix()
  707. {
  708. return $this->container['quote_suffix'];
  709. }
  710. /**
  711. * Sets quote_suffix
  712. *
  713. * @param string|null $quote_suffix 锚定片段后的上下文,用于重新定位(只限 note / commentary / issue / glossary)
  714. *
  715. * @return self
  716. */
  717. public function setQuoteSuffix($quote_suffix)
  718. {
  719. if (is_null($quote_suffix)) {
  720. throw new \InvalidArgumentException('non-nullable quote_suffix cannot be null');
  721. }
  722. $this->container['quote_suffix'] = $quote_suffix;
  723. return $this;
  724. }
  725. /**
  726. * Gets tpl_id
  727. *
  728. * @return string|null
  729. */
  730. public function getTplId()
  731. {
  732. return $this->container['tpl_id'];
  733. }
  734. /**
  735. * Sets tpl_id
  736. *
  737. * @param string|null $tpl_id 话题模板(文章)的 uuid
  738. *
  739. * @return self
  740. */
  741. public function setTplId($tpl_id)
  742. {
  743. if (is_null($tpl_id)) {
  744. throw new \InvalidArgumentException('non-nullable tpl_id cannot be null');
  745. }
  746. $this->container['tpl_id'] = $tpl_id;
  747. return $this;
  748. }
  749. /**
  750. * Gets notify
  751. *
  752. * @return bool|null
  753. */
  754. public function getNotify()
  755. {
  756. return $this->container['notify'];
  757. }
  758. /**
  759. * Sets notify
  760. *
  761. * @param bool|null $notify 是否发通知(批注不发)
  762. *
  763. * @return self
  764. */
  765. public function setNotify($notify)
  766. {
  767. if (is_null($notify)) {
  768. throw new \InvalidArgumentException('non-nullable notify cannot be null');
  769. }
  770. $this->container['notify'] = $notify;
  771. return $this;
  772. }
  773. /**
  774. * Returns true if offset exists. False otherwise.
  775. *
  776. * @param integer|string $offset Offset
  777. *
  778. * @return boolean
  779. */
  780. public function offsetExists(mixed $offset): bool
  781. {
  782. return isset($this->container[$offset]);
  783. }
  784. /**
  785. * Gets offset.
  786. *
  787. * @param integer|string $offset Offset
  788. *
  789. * @return mixed|null
  790. */
  791. #[\ReturnTypeWillChange]
  792. public function offsetGet(mixed $offset)
  793. {
  794. return $this->container[$offset] ?? null;
  795. }
  796. /**
  797. * Sets value based on offset.
  798. *
  799. * @param int|null $offset Offset
  800. * @param mixed $value Value to be set
  801. *
  802. * @return void
  803. */
  804. public function offsetSet($offset, $value): void
  805. {
  806. if (is_null($offset)) {
  807. $this->container[] = $value;
  808. } else {
  809. $this->container[$offset] = $value;
  810. }
  811. }
  812. /**
  813. * Unsets offset.
  814. *
  815. * @param integer|string $offset Offset
  816. *
  817. * @return void
  818. */
  819. public function offsetUnset(mixed $offset): void
  820. {
  821. unset($this->container[$offset]);
  822. }
  823. /**
  824. * Serializes the object to a value that can be serialized natively by json_encode().
  825. * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
  826. *
  827. * @return mixed Returns data which can be serialized by json_encode(), which is a value
  828. * of any type other than a resource.
  829. */
  830. #[\ReturnTypeWillChange]
  831. public function jsonSerialize()
  832. {
  833. return ObjectSerializer::sanitizeForSerialization($this);
  834. }
  835. /**
  836. * Gets the string presentation of the object
  837. *
  838. * @return string
  839. */
  840. public function __toString()
  841. {
  842. return json_encode(
  843. ObjectSerializer::sanitizeForSerialization($this),
  844. JSON_PRETTY_PRINT
  845. );
  846. }
  847. /**
  848. * Gets a header-safe presentation of the object
  849. *
  850. * @return string
  851. */
  852. public function toHeaderValue()
  853. {
  854. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  855. }
  856. }