GetApiV3AdminAgentRuns200ResponseDataInnerStepsInner.php 19 KB

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