PostApiV3AdminCreditAdjustments200ResponseData.php 26 KB

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