Skip to content

Commit

Permalink
Add invite statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Oct 29, 2024
1 parent ba7e614 commit a180d09
Show file tree
Hide file tree
Showing 2 changed files with 303 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Model/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Invite implements ModelInterface, ArrayAccess
*/
protected static $swaggerTypes = [
'email' => '',
'statements' => '\AuthressSdk\Model\V1recordsStatements[]'
'statements' => '\AuthressSdk\Model\InviteStatement[]'
];

/**
Expand Down Expand Up @@ -204,7 +204,7 @@ public function setEmail($email)
/**
* Gets statements
*
* @return \AuthressSdk\Model\V1recordsStatements[]
* @return \AuthressSdk\Model\InviteStatement[]
*/
public function getStatements()
{
Expand All @@ -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
*/
Expand Down
300 changes: 300 additions & 0 deletions lib/Model/InviteStatement.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
<?php
/**
* InviteStatement
*
* @category Class
*
* @author Authress Developers
*
* @link https://authress.io/app/#/api
*/

namespace AuthressSdk\Model;

use ArrayAccess;
use AuthressSdk\ObjectSerializer;

/**
* InviteStatement Class Doc Comment
*
* @category Class
*
* @author Authress Developers
*
* @link https://authress.io/app/#/api
*/
class InviteStatement implements ModelInterface, ArrayAccess
{
public const DISCRIMINATOR = null;

/**
* The original name of the model.
*
* @var string
*/
protected static $swaggerModelName = 'InviteStatement';

/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $swaggerTypes = [
'roles' => '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));
}
}

0 comments on commit a180d09

Please sign in to comment.