GetApiV3ChannelsChannelTerms200ResponseDataInner.php 32 KB

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