From a180d097bcdff0b706d511b433e7f3f95498dbfb Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Tue, 29 Oct 2024 13:03:16 +0100 Subject: [PATCH] Add invite statement. --- lib/Model/Invite.php | 6 +- lib/Model/InviteStatement.php | 300 ++++++++++++++++++++++++++++++++++ 2 files changed, 303 insertions(+), 3 deletions(-) create mode 100644 lib/Model/InviteStatement.php diff --git a/lib/Model/Invite.php b/lib/Model/Invite.php index 9124eae..d3878c9 100644 --- a/lib/Model/Invite.php +++ b/lib/Model/Invite.php @@ -43,7 +43,7 @@ class Invite implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'email' => '', - 'statements' => '\AuthressSdk\Model\V1recordsStatements[]' + 'statements' => '\AuthressSdk\Model\InviteStatement[]' ]; /** @@ -204,7 +204,7 @@ public function setEmail($email) /** * Gets statements * - * @return \AuthressSdk\Model\V1recordsStatements[] + * @return \AuthressSdk\Model\InviteStatement[] */ public function getStatements() { @@ -214,7 +214,7 @@ public function getStatements() /** * Sets statements * - * @param \AuthressSdk\Model\V1recordsStatements[] $statements A list of statements which match roles to resources. The invited user will all statements apply to them + * @param \AuthressSdk\Model\InviteStatement[] $statements A list of statements which match roles to resources. The invited user will all statements apply to them * * @return $this */ diff --git a/lib/Model/InviteStatement.php b/lib/Model/InviteStatement.php new file mode 100644 index 0000000..068738a --- /dev/null +++ b/lib/Model/InviteStatement.php @@ -0,0 +1,300 @@ + 'string[]', + 'resources' => '\AuthressSdk\Model\V1recordsResources[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'roles' => null, + 'resources' => null + ]; + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'roles' => 'roles', + 'resources' => 'resources' + ]; + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'roles' => 'setRoles', + 'resources' => 'setResources' + ]; + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'roles' => 'getRoles', + 'resources' => 'getResources' + ]; + /** + * Associative array for storing property values + * + * @var array + */ + protected $container = []; + + /** + * Constructor + * + * @param array $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['roles'] = $data['roles'] ?? null; + $this->container['resources'] = $data['resources'] ?? null; + } + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['roles'] === null) { + $invalidProperties[] = "'roles' can't be null"; + } + if ($this->container['resources'] === null) { + $invalidProperties[] = "'resources' can't be null"; + } + return $invalidProperties; + } + + /** + * Gets roles + * + * @return string[] + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[] $roles roles + * + * @return $this + */ + public function setRoles($roles) + { + $this->container['roles'] = $roles; + + return $this; + } + + /** + * Gets resources + * + * @return \AuthressSdk\Model\V1recordsResources[] + */ + public function getResources() + { + return $this->container['resources']; + } + + /** + * Sets resources + * + * @param \AuthressSdk\Model\V1recordsResources[] $resources resources + * + * @return $this + */ + public function setResources($resources) + { + $this->container['resources'] = $resources; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + \JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +}