GetApiV3AdminAgentFeedback200ResponseDataInner.php 23 KB

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