<?php
/**
 * GetPublicgroup200ResponseDataSignUpConditions
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  StevenBuehner\ChurchTools
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * ChurchTools REST API
 *
 * The ChurchTools REST API is the best entry point for developers to access ChurchTools. <br><br> **Authentication:** You need to be authorized to use some endpoints. Those endpoints are marked by a gray lock symbol. If you view the documentation, while you are logged into ChurchTools, all requests are already authorized. If you want to authorized a request, you need to provide a `Login Token` as `Authorization` header in the format `Authorization: Login<token>` or send a valid cookie. You can use the green \"Authorize\" dialog to enter those details and see how a request would look like in detail. <br><br> **Missing Endpoints:** Not all features are yet available by our new REST API. This documentation will grow in the future. We are working hard to add new endpoints with every ChurchTools version. The documentation will always show only those endpoints you can use with your ChurchTools installation.
 *
 * The version of the OpenAPI document: 0.1.0
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.21.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace StevenBuehner\ChurchTools\Model;

use \ArrayAccess;
use \StevenBuehner\ChurchTools\ObjectSerializer;

/**
 * GetPublicgroup200ResponseDataSignUpConditions Class Doc Comment
 *
 * @category Class
 * @package  StevenBuehner\ChurchTools
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class GetPublicgroup200ResponseDataSignUpConditions implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @var string[]
     */
    protected static $openAPITypes = [
        'can_contact_leader' => 'bool',
        'default_role_set_in_group' => 'bool',
        'end_date_not_passed' => 'bool',
        'group_allows_waitinglist' => 'bool',
        'group_has_leader' => 'bool',
        'group_has_space_for_requests' => 'bool',
        'group_has_space_on_waitinglist' => 'bool',
        'group_is_active' => 'bool',
        'group_is_not_full' => 'bool',
        'group_is_not_hidden' => 'bool',
        'group_is_open_for_members' => 'bool',
        'group_is_public' => 'bool',
        'new_person_department_is_set' => 'bool',
        'new_person_station_is_set' => 'bool',
        'new_person_status_is_set' => 'bool'
    ];

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @var string[]
     * @phpstan-var array<string, string|null>
     * @psalm-var array<string, string|null>
     */
    protected static $openAPIFormats = [
        'can_contact_leader' => null,
        'default_role_set_in_group' => null,
        'end_date_not_passed' => null,
        'group_allows_waitinglist' => null,
        'group_has_leader' => null,
        'group_has_space_for_requests' => null,
        'group_has_space_on_waitinglist' => null,
        'group_is_active' => null,
        'group_is_not_full' => null,
        'group_is_not_hidden' => null,
        'group_is_open_for_members' => null,
        'group_is_public' => null,
        'new_person_department_is_set' => null,
        'new_person_station_is_set' => null,
        'new_person_status_is_set' => null
    ];

    /**
     * Array of nullable properties. Used for (de)serialization
     *
     * @var boolean[]
     */
    protected static array $openAPINullables = [
        'can_contact_leader' => false,
        'default_role_set_in_group' => false,
        'end_date_not_passed' => false,
        'group_allows_waitinglist' => false,
        'group_has_leader' => false,
        'group_has_space_for_requests' => false,
        'group_has_space_on_waitinglist' => false,
        'group_is_active' => false,
        'group_is_not_full' => false,
        'group_is_not_hidden' => false,
        'group_is_open_for_members' => false,
        'group_is_public' => false,
        'new_person_department_is_set' => false,
        'new_person_station_is_set' => false,
        'new_person_status_is_set' => false
    ];

    /**
     * If a nullable field gets set to null, insert it here
     *
     * @var boolean[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'can_contact_leader' => 'canContactLeader',
        'default_role_set_in_group' => 'defaultRoleSetInGroup',
        'end_date_not_passed' => 'endDateNotPassed',
        'group_allows_waitinglist' => 'groupAllowsWaitinglist',
        'group_has_leader' => 'groupHasLeader',
        'group_has_space_for_requests' => 'groupHasSpaceForRequests',
        'group_has_space_on_waitinglist' => 'groupHasSpaceOnWaitinglist',
        'group_is_active' => 'groupIsActive',
        'group_is_not_full' => 'groupIsNotFull',
        'group_is_not_hidden' => 'groupIsNotHidden',
        'group_is_open_for_members' => 'groupIsOpenForMembers',
        'group_is_public' => 'groupIsPublic',
        'new_person_department_is_set' => 'newPersonDepartmentIsSet',
        'new_person_station_is_set' => 'newPersonStationIsSet',
        'new_person_status_is_set' => 'newPersonStatusIsSet'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'can_contact_leader' => 'setCanContactLeader',
        'default_role_set_in_group' => 'setDefaultRoleSetInGroup',
        'end_date_not_passed' => 'setEndDateNotPassed',
        'group_allows_waitinglist' => 'setGroupAllowsWaitinglist',
        'group_has_leader' => 'setGroupHasLeader',
        'group_has_space_for_requests' => 'setGroupHasSpaceForRequests',
        'group_has_space_on_waitinglist' => 'setGroupHasSpaceOnWaitinglist',
        'group_is_active' => 'setGroupIsActive',
        'group_is_not_full' => 'setGroupIsNotFull',
        'group_is_not_hidden' => 'setGroupIsNotHidden',
        'group_is_open_for_members' => 'setGroupIsOpenForMembers',
        'group_is_public' => 'setGroupIsPublic',
        'new_person_department_is_set' => 'setNewPersonDepartmentIsSet',
        'new_person_station_is_set' => 'setNewPersonStationIsSet',
        'new_person_status_is_set' => 'setNewPersonStatusIsSet'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'can_contact_leader' => 'getCanContactLeader',
        'default_role_set_in_group' => 'getDefaultRoleSetInGroup',
        'end_date_not_passed' => 'getEndDateNotPassed',
        'group_allows_waitinglist' => 'getGroupAllowsWaitinglist',
        'group_has_leader' => 'getGroupHasLeader',
        'group_has_space_for_requests' => 'getGroupHasSpaceForRequests',
        'group_has_space_on_waitinglist' => 'getGroupHasSpaceOnWaitinglist',
        'group_is_active' => 'getGroupIsActive',
        'group_is_not_full' => 'getGroupIsNotFull',
        'group_is_not_hidden' => 'getGroupIsNotHidden',
        'group_is_open_for_members' => 'getGroupIsOpenForMembers',
        'group_is_public' => 'getGroupIsPublic',
        'new_person_department_is_set' => 'getNewPersonDepartmentIsSet',
        'new_person_station_is_set' => 'getNewPersonStationIsSet',
        'new_person_status_is_set' => 'getNewPersonStatusIsSet'
    ];

    /**
     * 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;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('can_contact_leader', $data ?? [], null);
        $this->setIfExists('default_role_set_in_group', $data ?? [], null);
        $this->setIfExists('end_date_not_passed', $data ?? [], null);
        $this->setIfExists('group_allows_waitinglist', $data ?? [], null);
        $this->setIfExists('group_has_leader', $data ?? [], null);
        $this->setIfExists('group_has_space_for_requests', $data ?? [], null);
        $this->setIfExists('group_has_space_on_waitinglist', $data ?? [], null);
        $this->setIfExists('group_is_active', $data ?? [], null);
        $this->setIfExists('group_is_not_full', $data ?? [], null);
        $this->setIfExists('group_is_not_hidden', $data ?? [], null);
        $this->setIfExists('group_is_open_for_members', $data ?? [], null);
        $this->setIfExists('group_is_public', $data ?? [], null);
        $this->setIfExists('new_person_department_is_set', $data ?? [], null);
        $this->setIfExists('new_person_station_is_set', $data ?? [], null);
        $this->setIfExists('new_person_status_is_set', $data ?? [], null);
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array
     *
     * @param string $variableName
     * @param array  $fields
     * @param mixed  $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * 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;
    }


    /**
     * Gets can_contact_leader
     *
     * @return bool|null
     */
    public function getCanContactLeader()
    {
        return $this->container['can_contact_leader'];
    }

    /**
     * Sets can_contact_leader
     *
     * @param bool|null $can_contact_leader can_contact_leader
     *
     * @return self
     */
    public function setCanContactLeader($can_contact_leader)
    {
        if (is_null($can_contact_leader)) {
            throw new \InvalidArgumentException('non-nullable can_contact_leader cannot be null');
        }
        $this->container['can_contact_leader'] = $can_contact_leader;

        return $this;
    }

    /**
     * Gets default_role_set_in_group
     *
     * @return bool|null
     */
    public function getDefaultRoleSetInGroup()
    {
        return $this->container['default_role_set_in_group'];
    }

    /**
     * Sets default_role_set_in_group
     *
     * @param bool|null $default_role_set_in_group default_role_set_in_group
     *
     * @return self
     */
    public function setDefaultRoleSetInGroup($default_role_set_in_group)
    {
        if (is_null($default_role_set_in_group)) {
            throw new \InvalidArgumentException('non-nullable default_role_set_in_group cannot be null');
        }
        $this->container['default_role_set_in_group'] = $default_role_set_in_group;

        return $this;
    }

    /**
     * Gets end_date_not_passed
     *
     * @return bool|null
     */
    public function getEndDateNotPassed()
    {
        return $this->container['end_date_not_passed'];
    }

    /**
     * Sets end_date_not_passed
     *
     * @param bool|null $end_date_not_passed end_date_not_passed
     *
     * @return self
     */
    public function setEndDateNotPassed($end_date_not_passed)
    {
        if (is_null($end_date_not_passed)) {
            throw new \InvalidArgumentException('non-nullable end_date_not_passed cannot be null');
        }
        $this->container['end_date_not_passed'] = $end_date_not_passed;

        return $this;
    }

    /**
     * Gets group_allows_waitinglist
     *
     * @return bool|null
     */
    public function getGroupAllowsWaitinglist()
    {
        return $this->container['group_allows_waitinglist'];
    }

    /**
     * Sets group_allows_waitinglist
     *
     * @param bool|null $group_allows_waitinglist group_allows_waitinglist
     *
     * @return self
     */
    public function setGroupAllowsWaitinglist($group_allows_waitinglist)
    {
        if (is_null($group_allows_waitinglist)) {
            throw new \InvalidArgumentException('non-nullable group_allows_waitinglist cannot be null');
        }
        $this->container['group_allows_waitinglist'] = $group_allows_waitinglist;

        return $this;
    }

    /**
     * Gets group_has_leader
     *
     * @return bool|null
     */
    public function getGroupHasLeader()
    {
        return $this->container['group_has_leader'];
    }

    /**
     * Sets group_has_leader
     *
     * @param bool|null $group_has_leader group_has_leader
     *
     * @return self
     */
    public function setGroupHasLeader($group_has_leader)
    {
        if (is_null($group_has_leader)) {
            throw new \InvalidArgumentException('non-nullable group_has_leader cannot be null');
        }
        $this->container['group_has_leader'] = $group_has_leader;

        return $this;
    }

    /**
     * Gets group_has_space_for_requests
     *
     * @return bool|null
     */
    public function getGroupHasSpaceForRequests()
    {
        return $this->container['group_has_space_for_requests'];
    }

    /**
     * Sets group_has_space_for_requests
     *
     * @param bool|null $group_has_space_for_requests group_has_space_for_requests
     *
     * @return self
     */
    public function setGroupHasSpaceForRequests($group_has_space_for_requests)
    {
        if (is_null($group_has_space_for_requests)) {
            throw new \InvalidArgumentException('non-nullable group_has_space_for_requests cannot be null');
        }
        $this->container['group_has_space_for_requests'] = $group_has_space_for_requests;

        return $this;
    }

    /**
     * Gets group_has_space_on_waitinglist
     *
     * @return bool|null
     */
    public function getGroupHasSpaceOnWaitinglist()
    {
        return $this->container['group_has_space_on_waitinglist'];
    }

    /**
     * Sets group_has_space_on_waitinglist
     *
     * @param bool|null $group_has_space_on_waitinglist group_has_space_on_waitinglist
     *
     * @return self
     */
    public function setGroupHasSpaceOnWaitinglist($group_has_space_on_waitinglist)
    {
        if (is_null($group_has_space_on_waitinglist)) {
            throw new \InvalidArgumentException('non-nullable group_has_space_on_waitinglist cannot be null');
        }
        $this->container['group_has_space_on_waitinglist'] = $group_has_space_on_waitinglist;

        return $this;
    }

    /**
     * Gets group_is_active
     *
     * @return bool|null
     */
    public function getGroupIsActive()
    {
        return $this->container['group_is_active'];
    }

    /**
     * Sets group_is_active
     *
     * @param bool|null $group_is_active group_is_active
     *
     * @return self
     */
    public function setGroupIsActive($group_is_active)
    {
        if (is_null($group_is_active)) {
            throw new \InvalidArgumentException('non-nullable group_is_active cannot be null');
        }
        $this->container['group_is_active'] = $group_is_active;

        return $this;
    }

    /**
     * Gets group_is_not_full
     *
     * @return bool|null
     */
    public function getGroupIsNotFull()
    {
        return $this->container['group_is_not_full'];
    }

    /**
     * Sets group_is_not_full
     *
     * @param bool|null $group_is_not_full group_is_not_full
     *
     * @return self
     */
    public function setGroupIsNotFull($group_is_not_full)
    {
        if (is_null($group_is_not_full)) {
            throw new \InvalidArgumentException('non-nullable group_is_not_full cannot be null');
        }
        $this->container['group_is_not_full'] = $group_is_not_full;

        return $this;
    }

    /**
     * Gets group_is_not_hidden
     *
     * @return bool|null
     */
    public function getGroupIsNotHidden()
    {
        return $this->container['group_is_not_hidden'];
    }

    /**
     * Sets group_is_not_hidden
     *
     * @param bool|null $group_is_not_hidden group_is_not_hidden
     *
     * @return self
     */
    public function setGroupIsNotHidden($group_is_not_hidden)
    {
        if (is_null($group_is_not_hidden)) {
            throw new \InvalidArgumentException('non-nullable group_is_not_hidden cannot be null');
        }
        $this->container['group_is_not_hidden'] = $group_is_not_hidden;

        return $this;
    }

    /**
     * Gets group_is_open_for_members
     *
     * @return bool|null
     */
    public function getGroupIsOpenForMembers()
    {
        return $this->container['group_is_open_for_members'];
    }

    /**
     * Sets group_is_open_for_members
     *
     * @param bool|null $group_is_open_for_members group_is_open_for_members
     *
     * @return self
     */
    public function setGroupIsOpenForMembers($group_is_open_for_members)
    {
        if (is_null($group_is_open_for_members)) {
            throw new \InvalidArgumentException('non-nullable group_is_open_for_members cannot be null');
        }
        $this->container['group_is_open_for_members'] = $group_is_open_for_members;

        return $this;
    }

    /**
     * Gets group_is_public
     *
     * @return bool|null
     */
    public function getGroupIsPublic()
    {
        return $this->container['group_is_public'];
    }

    /**
     * Sets group_is_public
     *
     * @param bool|null $group_is_public group_is_public
     *
     * @return self
     */
    public function setGroupIsPublic($group_is_public)
    {
        if (is_null($group_is_public)) {
            throw new \InvalidArgumentException('non-nullable group_is_public cannot be null');
        }
        $this->container['group_is_public'] = $group_is_public;

        return $this;
    }

    /**
     * Gets new_person_department_is_set
     *
     * @return bool|null
     */
    public function getNewPersonDepartmentIsSet()
    {
        return $this->container['new_person_department_is_set'];
    }

    /**
     * Sets new_person_department_is_set
     *
     * @param bool|null $new_person_department_is_set new_person_department_is_set
     *
     * @return self
     */
    public function setNewPersonDepartmentIsSet($new_person_department_is_set)
    {
        if (is_null($new_person_department_is_set)) {
            throw new \InvalidArgumentException('non-nullable new_person_department_is_set cannot be null');
        }
        $this->container['new_person_department_is_set'] = $new_person_department_is_set;

        return $this;
    }

    /**
     * Gets new_person_station_is_set
     *
     * @return bool|null
     */
    public function getNewPersonStationIsSet()
    {
        return $this->container['new_person_station_is_set'];
    }

    /**
     * Sets new_person_station_is_set
     *
     * @param bool|null $new_person_station_is_set new_person_station_is_set
     *
     * @return self
     */
    public function setNewPersonStationIsSet($new_person_station_is_set)
    {
        if (is_null($new_person_station_is_set)) {
            throw new \InvalidArgumentException('non-nullable new_person_station_is_set cannot be null');
        }
        $this->container['new_person_station_is_set'] = $new_person_station_is_set;

        return $this;
    }

    /**
     * Gets new_person_status_is_set
     *
     * @return bool|null
     */
    public function getNewPersonStatusIsSet()
    {
        return $this->container['new_person_status_is_set'];
    }

    /**
     * Sets new_person_status_is_set
     *
     * @param bool|null $new_person_status_is_set new_person_status_is_set
     *
     * @return self
     */
    public function setNewPersonStatusIsSet($new_person_status_is_set)
    {
        if (is_null($new_person_status_is_set)) {
            throw new \InvalidArgumentException('non-nullable new_person_status_is_set cannot be null');
        }
        $this->container['new_person_status_is_set'] = $new_person_status_is_set;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer|string $offset Offset
     *
     * @return boolean
     */
    public function offsetExists(mixed $offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer|string $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet(mixed $offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer|string $offset Offset
     *
     * @return void
     */
    public function offsetUnset(mixed $offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


