GetApiV3AdminAgentStats200ResponseDataSummary.php 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. <?php
  2. /**
  3. * GetApiV3AdminAgentStats200ResponseDataSummary
  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. * GetApiV3AdminAgentStats200ResponseDataSummary 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 GetApiV3AdminAgentStats200ResponseDataSummary 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_stats_200_response_data_summary';
  47. /**
  48. * Array of property to type mappings. Used for (de)serialization
  49. *
  50. * @var string[]
  51. */
  52. protected static $openAPITypes = [
  53. 'runs' => 'int',
  54. 'deep' => 'int',
  55. 'passage' => 'int',
  56. 'denied' => 'int',
  57. 'errors' => 'int',
  58. 'cancelled' => 'int',
  59. 'unchecked' => 'int',
  60. 'improve' => 'int',
  61. 'askers' => 'int',
  62. 'askers_user' => 'int',
  63. 'askers_guest' => 'int',
  64. 'latency_p50_ms' => 'int',
  65. 'latency_p95_ms' => 'int',
  66. 'tokens_in' => 'int',
  67. 'tokens_out' => 'int',
  68. 'feedback_up' => 'int',
  69. 'feedback_down' => 'int',
  70. 'feedback_asked' => 'int'
  71. ];
  72. /**
  73. * Array of property to format mappings. Used for (de)serialization
  74. *
  75. * @var string[]
  76. * @phpstan-var array<string, string|null>
  77. * @psalm-var array<string, string|null>
  78. */
  79. protected static $openAPIFormats = [
  80. 'runs' => null,
  81. 'deep' => null,
  82. 'passage' => null,
  83. 'denied' => null,
  84. 'errors' => null,
  85. 'cancelled' => null,
  86. 'unchecked' => null,
  87. 'improve' => null,
  88. 'askers' => null,
  89. 'askers_user' => null,
  90. 'askers_guest' => null,
  91. 'latency_p50_ms' => null,
  92. 'latency_p95_ms' => null,
  93. 'tokens_in' => null,
  94. 'tokens_out' => null,
  95. 'feedback_up' => null,
  96. 'feedback_down' => null,
  97. 'feedback_asked' => null
  98. ];
  99. /**
  100. * Array of nullable properties. Used for (de)serialization
  101. *
  102. * @var boolean[]
  103. */
  104. protected static array $openAPINullables = [
  105. 'runs' => false,
  106. 'deep' => false,
  107. 'passage' => false,
  108. 'denied' => false,
  109. 'errors' => false,
  110. 'cancelled' => false,
  111. 'unchecked' => false,
  112. 'improve' => false,
  113. 'askers' => false,
  114. 'askers_user' => false,
  115. 'askers_guest' => false,
  116. 'latency_p50_ms' => true,
  117. 'latency_p95_ms' => true,
  118. 'tokens_in' => false,
  119. 'tokens_out' => false,
  120. 'feedback_up' => false,
  121. 'feedback_down' => false,
  122. 'feedback_asked' => false
  123. ];
  124. /**
  125. * If a nullable field gets set to null, insert it here
  126. *
  127. * @var boolean[]
  128. */
  129. protected array $openAPINullablesSetToNull = [];
  130. /**
  131. * Array of property to type mappings. Used for (de)serialization
  132. *
  133. * @return array
  134. */
  135. public static function openAPITypes()
  136. {
  137. return self::$openAPITypes;
  138. }
  139. /**
  140. * Array of property to format mappings. Used for (de)serialization
  141. *
  142. * @return array
  143. */
  144. public static function openAPIFormats()
  145. {
  146. return self::$openAPIFormats;
  147. }
  148. /**
  149. * Array of nullable properties
  150. *
  151. * @return array
  152. */
  153. protected static function openAPINullables(): array
  154. {
  155. return self::$openAPINullables;
  156. }
  157. /**
  158. * Array of nullable field names deliberately set to null
  159. *
  160. * @return boolean[]
  161. */
  162. private function getOpenAPINullablesSetToNull(): array
  163. {
  164. return $this->openAPINullablesSetToNull;
  165. }
  166. /**
  167. * Setter - Array of nullable field names deliberately set to null
  168. *
  169. * @param boolean[] $openAPINullablesSetToNull
  170. */
  171. private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
  172. {
  173. $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
  174. }
  175. /**
  176. * Checks if a property is nullable
  177. *
  178. * @param string $property
  179. * @return bool
  180. */
  181. public static function isNullable(string $property): bool
  182. {
  183. return self::openAPINullables()[$property] ?? false;
  184. }
  185. /**
  186. * Checks if a nullable property is set to null.
  187. *
  188. * @param string $property
  189. * @return bool
  190. */
  191. public function isNullableSetToNull(string $property): bool
  192. {
  193. return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
  194. }
  195. /**
  196. * Array of attributes where the key is the local name,
  197. * and the value is the original name
  198. *
  199. * @var string[]
  200. */
  201. protected static $attributeMap = [
  202. 'runs' => 'runs',
  203. 'deep' => 'deep',
  204. 'passage' => 'passage',
  205. 'denied' => 'denied',
  206. 'errors' => 'errors',
  207. 'cancelled' => 'cancelled',
  208. 'unchecked' => 'unchecked',
  209. 'improve' => 'improve',
  210. 'askers' => 'askers',
  211. 'askers_user' => 'askers_user',
  212. 'askers_guest' => 'askers_guest',
  213. 'latency_p50_ms' => 'latency_p50_ms',
  214. 'latency_p95_ms' => 'latency_p95_ms',
  215. 'tokens_in' => 'tokens_in',
  216. 'tokens_out' => 'tokens_out',
  217. 'feedback_up' => 'feedback_up',
  218. 'feedback_down' => 'feedback_down',
  219. 'feedback_asked' => 'feedback_asked'
  220. ];
  221. /**
  222. * Array of attributes to setter functions (for deserialization of responses)
  223. *
  224. * @var string[]
  225. */
  226. protected static $setters = [
  227. 'runs' => 'setRuns',
  228. 'deep' => 'setDeep',
  229. 'passage' => 'setPassage',
  230. 'denied' => 'setDenied',
  231. 'errors' => 'setErrors',
  232. 'cancelled' => 'setCancelled',
  233. 'unchecked' => 'setUnchecked',
  234. 'improve' => 'setImprove',
  235. 'askers' => 'setAskers',
  236. 'askers_user' => 'setAskersUser',
  237. 'askers_guest' => 'setAskersGuest',
  238. 'latency_p50_ms' => 'setLatencyP50Ms',
  239. 'latency_p95_ms' => 'setLatencyP95Ms',
  240. 'tokens_in' => 'setTokensIn',
  241. 'tokens_out' => 'setTokensOut',
  242. 'feedback_up' => 'setFeedbackUp',
  243. 'feedback_down' => 'setFeedbackDown',
  244. 'feedback_asked' => 'setFeedbackAsked'
  245. ];
  246. /**
  247. * Array of attributes to getter functions (for serialization of requests)
  248. *
  249. * @var string[]
  250. */
  251. protected static $getters = [
  252. 'runs' => 'getRuns',
  253. 'deep' => 'getDeep',
  254. 'passage' => 'getPassage',
  255. 'denied' => 'getDenied',
  256. 'errors' => 'getErrors',
  257. 'cancelled' => 'getCancelled',
  258. 'unchecked' => 'getUnchecked',
  259. 'improve' => 'getImprove',
  260. 'askers' => 'getAskers',
  261. 'askers_user' => 'getAskersUser',
  262. 'askers_guest' => 'getAskersGuest',
  263. 'latency_p50_ms' => 'getLatencyP50Ms',
  264. 'latency_p95_ms' => 'getLatencyP95Ms',
  265. 'tokens_in' => 'getTokensIn',
  266. 'tokens_out' => 'getTokensOut',
  267. 'feedback_up' => 'getFeedbackUp',
  268. 'feedback_down' => 'getFeedbackDown',
  269. 'feedback_asked' => 'getFeedbackAsked'
  270. ];
  271. /**
  272. * Array of attributes where the key is the local name,
  273. * and the value is the original name
  274. *
  275. * @return array
  276. */
  277. public static function attributeMap()
  278. {
  279. return self::$attributeMap;
  280. }
  281. /**
  282. * Array of attributes to setter functions (for deserialization of responses)
  283. *
  284. * @return array
  285. */
  286. public static function setters()
  287. {
  288. return self::$setters;
  289. }
  290. /**
  291. * Array of attributes to getter functions (for serialization of requests)
  292. *
  293. * @return array
  294. */
  295. public static function getters()
  296. {
  297. return self::$getters;
  298. }
  299. /**
  300. * The original name of the model.
  301. *
  302. * @return string
  303. */
  304. public function getModelName()
  305. {
  306. return self::$openAPIModelName;
  307. }
  308. /**
  309. * Associative array for storing property values
  310. *
  311. * @var mixed[]
  312. */
  313. protected $container = [];
  314. /**
  315. * Constructor
  316. *
  317. * @param mixed[]|null $data Associated array of property values
  318. * initializing the model
  319. */
  320. public function __construct(?array $data = null)
  321. {
  322. $this->setIfExists('runs', $data ?? [], null);
  323. $this->setIfExists('deep', $data ?? [], null);
  324. $this->setIfExists('passage', $data ?? [], null);
  325. $this->setIfExists('denied', $data ?? [], null);
  326. $this->setIfExists('errors', $data ?? [], null);
  327. $this->setIfExists('cancelled', $data ?? [], null);
  328. $this->setIfExists('unchecked', $data ?? [], null);
  329. $this->setIfExists('improve', $data ?? [], null);
  330. $this->setIfExists('askers', $data ?? [], null);
  331. $this->setIfExists('askers_user', $data ?? [], null);
  332. $this->setIfExists('askers_guest', $data ?? [], null);
  333. $this->setIfExists('latency_p50_ms', $data ?? [], null);
  334. $this->setIfExists('latency_p95_ms', $data ?? [], null);
  335. $this->setIfExists('tokens_in', $data ?? [], null);
  336. $this->setIfExists('tokens_out', $data ?? [], null);
  337. $this->setIfExists('feedback_up', $data ?? [], null);
  338. $this->setIfExists('feedback_down', $data ?? [], null);
  339. $this->setIfExists('feedback_asked', $data ?? [], null);
  340. }
  341. /**
  342. * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
  343. * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
  344. * $this->openAPINullablesSetToNull array
  345. *
  346. * @param string $variableName
  347. * @param array $fields
  348. * @param mixed $defaultValue
  349. */
  350. private function setIfExists(string $variableName, array $fields, $defaultValue): void
  351. {
  352. if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
  353. $this->openAPINullablesSetToNull[] = $variableName;
  354. }
  355. $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
  356. }
  357. /**
  358. * Show all the invalid properties with reasons.
  359. *
  360. * @return array invalid properties with reasons
  361. */
  362. public function listInvalidProperties()
  363. {
  364. $invalidProperties = [];
  365. return $invalidProperties;
  366. }
  367. /**
  368. * Validate all the properties in the model
  369. * return true if all passed
  370. *
  371. * @return bool True if all properties are valid
  372. */
  373. public function valid()
  374. {
  375. return count($this->listInvalidProperties()) === 0;
  376. }
  377. /**
  378. * Gets runs
  379. *
  380. * @return int|null
  381. */
  382. public function getRuns()
  383. {
  384. return $this->container['runs'];
  385. }
  386. /**
  387. * Sets runs
  388. *
  389. * @param int|null $runs runs
  390. *
  391. * @return self
  392. */
  393. public function setRuns($runs)
  394. {
  395. if (is_null($runs)) {
  396. throw new \InvalidArgumentException('non-nullable runs cannot be null');
  397. }
  398. $this->container['runs'] = $runs;
  399. return $this;
  400. }
  401. /**
  402. * Gets deep
  403. *
  404. * @return int|null
  405. */
  406. public function getDeep()
  407. {
  408. return $this->container['deep'];
  409. }
  410. /**
  411. * Sets deep
  412. *
  413. * @param int|null $deep deep
  414. *
  415. * @return self
  416. */
  417. public function setDeep($deep)
  418. {
  419. if (is_null($deep)) {
  420. throw new \InvalidArgumentException('non-nullable deep cannot be null');
  421. }
  422. $this->container['deep'] = $deep;
  423. return $this;
  424. }
  425. /**
  426. * Gets passage
  427. *
  428. * @return int|null
  429. */
  430. public function getPassage()
  431. {
  432. return $this->container['passage'];
  433. }
  434. /**
  435. * Sets passage
  436. *
  437. * @param int|null $passage passage
  438. *
  439. * @return self
  440. */
  441. public function setPassage($passage)
  442. {
  443. if (is_null($passage)) {
  444. throw new \InvalidArgumentException('non-nullable passage cannot be null');
  445. }
  446. $this->container['passage'] = $passage;
  447. return $this;
  448. }
  449. /**
  450. * Gets denied
  451. *
  452. * @return int|null
  453. */
  454. public function getDenied()
  455. {
  456. return $this->container['denied'];
  457. }
  458. /**
  459. * Sets denied
  460. *
  461. * @param int|null $denied denied
  462. *
  463. * @return self
  464. */
  465. public function setDenied($denied)
  466. {
  467. if (is_null($denied)) {
  468. throw new \InvalidArgumentException('non-nullable denied cannot be null');
  469. }
  470. $this->container['denied'] = $denied;
  471. return $this;
  472. }
  473. /**
  474. * Gets errors
  475. *
  476. * @return int|null
  477. */
  478. public function getErrors()
  479. {
  480. return $this->container['errors'];
  481. }
  482. /**
  483. * Sets errors
  484. *
  485. * @param int|null $errors errors
  486. *
  487. * @return self
  488. */
  489. public function setErrors($errors)
  490. {
  491. if (is_null($errors)) {
  492. throw new \InvalidArgumentException('non-nullable errors cannot be null');
  493. }
  494. $this->container['errors'] = $errors;
  495. return $this;
  496. }
  497. /**
  498. * Gets cancelled
  499. *
  500. * @return int|null
  501. */
  502. public function getCancelled()
  503. {
  504. return $this->container['cancelled'];
  505. }
  506. /**
  507. * Sets cancelled
  508. *
  509. * @param int|null $cancelled cancelled
  510. *
  511. * @return self
  512. */
  513. public function setCancelled($cancelled)
  514. {
  515. if (is_null($cancelled)) {
  516. throw new \InvalidArgumentException('non-nullable cancelled cannot be null');
  517. }
  518. $this->container['cancelled'] = $cancelled;
  519. return $this;
  520. }
  521. /**
  522. * Gets unchecked
  523. *
  524. * @return int|null
  525. */
  526. public function getUnchecked()
  527. {
  528. return $this->container['unchecked'];
  529. }
  530. /**
  531. * Sets unchecked
  532. *
  533. * @param int|null $unchecked unchecked
  534. *
  535. * @return self
  536. */
  537. public function setUnchecked($unchecked)
  538. {
  539. if (is_null($unchecked)) {
  540. throw new \InvalidArgumentException('non-nullable unchecked cannot be null');
  541. }
  542. $this->container['unchecked'] = $unchecked;
  543. return $this;
  544. }
  545. /**
  546. * Gets improve
  547. *
  548. * @return int|null
  549. */
  550. public function getImprove()
  551. {
  552. return $this->container['improve'];
  553. }
  554. /**
  555. * Sets improve
  556. *
  557. * @param int|null $improve improve
  558. *
  559. * @return self
  560. */
  561. public function setImprove($improve)
  562. {
  563. if (is_null($improve)) {
  564. throw new \InvalidArgumentException('non-nullable improve cannot be null');
  565. }
  566. $this->container['improve'] = $improve;
  567. return $this;
  568. }
  569. /**
  570. * Gets askers
  571. *
  572. * @return int|null
  573. */
  574. public function getAskers()
  575. {
  576. return $this->container['askers'];
  577. }
  578. /**
  579. * Sets askers
  580. *
  581. * @param int|null $askers askers
  582. *
  583. * @return self
  584. */
  585. public function setAskers($askers)
  586. {
  587. if (is_null($askers)) {
  588. throw new \InvalidArgumentException('non-nullable askers cannot be null');
  589. }
  590. $this->container['askers'] = $askers;
  591. return $this;
  592. }
  593. /**
  594. * Gets askers_user
  595. *
  596. * @return int|null
  597. */
  598. public function getAskersUser()
  599. {
  600. return $this->container['askers_user'];
  601. }
  602. /**
  603. * Sets askers_user
  604. *
  605. * @param int|null $askers_user askers_user
  606. *
  607. * @return self
  608. */
  609. public function setAskersUser($askers_user)
  610. {
  611. if (is_null($askers_user)) {
  612. throw new \InvalidArgumentException('non-nullable askers_user cannot be null');
  613. }
  614. $this->container['askers_user'] = $askers_user;
  615. return $this;
  616. }
  617. /**
  618. * Gets askers_guest
  619. *
  620. * @return int|null
  621. */
  622. public function getAskersGuest()
  623. {
  624. return $this->container['askers_guest'];
  625. }
  626. /**
  627. * Sets askers_guest
  628. *
  629. * @param int|null $askers_guest askers_guest
  630. *
  631. * @return self
  632. */
  633. public function setAskersGuest($askers_guest)
  634. {
  635. if (is_null($askers_guest)) {
  636. throw new \InvalidArgumentException('non-nullable askers_guest cannot be null');
  637. }
  638. $this->container['askers_guest'] = $askers_guest;
  639. return $this;
  640. }
  641. /**
  642. * Gets latency_p50_ms
  643. *
  644. * @return int|null
  645. */
  646. public function getLatencyP50Ms()
  647. {
  648. return $this->container['latency_p50_ms'];
  649. }
  650. /**
  651. * Sets latency_p50_ms
  652. *
  653. * @param int|null $latency_p50_ms latency_p50_ms
  654. *
  655. * @return self
  656. */
  657. public function setLatencyP50Ms($latency_p50_ms)
  658. {
  659. if (is_null($latency_p50_ms)) {
  660. array_push($this->openAPINullablesSetToNull, 'latency_p50_ms');
  661. } else {
  662. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  663. $index = array_search('latency_p50_ms', $nullablesSetToNull);
  664. if ($index !== FALSE) {
  665. unset($nullablesSetToNull[$index]);
  666. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  667. }
  668. }
  669. $this->container['latency_p50_ms'] = $latency_p50_ms;
  670. return $this;
  671. }
  672. /**
  673. * Gets latency_p95_ms
  674. *
  675. * @return int|null
  676. */
  677. public function getLatencyP95Ms()
  678. {
  679. return $this->container['latency_p95_ms'];
  680. }
  681. /**
  682. * Sets latency_p95_ms
  683. *
  684. * @param int|null $latency_p95_ms latency_p95_ms
  685. *
  686. * @return self
  687. */
  688. public function setLatencyP95Ms($latency_p95_ms)
  689. {
  690. if (is_null($latency_p95_ms)) {
  691. array_push($this->openAPINullablesSetToNull, 'latency_p95_ms');
  692. } else {
  693. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  694. $index = array_search('latency_p95_ms', $nullablesSetToNull);
  695. if ($index !== FALSE) {
  696. unset($nullablesSetToNull[$index]);
  697. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  698. }
  699. }
  700. $this->container['latency_p95_ms'] = $latency_p95_ms;
  701. return $this;
  702. }
  703. /**
  704. * Gets tokens_in
  705. *
  706. * @return int|null
  707. */
  708. public function getTokensIn()
  709. {
  710. return $this->container['tokens_in'];
  711. }
  712. /**
  713. * Sets tokens_in
  714. *
  715. * @param int|null $tokens_in tokens_in
  716. *
  717. * @return self
  718. */
  719. public function setTokensIn($tokens_in)
  720. {
  721. if (is_null($tokens_in)) {
  722. throw new \InvalidArgumentException('non-nullable tokens_in cannot be null');
  723. }
  724. $this->container['tokens_in'] = $tokens_in;
  725. return $this;
  726. }
  727. /**
  728. * Gets tokens_out
  729. *
  730. * @return int|null
  731. */
  732. public function getTokensOut()
  733. {
  734. return $this->container['tokens_out'];
  735. }
  736. /**
  737. * Sets tokens_out
  738. *
  739. * @param int|null $tokens_out tokens_out
  740. *
  741. * @return self
  742. */
  743. public function setTokensOut($tokens_out)
  744. {
  745. if (is_null($tokens_out)) {
  746. throw new \InvalidArgumentException('non-nullable tokens_out cannot be null');
  747. }
  748. $this->container['tokens_out'] = $tokens_out;
  749. return $this;
  750. }
  751. /**
  752. * Gets feedback_up
  753. *
  754. * @return int|null
  755. */
  756. public function getFeedbackUp()
  757. {
  758. return $this->container['feedback_up'];
  759. }
  760. /**
  761. * Sets feedback_up
  762. *
  763. * @param int|null $feedback_up feedback_up
  764. *
  765. * @return self
  766. */
  767. public function setFeedbackUp($feedback_up)
  768. {
  769. if (is_null($feedback_up)) {
  770. throw new \InvalidArgumentException('non-nullable feedback_up cannot be null');
  771. }
  772. $this->container['feedback_up'] = $feedback_up;
  773. return $this;
  774. }
  775. /**
  776. * Gets feedback_down
  777. *
  778. * @return int|null
  779. */
  780. public function getFeedbackDown()
  781. {
  782. return $this->container['feedback_down'];
  783. }
  784. /**
  785. * Sets feedback_down
  786. *
  787. * @param int|null $feedback_down feedback_down
  788. *
  789. * @return self
  790. */
  791. public function setFeedbackDown($feedback_down)
  792. {
  793. if (is_null($feedback_down)) {
  794. throw new \InvalidArgumentException('non-nullable feedback_down cannot be null');
  795. }
  796. $this->container['feedback_down'] = $feedback_down;
  797. return $this;
  798. }
  799. /**
  800. * Gets feedback_asked
  801. *
  802. * @return int|null
  803. */
  804. public function getFeedbackAsked()
  805. {
  806. return $this->container['feedback_asked'];
  807. }
  808. /**
  809. * Sets feedback_asked
  810. *
  811. * @param int|null $feedback_asked feedback_asked
  812. *
  813. * @return self
  814. */
  815. public function setFeedbackAsked($feedback_asked)
  816. {
  817. if (is_null($feedback_asked)) {
  818. throw new \InvalidArgumentException('non-nullable feedback_asked cannot be null');
  819. }
  820. $this->container['feedback_asked'] = $feedback_asked;
  821. return $this;
  822. }
  823. /**
  824. * Returns true if offset exists. False otherwise.
  825. *
  826. * @param integer|string $offset Offset
  827. *
  828. * @return boolean
  829. */
  830. public function offsetExists(mixed $offset): bool
  831. {
  832. return isset($this->container[$offset]);
  833. }
  834. /**
  835. * Gets offset.
  836. *
  837. * @param integer|string $offset Offset
  838. *
  839. * @return mixed|null
  840. */
  841. #[\ReturnTypeWillChange]
  842. public function offsetGet(mixed $offset)
  843. {
  844. return $this->container[$offset] ?? null;
  845. }
  846. /**
  847. * Sets value based on offset.
  848. *
  849. * @param int|null $offset Offset
  850. * @param mixed $value Value to be set
  851. *
  852. * @return void
  853. */
  854. public function offsetSet($offset, $value): void
  855. {
  856. if (is_null($offset)) {
  857. $this->container[] = $value;
  858. } else {
  859. $this->container[$offset] = $value;
  860. }
  861. }
  862. /**
  863. * Unsets offset.
  864. *
  865. * @param integer|string $offset Offset
  866. *
  867. * @return void
  868. */
  869. public function offsetUnset(mixed $offset): void
  870. {
  871. unset($this->container[$offset]);
  872. }
  873. /**
  874. * Serializes the object to a value that can be serialized natively by json_encode().
  875. * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
  876. *
  877. * @return mixed Returns data which can be serialized by json_encode(), which is a value
  878. * of any type other than a resource.
  879. */
  880. #[\ReturnTypeWillChange]
  881. public function jsonSerialize()
  882. {
  883. return ObjectSerializer::sanitizeForSerialization($this);
  884. }
  885. /**
  886. * Gets the string presentation of the object
  887. *
  888. * @return string
  889. */
  890. public function __toString()
  891. {
  892. return json_encode(
  893. ObjectSerializer::sanitizeForSerialization($this),
  894. JSON_PRETTY_PRINT
  895. );
  896. }
  897. /**
  898. * Gets a header-safe presentation of the object
  899. *
  900. * @return string
  901. */
  902. public function toHeaderValue()
  903. {
  904. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  905. }
  906. }