GetApiV3MeAgentThreads200ResponseDataInnerRunsInner.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. <?php
  2. /**
  3. * GetApiV3MeAgentThreads200ResponseDataInnerRunsInner
  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.11.12
  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. * GetApiV3MeAgentThreads200ResponseDataInnerRunsInner 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 GetApiV3MeAgentThreads200ResponseDataInnerRunsInner 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_me_agent_threads_200_response_data_inner_runs_inner';
  47. /**
  48. * Array of property to type mappings. Used for (de)serialization
  49. *
  50. * @var string[]
  51. */
  52. protected static $openAPITypes = [
  53. 'run_id' => 'string',
  54. 'question' => 'string',
  55. 'answer' => 'string',
  56. 'citations' => 'object[]',
  57. 'deep' => 'bool',
  58. 'status' => 'string',
  59. 'user_message_id' => 'string',
  60. 'assistant_message_id' => 'string',
  61. 'created_at' => 'string'
  62. ];
  63. /**
  64. * Array of property to format mappings. Used for (de)serialization
  65. *
  66. * @var string[]
  67. * @phpstan-var array<string, string|null>
  68. * @psalm-var array<string, string|null>
  69. */
  70. protected static $openAPIFormats = [
  71. 'run_id' => null,
  72. 'question' => null,
  73. 'answer' => null,
  74. 'citations' => null,
  75. 'deep' => null,
  76. 'status' => null,
  77. 'user_message_id' => null,
  78. 'assistant_message_id' => null,
  79. 'created_at' => null
  80. ];
  81. /**
  82. * Array of nullable properties. Used for (de)serialization
  83. *
  84. * @var boolean[]
  85. */
  86. protected static array $openAPINullables = [
  87. 'run_id' => false,
  88. 'question' => false,
  89. 'answer' => true,
  90. 'citations' => true,
  91. 'deep' => false,
  92. 'status' => false,
  93. 'user_message_id' => true,
  94. 'assistant_message_id' => true,
  95. 'created_at' => false
  96. ];
  97. /**
  98. * If a nullable field gets set to null, insert it here
  99. *
  100. * @var boolean[]
  101. */
  102. protected array $openAPINullablesSetToNull = [];
  103. /**
  104. * Array of property to type mappings. Used for (de)serialization
  105. *
  106. * @return array
  107. */
  108. public static function openAPITypes()
  109. {
  110. return self::$openAPITypes;
  111. }
  112. /**
  113. * Array of property to format mappings. Used for (de)serialization
  114. *
  115. * @return array
  116. */
  117. public static function openAPIFormats()
  118. {
  119. return self::$openAPIFormats;
  120. }
  121. /**
  122. * Array of nullable properties
  123. *
  124. * @return array
  125. */
  126. protected static function openAPINullables(): array
  127. {
  128. return self::$openAPINullables;
  129. }
  130. /**
  131. * Array of nullable field names deliberately set to null
  132. *
  133. * @return boolean[]
  134. */
  135. private function getOpenAPINullablesSetToNull(): array
  136. {
  137. return $this->openAPINullablesSetToNull;
  138. }
  139. /**
  140. * Setter - Array of nullable field names deliberately set to null
  141. *
  142. * @param boolean[] $openAPINullablesSetToNull
  143. */
  144. private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
  145. {
  146. $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
  147. }
  148. /**
  149. * Checks if a property is nullable
  150. *
  151. * @param string $property
  152. * @return bool
  153. */
  154. public static function isNullable(string $property): bool
  155. {
  156. return self::openAPINullables()[$property] ?? false;
  157. }
  158. /**
  159. * Checks if a nullable property is set to null.
  160. *
  161. * @param string $property
  162. * @return bool
  163. */
  164. public function isNullableSetToNull(string $property): bool
  165. {
  166. return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
  167. }
  168. /**
  169. * Array of attributes where the key is the local name,
  170. * and the value is the original name
  171. *
  172. * @var string[]
  173. */
  174. protected static $attributeMap = [
  175. 'run_id' => 'run_id',
  176. 'question' => 'question',
  177. 'answer' => 'answer',
  178. 'citations' => 'citations',
  179. 'deep' => 'deep',
  180. 'status' => 'status',
  181. 'user_message_id' => 'user_message_id',
  182. 'assistant_message_id' => 'assistant_message_id',
  183. 'created_at' => 'created_at'
  184. ];
  185. /**
  186. * Array of attributes to setter functions (for deserialization of responses)
  187. *
  188. * @var string[]
  189. */
  190. protected static $setters = [
  191. 'run_id' => 'setRunId',
  192. 'question' => 'setQuestion',
  193. 'answer' => 'setAnswer',
  194. 'citations' => 'setCitations',
  195. 'deep' => 'setDeep',
  196. 'status' => 'setStatus',
  197. 'user_message_id' => 'setUserMessageId',
  198. 'assistant_message_id' => 'setAssistantMessageId',
  199. 'created_at' => 'setCreatedAt'
  200. ];
  201. /**
  202. * Array of attributes to getter functions (for serialization of requests)
  203. *
  204. * @var string[]
  205. */
  206. protected static $getters = [
  207. 'run_id' => 'getRunId',
  208. 'question' => 'getQuestion',
  209. 'answer' => 'getAnswer',
  210. 'citations' => 'getCitations',
  211. 'deep' => 'getDeep',
  212. 'status' => 'getStatus',
  213. 'user_message_id' => 'getUserMessageId',
  214. 'assistant_message_id' => 'getAssistantMessageId',
  215. 'created_at' => 'getCreatedAt'
  216. ];
  217. /**
  218. * Array of attributes where the key is the local name,
  219. * and the value is the original name
  220. *
  221. * @return array
  222. */
  223. public static function attributeMap()
  224. {
  225. return self::$attributeMap;
  226. }
  227. /**
  228. * Array of attributes to setter functions (for deserialization of responses)
  229. *
  230. * @return array
  231. */
  232. public static function setters()
  233. {
  234. return self::$setters;
  235. }
  236. /**
  237. * Array of attributes to getter functions (for serialization of requests)
  238. *
  239. * @return array
  240. */
  241. public static function getters()
  242. {
  243. return self::$getters;
  244. }
  245. /**
  246. * The original name of the model.
  247. *
  248. * @return string
  249. */
  250. public function getModelName()
  251. {
  252. return self::$openAPIModelName;
  253. }
  254. /**
  255. * Associative array for storing property values
  256. *
  257. * @var mixed[]
  258. */
  259. protected $container = [];
  260. /**
  261. * Constructor
  262. *
  263. * @param mixed[]|null $data Associated array of property values
  264. * initializing the model
  265. */
  266. public function __construct(?array $data = null)
  267. {
  268. $this->setIfExists('run_id', $data ?? [], null);
  269. $this->setIfExists('question', $data ?? [], null);
  270. $this->setIfExists('answer', $data ?? [], null);
  271. $this->setIfExists('citations', $data ?? [], null);
  272. $this->setIfExists('deep', $data ?? [], null);
  273. $this->setIfExists('status', $data ?? [], null);
  274. $this->setIfExists('user_message_id', $data ?? [], null);
  275. $this->setIfExists('assistant_message_id', $data ?? [], null);
  276. $this->setIfExists('created_at', $data ?? [], null);
  277. }
  278. /**
  279. * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
  280. * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
  281. * $this->openAPINullablesSetToNull array
  282. *
  283. * @param string $variableName
  284. * @param array $fields
  285. * @param mixed $defaultValue
  286. */
  287. private function setIfExists(string $variableName, array $fields, $defaultValue): void
  288. {
  289. if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
  290. $this->openAPINullablesSetToNull[] = $variableName;
  291. }
  292. $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
  293. }
  294. /**
  295. * Show all the invalid properties with reasons.
  296. *
  297. * @return array invalid properties with reasons
  298. */
  299. public function listInvalidProperties()
  300. {
  301. $invalidProperties = [];
  302. return $invalidProperties;
  303. }
  304. /**
  305. * Validate all the properties in the model
  306. * return true if all passed
  307. *
  308. * @return bool True if all properties are valid
  309. */
  310. public function valid()
  311. {
  312. return count($this->listInvalidProperties()) === 0;
  313. }
  314. /**
  315. * Gets run_id
  316. *
  317. * @return string|null
  318. */
  319. public function getRunId()
  320. {
  321. return $this->container['run_id'];
  322. }
  323. /**
  324. * Sets run_id
  325. *
  326. * @param string|null $run_id run_id
  327. *
  328. * @return self
  329. */
  330. public function setRunId($run_id)
  331. {
  332. if (is_null($run_id)) {
  333. throw new \InvalidArgumentException('non-nullable run_id cannot be null');
  334. }
  335. $this->container['run_id'] = $run_id;
  336. return $this;
  337. }
  338. /**
  339. * Gets question
  340. *
  341. * @return string|null
  342. */
  343. public function getQuestion()
  344. {
  345. return $this->container['question'];
  346. }
  347. /**
  348. * Sets question
  349. *
  350. * @param string|null $question question
  351. *
  352. * @return self
  353. */
  354. public function setQuestion($question)
  355. {
  356. if (is_null($question)) {
  357. throw new \InvalidArgumentException('non-nullable question cannot be null');
  358. }
  359. $this->container['question'] = $question;
  360. return $this;
  361. }
  362. /**
  363. * Gets answer
  364. *
  365. * @return string|null
  366. */
  367. public function getAnswer()
  368. {
  369. return $this->container['answer'];
  370. }
  371. /**
  372. * Sets answer
  373. *
  374. * @param string|null $answer answer
  375. *
  376. * @return self
  377. */
  378. public function setAnswer($answer)
  379. {
  380. if (is_null($answer)) {
  381. array_push($this->openAPINullablesSetToNull, 'answer');
  382. } else {
  383. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  384. $index = array_search('answer', $nullablesSetToNull);
  385. if ($index !== FALSE) {
  386. unset($nullablesSetToNull[$index]);
  387. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  388. }
  389. }
  390. $this->container['answer'] = $answer;
  391. return $this;
  392. }
  393. /**
  394. * Gets citations
  395. *
  396. * @return object[]|null
  397. */
  398. public function getCitations()
  399. {
  400. return $this->container['citations'];
  401. }
  402. /**
  403. * Sets citations
  404. *
  405. * @param object[]|null $citations citations
  406. *
  407. * @return self
  408. */
  409. public function setCitations($citations)
  410. {
  411. if (is_null($citations)) {
  412. array_push($this->openAPINullablesSetToNull, 'citations');
  413. } else {
  414. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  415. $index = array_search('citations', $nullablesSetToNull);
  416. if ($index !== FALSE) {
  417. unset($nullablesSetToNull[$index]);
  418. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  419. }
  420. }
  421. $this->container['citations'] = $citations;
  422. return $this;
  423. }
  424. /**
  425. * Gets deep
  426. *
  427. * @return bool|null
  428. */
  429. public function getDeep()
  430. {
  431. return $this->container['deep'];
  432. }
  433. /**
  434. * Sets deep
  435. *
  436. * @param bool|null $deep deep
  437. *
  438. * @return self
  439. */
  440. public function setDeep($deep)
  441. {
  442. if (is_null($deep)) {
  443. throw new \InvalidArgumentException('non-nullable deep cannot be null');
  444. }
  445. $this->container['deep'] = $deep;
  446. return $this;
  447. }
  448. /**
  449. * Gets status
  450. *
  451. * @return string|null
  452. */
  453. public function getStatus()
  454. {
  455. return $this->container['status'];
  456. }
  457. /**
  458. * Sets status
  459. *
  460. * @param string|null $status status
  461. *
  462. * @return self
  463. */
  464. public function setStatus($status)
  465. {
  466. if (is_null($status)) {
  467. throw new \InvalidArgumentException('non-nullable status cannot be null');
  468. }
  469. $this->container['status'] = $status;
  470. return $this;
  471. }
  472. /**
  473. * Gets user_message_id
  474. *
  475. * @return string|null
  476. */
  477. public function getUserMessageId()
  478. {
  479. return $this->container['user_message_id'];
  480. }
  481. /**
  482. * Sets user_message_id
  483. *
  484. * @param string|null $user_message_id user_message_id
  485. *
  486. * @return self
  487. */
  488. public function setUserMessageId($user_message_id)
  489. {
  490. if (is_null($user_message_id)) {
  491. array_push($this->openAPINullablesSetToNull, 'user_message_id');
  492. } else {
  493. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  494. $index = array_search('user_message_id', $nullablesSetToNull);
  495. if ($index !== FALSE) {
  496. unset($nullablesSetToNull[$index]);
  497. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  498. }
  499. }
  500. $this->container['user_message_id'] = $user_message_id;
  501. return $this;
  502. }
  503. /**
  504. * Gets assistant_message_id
  505. *
  506. * @return string|null
  507. */
  508. public function getAssistantMessageId()
  509. {
  510. return $this->container['assistant_message_id'];
  511. }
  512. /**
  513. * Sets assistant_message_id
  514. *
  515. * @param string|null $assistant_message_id assistant_message_id
  516. *
  517. * @return self
  518. */
  519. public function setAssistantMessageId($assistant_message_id)
  520. {
  521. if (is_null($assistant_message_id)) {
  522. array_push($this->openAPINullablesSetToNull, 'assistant_message_id');
  523. } else {
  524. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  525. $index = array_search('assistant_message_id', $nullablesSetToNull);
  526. if ($index !== FALSE) {
  527. unset($nullablesSetToNull[$index]);
  528. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  529. }
  530. }
  531. $this->container['assistant_message_id'] = $assistant_message_id;
  532. return $this;
  533. }
  534. /**
  535. * Gets created_at
  536. *
  537. * @return string|null
  538. */
  539. public function getCreatedAt()
  540. {
  541. return $this->container['created_at'];
  542. }
  543. /**
  544. * Sets created_at
  545. *
  546. * @param string|null $created_at created_at
  547. *
  548. * @return self
  549. */
  550. public function setCreatedAt($created_at)
  551. {
  552. if (is_null($created_at)) {
  553. throw new \InvalidArgumentException('non-nullable created_at cannot be null');
  554. }
  555. $this->container['created_at'] = $created_at;
  556. return $this;
  557. }
  558. /**
  559. * Returns true if offset exists. False otherwise.
  560. *
  561. * @param integer|string $offset Offset
  562. *
  563. * @return boolean
  564. */
  565. public function offsetExists(mixed $offset): bool
  566. {
  567. return isset($this->container[$offset]);
  568. }
  569. /**
  570. * Gets offset.
  571. *
  572. * @param integer|string $offset Offset
  573. *
  574. * @return mixed|null
  575. */
  576. #[\ReturnTypeWillChange]
  577. public function offsetGet(mixed $offset)
  578. {
  579. return $this->container[$offset] ?? null;
  580. }
  581. /**
  582. * Sets value based on offset.
  583. *
  584. * @param int|null $offset Offset
  585. * @param mixed $value Value to be set
  586. *
  587. * @return void
  588. */
  589. public function offsetSet($offset, $value): void
  590. {
  591. if (is_null($offset)) {
  592. $this->container[] = $value;
  593. } else {
  594. $this->container[$offset] = $value;
  595. }
  596. }
  597. /**
  598. * Unsets offset.
  599. *
  600. * @param integer|string $offset Offset
  601. *
  602. * @return void
  603. */
  604. public function offsetUnset(mixed $offset): void
  605. {
  606. unset($this->container[$offset]);
  607. }
  608. /**
  609. * Serializes the object to a value that can be serialized natively by json_encode().
  610. * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
  611. *
  612. * @return mixed Returns data which can be serialized by json_encode(), which is a value
  613. * of any type other than a resource.
  614. */
  615. #[\ReturnTypeWillChange]
  616. public function jsonSerialize()
  617. {
  618. return ObjectSerializer::sanitizeForSerialization($this);
  619. }
  620. /**
  621. * Gets the string presentation of the object
  622. *
  623. * @return string
  624. */
  625. public function __toString()
  626. {
  627. return json_encode(
  628. ObjectSerializer::sanitizeForSerialization($this),
  629. JSON_PRETTY_PRINT
  630. );
  631. }
  632. /**
  633. * Gets a header-safe presentation of the object
  634. *
  635. * @return string
  636. */
  637. public function toHeaderValue()
  638. {
  639. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  640. }
  641. }