GetApiV3MeGroups200ResponseDataInner.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. <?php
  2. /**
  3. * GetApiV3MeGroups200ResponseDataInner
  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. * GetApiV3MeGroups200ResponseDataInner 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 GetApiV3MeGroups200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
  39. {
  40. public const DISCRIMINATOR = null;
  41. /**
  42. * The original name of the model.
  43. *
  44. * @var string
  45. */
  46. protected static $openAPIModelName = 'get_api_v3_me_groups_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. 'id' => 'string',
  54. 'name' => 'string',
  55. 'description' => 'string',
  56. 'owner_id' => 'string',
  57. 'owner' => '\WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser',
  58. 'status' => 'int',
  59. 'role' => 'string',
  60. 'member_id' => 'string',
  61. 'created_at' => 'string',
  62. 'joined_at' => '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. 'id' => null,
  73. 'name' => null,
  74. 'description' => null,
  75. 'owner_id' => null,
  76. 'owner' => null,
  77. 'status' => null,
  78. 'role' => null,
  79. 'member_id' => null,
  80. 'created_at' => null,
  81. 'joined_at' => null
  82. ];
  83. /**
  84. * Array of nullable properties. Used for (de)serialization
  85. *
  86. * @var boolean[]
  87. */
  88. protected static array $openAPINullables = [
  89. 'id' => false,
  90. 'name' => false,
  91. 'description' => true,
  92. 'owner_id' => false,
  93. 'owner' => true,
  94. 'status' => false,
  95. 'role' => false,
  96. 'member_id' => false,
  97. 'created_at' => false,
  98. 'joined_at' => false
  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. 'id' => 'id',
  179. 'name' => 'name',
  180. 'description' => 'description',
  181. 'owner_id' => 'owner_id',
  182. 'owner' => 'owner',
  183. 'status' => 'status',
  184. 'role' => 'role',
  185. 'member_id' => 'member_id',
  186. 'created_at' => 'created_at',
  187. 'joined_at' => 'joined_at'
  188. ];
  189. /**
  190. * Array of attributes to setter functions (for deserialization of responses)
  191. *
  192. * @var string[]
  193. */
  194. protected static $setters = [
  195. 'id' => 'setId',
  196. 'name' => 'setName',
  197. 'description' => 'setDescription',
  198. 'owner_id' => 'setOwnerId',
  199. 'owner' => 'setOwner',
  200. 'status' => 'setStatus',
  201. 'role' => 'setRole',
  202. 'member_id' => 'setMemberId',
  203. 'created_at' => 'setCreatedAt',
  204. 'joined_at' => 'setJoinedAt'
  205. ];
  206. /**
  207. * Array of attributes to getter functions (for serialization of requests)
  208. *
  209. * @var string[]
  210. */
  211. protected static $getters = [
  212. 'id' => 'getId',
  213. 'name' => 'getName',
  214. 'description' => 'getDescription',
  215. 'owner_id' => 'getOwnerId',
  216. 'owner' => 'getOwner',
  217. 'status' => 'getStatus',
  218. 'role' => 'getRole',
  219. 'member_id' => 'getMemberId',
  220. 'created_at' => 'getCreatedAt',
  221. 'joined_at' => 'getJoinedAt'
  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('id', $data ?? [], null);
  275. $this->setIfExists('name', $data ?? [], null);
  276. $this->setIfExists('description', $data ?? [], null);
  277. $this->setIfExists('owner_id', $data ?? [], null);
  278. $this->setIfExists('owner', $data ?? [], null);
  279. $this->setIfExists('status', $data ?? [], null);
  280. $this->setIfExists('role', $data ?? [], null);
  281. $this->setIfExists('member_id', $data ?? [], null);
  282. $this->setIfExists('created_at', $data ?? [], null);
  283. $this->setIfExists('joined_at', $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 id
  323. *
  324. * @return string|null
  325. */
  326. public function getId()
  327. {
  328. return $this->container['id'];
  329. }
  330. /**
  331. * Sets id
  332. *
  333. * @param string|null $id id
  334. *
  335. * @return self
  336. */
  337. public function setId($id)
  338. {
  339. if (is_null($id)) {
  340. throw new \InvalidArgumentException('non-nullable id cannot be null');
  341. }
  342. $this->container['id'] = $id;
  343. return $this;
  344. }
  345. /**
  346. * Gets name
  347. *
  348. * @return string|null
  349. */
  350. public function getName()
  351. {
  352. return $this->container['name'];
  353. }
  354. /**
  355. * Sets name
  356. *
  357. * @param string|null $name name
  358. *
  359. * @return self
  360. */
  361. public function setName($name)
  362. {
  363. if (is_null($name)) {
  364. throw new \InvalidArgumentException('non-nullable name cannot be null');
  365. }
  366. $this->container['name'] = $name;
  367. return $this;
  368. }
  369. /**
  370. * Gets description
  371. *
  372. * @return string|null
  373. */
  374. public function getDescription()
  375. {
  376. return $this->container['description'];
  377. }
  378. /**
  379. * Sets description
  380. *
  381. * @param string|null $description description
  382. *
  383. * @return self
  384. */
  385. public function setDescription($description)
  386. {
  387. if (is_null($description)) {
  388. array_push($this->openAPINullablesSetToNull, 'description');
  389. } else {
  390. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  391. $index = array_search('description', $nullablesSetToNull);
  392. if ($index !== FALSE) {
  393. unset($nullablesSetToNull[$index]);
  394. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  395. }
  396. }
  397. $this->container['description'] = $description;
  398. return $this;
  399. }
  400. /**
  401. * Gets owner_id
  402. *
  403. * @return string|null
  404. */
  405. public function getOwnerId()
  406. {
  407. return $this->container['owner_id'];
  408. }
  409. /**
  410. * Sets owner_id
  411. *
  412. * @param string|null $owner_id owner_id
  413. *
  414. * @return self
  415. */
  416. public function setOwnerId($owner_id)
  417. {
  418. if (is_null($owner_id)) {
  419. throw new \InvalidArgumentException('non-nullable owner_id cannot be null');
  420. }
  421. $this->container['owner_id'] = $owner_id;
  422. return $this;
  423. }
  424. /**
  425. * Gets owner
  426. *
  427. * @return \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null
  428. */
  429. public function getOwner()
  430. {
  431. return $this->container['owner'];
  432. }
  433. /**
  434. * Sets owner
  435. *
  436. * @param \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null $owner owner
  437. *
  438. * @return self
  439. */
  440. public function setOwner($owner)
  441. {
  442. if (is_null($owner)) {
  443. array_push($this->openAPINullablesSetToNull, 'owner');
  444. } else {
  445. $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
  446. $index = array_search('owner', $nullablesSetToNull);
  447. if ($index !== FALSE) {
  448. unset($nullablesSetToNull[$index]);
  449. $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
  450. }
  451. }
  452. $this->container['owner'] = $owner;
  453. return $this;
  454. }
  455. /**
  456. * Gets status
  457. *
  458. * @return int|null
  459. */
  460. public function getStatus()
  461. {
  462. return $this->container['status'];
  463. }
  464. /**
  465. * Sets status
  466. *
  467. * @param int|null $status status
  468. *
  469. * @return self
  470. */
  471. public function setStatus($status)
  472. {
  473. if (is_null($status)) {
  474. throw new \InvalidArgumentException('non-nullable status cannot be null');
  475. }
  476. $this->container['status'] = $status;
  477. return $this;
  478. }
  479. /**
  480. * Gets role
  481. *
  482. * @return string|null
  483. */
  484. public function getRole()
  485. {
  486. return $this->container['role'];
  487. }
  488. /**
  489. * Sets role
  490. *
  491. * @param string|null $role role
  492. *
  493. * @return self
  494. */
  495. public function setRole($role)
  496. {
  497. if (is_null($role)) {
  498. throw new \InvalidArgumentException('non-nullable role cannot be null');
  499. }
  500. $this->container['role'] = $role;
  501. return $this;
  502. }
  503. /**
  504. * Gets member_id
  505. *
  506. * @return string|null
  507. */
  508. public function getMemberId()
  509. {
  510. return $this->container['member_id'];
  511. }
  512. /**
  513. * Sets member_id
  514. *
  515. * @param string|null $member_id member_id
  516. *
  517. * @return self
  518. */
  519. public function setMemberId($member_id)
  520. {
  521. if (is_null($member_id)) {
  522. throw new \InvalidArgumentException('non-nullable member_id cannot be null');
  523. }
  524. $this->container['member_id'] = $member_id;
  525. return $this;
  526. }
  527. /**
  528. * Gets created_at
  529. *
  530. * @return string|null
  531. */
  532. public function getCreatedAt()
  533. {
  534. return $this->container['created_at'];
  535. }
  536. /**
  537. * Sets created_at
  538. *
  539. * @param string|null $created_at created_at
  540. *
  541. * @return self
  542. */
  543. public function setCreatedAt($created_at)
  544. {
  545. if (is_null($created_at)) {
  546. throw new \InvalidArgumentException('non-nullable created_at cannot be null');
  547. }
  548. $this->container['created_at'] = $created_at;
  549. return $this;
  550. }
  551. /**
  552. * Gets joined_at
  553. *
  554. * @return string|null
  555. */
  556. public function getJoinedAt()
  557. {
  558. return $this->container['joined_at'];
  559. }
  560. /**
  561. * Sets joined_at
  562. *
  563. * @param string|null $joined_at joined_at
  564. *
  565. * @return self
  566. */
  567. public function setJoinedAt($joined_at)
  568. {
  569. if (is_null($joined_at)) {
  570. throw new \InvalidArgumentException('non-nullable joined_at cannot be null');
  571. }
  572. $this->container['joined_at'] = $joined_at;
  573. return $this;
  574. }
  575. /**
  576. * Returns true if offset exists. False otherwise.
  577. *
  578. * @param integer|string $offset Offset
  579. *
  580. * @return boolean
  581. */
  582. public function offsetExists(mixed $offset): bool
  583. {
  584. return isset($this->container[$offset]);
  585. }
  586. /**
  587. * Gets offset.
  588. *
  589. * @param integer|string $offset Offset
  590. *
  591. * @return mixed|null
  592. */
  593. #[\ReturnTypeWillChange]
  594. public function offsetGet(mixed $offset)
  595. {
  596. return $this->container[$offset] ?? null;
  597. }
  598. /**
  599. * Sets value based on offset.
  600. *
  601. * @param int|null $offset Offset
  602. * @param mixed $value Value to be set
  603. *
  604. * @return void
  605. */
  606. public function offsetSet($offset, $value): void
  607. {
  608. if (is_null($offset)) {
  609. $this->container[] = $value;
  610. } else {
  611. $this->container[$offset] = $value;
  612. }
  613. }
  614. /**
  615. * Unsets offset.
  616. *
  617. * @param integer|string $offset Offset
  618. *
  619. * @return void
  620. */
  621. public function offsetUnset(mixed $offset): void
  622. {
  623. unset($this->container[$offset]);
  624. }
  625. /**
  626. * Serializes the object to a value that can be serialized natively by json_encode().
  627. * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
  628. *
  629. * @return mixed Returns data which can be serialized by json_encode(), which is a value
  630. * of any type other than a resource.
  631. */
  632. #[\ReturnTypeWillChange]
  633. public function jsonSerialize()
  634. {
  635. return ObjectSerializer::sanitizeForSerialization($this);
  636. }
  637. /**
  638. * Gets the string presentation of the object
  639. *
  640. * @return string
  641. */
  642. public function __toString()
  643. {
  644. return json_encode(
  645. ObjectSerializer::sanitizeForSerialization($this),
  646. JSON_PRETTY_PRINT
  647. );
  648. }
  649. /**
  650. * Gets a header-safe presentation of the object
  651. *
  652. * @return string
  653. */
  654. public function toHeaderValue()
  655. {
  656. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  657. }
  658. }