From 4ee2977bacffa66900e30614ddfd8a111b7de5e2 Mon Sep 17 00:00:00 2001 From: Niko Heller Date: Tue, 13 Aug 2024 21:49:36 +0200 Subject: [PATCH] add profile filters --- composer.json | 2 +- docs/Api/ProfilesApi.md | 23 +- docs/Model/FindProfilesResponse.md | 1 + docs/Model/FindProfilesResponseMeta.md | 12 + lib/Configuration.php | 4 +- lib/apis/ProfilesApi.php | 147 +++++- lib/models/FindProfilesResponse.php | 49 +- lib/models/FindProfilesResponseMeta.php | 511 ++++++++++++++++++++ lib/models/ProfilePrivacySettings.php | 12 +- test/Model/FindProfilesResponseMetaTest.php | 117 +++++ 10 files changed, 834 insertions(+), 44 deletions(-) create mode 100644 docs/Model/FindProfilesResponseMeta.md create mode 100644 lib/models/FindProfilesResponseMeta.php create mode 100644 test/Model/FindProfilesResponseMetaTest.php diff --git a/composer.json b/composer.json index d515969..20a596b 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "verdigado/gruene-api-client", - "version": "0.7.0", + "version": "0.8.0", "description": "PHP client library for gruene api", "keywords": [ "openapitools", diff --git a/docs/Api/ProfilesApi.md b/docs/Api/ProfilesApi.md index c86bf57..da6c2fd 100644 --- a/docs/Api/ProfilesApi.md +++ b/docs/Api/ProfilesApi.md @@ -81,7 +81,7 @@ try { ## `deleteProfile()` ```php -deleteProfile($profile_id) +deleteProfile($profile_id): \Verdigado\GrueneApiClient\models\Profile ``` Delete user profile @@ -111,7 +111,8 @@ $apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi( $profile_id = 'profile_id_example'; // string try { - $apiInstance->deleteProfile($profile_id); + $result = $apiInstance->deleteProfile($profile_id); + print_r($result); } catch (Exception $e) { echo 'Exception when calling ProfilesApi->deleteProfile: ', $e->getMessage(), PHP_EOL; } @@ -125,7 +126,7 @@ try { ### Return type -void (empty response body) +[**\Verdigado\GrueneApiClient\models\Profile**](../Model/Profile.md) ### Authorization @@ -134,7 +135,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: Not defined +- **Accept**: `application/json` [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) @@ -275,7 +276,7 @@ try { ## `findProfiles()` ```php -findProfiles($tags, $search): \Verdigado\GrueneApiClient\models\FindProfilesResponse +findProfiles($limit, $tags, $offset, $search, $division): \Verdigado\GrueneApiClient\models\FindProfilesResponse ``` Find user profiles @@ -302,11 +303,14 @@ $apiInstance = new Verdigado\GrueneApiClient\Api\ProfilesApi( new GuzzleHttp\Client(), $config ); +$limit = 20; // float $tags = array('tags_example'); // string[] | Filter by profile tag ids -$search = 'search_example'; // string | Search term to look for in firstName, lastName, email, username. +$offset = 3.4; // float +$search = 'search_example'; // string | Search term to look for in firstName, lastName and username +$division = 'division_example'; // string | Division key to filter profiles. Only include profiles that are member of given division. try { - $result = $apiInstance->findProfiles($tags, $search); + $result = $apiInstance->findProfiles($limit, $tags, $offset, $search, $division); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProfilesApi->findProfiles: ', $e->getMessage(), PHP_EOL; @@ -317,8 +321,11 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **limit** | **float**| | [optional] [default to 20] | | **tags** | [**string[]**](../Model/string.md)| Filter by profile tag ids | [optional] | -| **search** | **string**| Search term to look for in firstName, lastName, email, username. | [optional] | +| **offset** | **float**| | [optional] | +| **search** | **string**| Search term to look for in firstName, lastName and username | [optional] | +| **division** | **string**| Division key to filter profiles. Only include profiles that are member of given division. | [optional] | ### Return type diff --git a/docs/Model/FindProfilesResponse.md b/docs/Model/FindProfilesResponse.md index 05eb431..13c2b03 100644 --- a/docs/Model/FindProfilesResponse.md +++ b/docs/Model/FindProfilesResponse.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Verdigado\GrueneApiClient\models\PublicProfile[]**](PublicProfile.md) | | +**meta** | [**\Verdigado\GrueneApiClient\models\FindProfilesResponseMeta**](FindProfilesResponseMeta.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FindProfilesResponseMeta.md b/docs/Model/FindProfilesResponseMeta.md new file mode 100644 index 0000000..569aa7f --- /dev/null +++ b/docs/Model/FindProfilesResponseMeta.md @@ -0,0 +1,12 @@ +# # FindProfilesResponseMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **float** | | [optional] +**offset** | **float** | | [optional] +**limit** | **float** | | [optional] +**has_next** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Configuration.php b/lib/Configuration.php index 9022cb9..1e333da 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/0.7.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/0.8.0/PHP'; /** * Debug switch (default set to false) @@ -433,7 +433,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 0.1.0' . PHP_EOL; - $report .= ' SDK Package Version: 0.7.0' . PHP_EOL; + $report .= ' SDK Package Version: 0.8.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/apis/ProfilesApi.php b/lib/apis/ProfilesApi.php index fb8b80f..eff078a 100644 --- a/lib/apis/ProfilesApi.php +++ b/lib/apis/ProfilesApi.php @@ -447,11 +447,12 @@ public function createProfileRequest($create_profile, string $contentType = self * * @throws \Verdigado\GrueneApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Verdigado\GrueneApiClient\models\Profile */ public function deleteProfile($profile_id, string $contentType = self::contentTypes['deleteProfile'][0]) { - $this->deleteProfileWithHttpInfo($profile_id, $contentType); + list($response) = $this->deleteProfileWithHttpInfo($profile_id, $contentType); + return $response; } /** @@ -464,7 +465,7 @@ public function deleteProfile($profile_id, string $contentType = self::contentTy * * @throws \Verdigado\GrueneApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Verdigado\GrueneApiClient\models\Profile, HTTP status code, HTTP response headers (array of strings) */ public function deleteProfileWithHttpInfo($profile_id, string $contentType = self::contentTypes['deleteProfile'][0]) { @@ -505,10 +506,50 @@ public function deleteProfileWithHttpInfo($profile_id, string $contentType = sel ); } - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + if ('\Verdigado\GrueneApiClient\models\Profile' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Verdigado\GrueneApiClient\models\Profile' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Verdigado\GrueneApiClient\models\Profile', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Verdigado\GrueneApiClient\models\Profile'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Verdigado\GrueneApiClient\models\Profile', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -548,14 +589,27 @@ function ($response) { */ public function deleteProfileAsyncWithHttpInfo($profile_id, string $contentType = self::contentTypes['deleteProfile'][0]) { - $returnType = ''; + $returnType = '\Verdigado\GrueneApiClient\models\Profile'; $request = $this->deleteProfileRequest($profile_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -614,7 +668,7 @@ public function deleteProfileRequest($profile_id, string $contentType = self::co $headers = $this->headerSelector->selectHeaders( - [], + ['application/json', ], $contentType, $multipart ); @@ -1310,17 +1364,20 @@ public function findProfileTagsRequest($limit = 20, $offset = null, $search = nu * * Find user profiles * + * @param float $limit limit (optional, default to 20) * @param string[] $tags Filter by profile tag ids (optional) - * @param string $search Search term to look for in firstName, lastName, email, username. (optional) + * @param float $offset offset (optional) + * @param string $search Search term to look for in firstName, lastName and username (optional) + * @param string $division Division key to filter profiles. Only include profiles that are member of given division. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findProfiles'] to see the possible values for this operation * * @throws \Verdigado\GrueneApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Verdigado\GrueneApiClient\models\FindProfilesResponse */ - public function findProfiles($tags = null, $search = null, string $contentType = self::contentTypes['findProfiles'][0]) + public function findProfiles($limit = 20, $tags = null, $offset = null, $search = null, $division = null, string $contentType = self::contentTypes['findProfiles'][0]) { - list($response) = $this->findProfilesWithHttpInfo($tags, $search, $contentType); + list($response) = $this->findProfilesWithHttpInfo($limit, $tags, $offset, $search, $division, $contentType); return $response; } @@ -1329,17 +1386,20 @@ public function findProfiles($tags = null, $search = null, string $contentType = * * Find user profiles * + * @param float $limit (optional, default to 20) * @param string[] $tags Filter by profile tag ids (optional) - * @param string $search Search term to look for in firstName, lastName, email, username. (optional) + * @param float $offset (optional) + * @param string $search Search term to look for in firstName, lastName and username (optional) + * @param string $division Division key to filter profiles. Only include profiles that are member of given division. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findProfiles'] to see the possible values for this operation * * @throws \Verdigado\GrueneApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Verdigado\GrueneApiClient\models\FindProfilesResponse, HTTP status code, HTTP response headers (array of strings) */ - public function findProfilesWithHttpInfo($tags = null, $search = null, string $contentType = self::contentTypes['findProfiles'][0]) + public function findProfilesWithHttpInfo($limit = 20, $tags = null, $offset = null, $search = null, $division = null, string $contentType = self::contentTypes['findProfiles'][0]) { - $request = $this->findProfilesRequest($tags, $search, $contentType); + $request = $this->findProfilesRequest($limit, $tags, $offset, $search, $division, $contentType); try { $options = $this->createHttpClientOption(); @@ -1430,16 +1490,19 @@ public function findProfilesWithHttpInfo($tags = null, $search = null, string $c * * Find user profiles * + * @param float $limit (optional, default to 20) * @param string[] $tags Filter by profile tag ids (optional) - * @param string $search Search term to look for in firstName, lastName, email, username. (optional) + * @param float $offset (optional) + * @param string $search Search term to look for in firstName, lastName and username (optional) + * @param string $division Division key to filter profiles. Only include profiles that are member of given division. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findProfiles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findProfilesAsync($tags = null, $search = null, string $contentType = self::contentTypes['findProfiles'][0]) + public function findProfilesAsync($limit = 20, $tags = null, $offset = null, $search = null, $division = null, string $contentType = self::contentTypes['findProfiles'][0]) { - return $this->findProfilesAsyncWithHttpInfo($tags, $search, $contentType) + return $this->findProfilesAsyncWithHttpInfo($limit, $tags, $offset, $search, $division, $contentType) ->then( function ($response) { return $response[0]; @@ -1452,17 +1515,20 @@ function ($response) { * * Find user profiles * + * @param float $limit (optional, default to 20) * @param string[] $tags Filter by profile tag ids (optional) - * @param string $search Search term to look for in firstName, lastName, email, username. (optional) + * @param float $offset (optional) + * @param string $search Search term to look for in firstName, lastName and username (optional) + * @param string $division Division key to filter profiles. Only include profiles that are member of given division. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findProfiles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findProfilesAsyncWithHttpInfo($tags = null, $search = null, string $contentType = self::contentTypes['findProfiles'][0]) + public function findProfilesAsyncWithHttpInfo($limit = 20, $tags = null, $offset = null, $search = null, $division = null, string $contentType = self::contentTypes['findProfiles'][0]) { $returnType = '\Verdigado\GrueneApiClient\models\FindProfilesResponse'; - $request = $this->findProfilesRequest($tags, $search, $contentType); + $request = $this->findProfilesRequest($limit, $tags, $offset, $search, $division, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1503,16 +1569,28 @@ function ($exception) { /** * Create request for operation 'findProfiles' * + * @param float $limit (optional, default to 20) * @param string[] $tags Filter by profile tag ids (optional) - * @param string $search Search term to look for in firstName, lastName, email, username. (optional) + * @param float $offset (optional) + * @param string $search Search term to look for in firstName, lastName and username (optional) + * @param string $division Division key to filter profiles. Only include profiles that are member of given division. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findProfiles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findProfilesRequest($tags = null, $search = null, string $contentType = self::contentTypes['findProfiles'][0]) + public function findProfilesRequest($limit = 20, $tags = null, $offset = null, $search = null, $division = null, string $contentType = self::contentTypes['findProfiles'][0]) { + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ProfilesApi.findProfiles, must be bigger than or equal to 1.'); + } + + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling ProfilesApi.findProfiles, must be bigger than or equal to 0.'); + } + @@ -1523,6 +1601,15 @@ public function findProfilesRequest($tags = null, $search = null, string $conten $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $tags, @@ -1533,6 +1620,15 @@ public function findProfilesRequest($tags = null, $search = null, string $conten false // required ) ?? []); // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offset, + 'offset', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( $search, 'search', // param base name @@ -1541,6 +1637,15 @@ public function findProfilesRequest($tags = null, $search = null, string $conten true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $division, + 'division', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); diff --git a/lib/models/FindProfilesResponse.php b/lib/models/FindProfilesResponse.php index faa6c4a..ff0dacd 100644 --- a/lib/models/FindProfilesResponse.php +++ b/lib/models/FindProfilesResponse.php @@ -57,7 +57,8 @@ class FindProfilesResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'data' => '\Verdigado\GrueneApiClient\models\PublicProfile[]' + 'data' => '\Verdigado\GrueneApiClient\models\PublicProfile[]', + 'meta' => '\Verdigado\GrueneApiClient\models\FindProfilesResponseMeta' ]; /** @@ -68,7 +69,8 @@ class FindProfilesResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'data' => null + 'data' => null, + 'meta' => null ]; /** @@ -77,7 +79,8 @@ class FindProfilesResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'data' => false + 'data' => false, + 'meta' => false ]; /** @@ -166,7 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'data' => 'data' + 'data' => 'data', + 'meta' => 'meta' ]; /** @@ -175,7 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'data' => 'setData' + 'data' => 'setData', + 'meta' => 'setMeta' ]; /** @@ -184,7 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'data' => 'getData' + 'data' => 'getData', + 'meta' => 'getMeta' ]; /** @@ -245,6 +251,7 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('meta', $data ?? [], null); } /** @@ -277,6 +284,9 @@ public function listInvalidProperties() if ($this->container['data'] === null) { $invalidProperties[] = "'data' can't be null"; } + if ($this->container['meta'] === null) { + $invalidProperties[] = "'meta' can't be null"; + } return $invalidProperties; } @@ -318,6 +328,33 @@ public function setData($data) return $this; } + + /** + * Gets meta + * + * @return \Verdigado\GrueneApiClient\models\FindProfilesResponseMeta + */ + public function getMeta() + { + return $this->container['meta']; + } + + /** + * Sets meta + * + * @param \Verdigado\GrueneApiClient\models\FindProfilesResponseMeta $meta meta + * + * @return self + */ + public function setMeta($meta) + { + if (is_null($meta)) { + throw new \InvalidArgumentException('non-nullable meta cannot be null'); + } + $this->container['meta'] = $meta; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/models/FindProfilesResponseMeta.php b/lib/models/FindProfilesResponseMeta.php new file mode 100644 index 0000000..8920caf --- /dev/null +++ b/lib/models/FindProfilesResponseMeta.php @@ -0,0 +1,511 @@ +OpenAPI Spec in JSON
OpenAPI Spec in YAML
### Offboarding Every service conntected to Grünes Netz needs to remove users when they are removed from `saml.gruene.de`. Connected services need to pull a list of users waiting for removal at least once a week. api.gruene.de needs to be informed whether the user did not exist or was removed. API tokens can be obtained from `technik@verdigado.com`. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.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 Verdigado\GrueneApiClient\models; + +use \ArrayAccess; +use \Verdigado\GrueneApiClient\ObjectSerializer; + +/** + * FindProfilesResponseMeta Class Doc Comment + * + * @category Class + * @package Verdigado\GrueneApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class FindProfilesResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FindProfilesResponse_meta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'float', + 'offset' => 'float', + 'limit' => 'float', + 'has_next' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'offset' => null, + 'limit' => null, + 'has_next' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false, + 'offset' => false, + 'limit' => false, + 'has_next' => 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 = [ + 'count' => 'count', + 'offset' => 'offset', + 'limit' => 'limit', + 'has_next' => 'hasNext' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'offset' => 'setOffset', + 'limit' => 'setLimit', + 'has_next' => 'setHasNext' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'offset' => 'getOffset', + 'limit' => 'getLimit', + 'has_next' => 'getHasNext' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('count', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('has_next', $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 count + * + * @return float|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param float|null $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets offset + * + * @return float|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param float|null $offset offset + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets limit + * + * @return float|null + */ + public function getLimit() + { + return $this->container['limit']; + } + + /** + * Sets limit + * + * @param float|null $limit limit + * + * @return self + */ + public function setLimit($limit) + { + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); + } + $this->container['limit'] = $limit; + + return $this; + } + + /** + * Gets has_next + * + * @return bool|null + */ + public function getHasNext() + { + return $this->container['has_next']; + } + + /** + * Sets has_next + * + * @param bool|null $has_next has_next + * + * @return self + */ + public function setHasNext($has_next) + { + if (is_null($has_next)) { + throw new \InvalidArgumentException('non-nullable has_next cannot be null'); + } + $this->container['has_next'] = $has_next; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($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 $offset Offset + * + * @return void + */ + public function offsetUnset($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)); + } +} + + diff --git a/lib/models/ProfilePrivacySettings.php b/lib/models/ProfilePrivacySettings.php index 7c84a94..4161a0a 100644 --- a/lib/models/ProfilePrivacySettings.php +++ b/lib/models/ProfilePrivacySettings.php @@ -244,17 +244,17 @@ public function getModelName() public const OVERALL__PUBLIC = 'PUBLIC'; public const OVERALL_BV_WIDE = 'BV_WIDE'; public const OVERALL_LV_WIDE = 'LV_WIDE'; - public const OVERALL_OV_WIDE = 'OV_WIDE'; + public const OVERALL_KV_WIDE = 'KV_WIDE'; public const EMAIL__PRIVATE = 'PRIVATE'; public const EMAIL__PUBLIC = 'PUBLIC'; public const EMAIL_BV_WIDE = 'BV_WIDE'; public const EMAIL_LV_WIDE = 'LV_WIDE'; - public const EMAIL_OV_WIDE = 'OV_WIDE'; + public const EMAIL_KV_WIDE = 'KV_WIDE'; public const CHATBEGRUENUNG__PRIVATE = 'PRIVATE'; public const CHATBEGRUENUNG__PUBLIC = 'PUBLIC'; public const CHATBEGRUENUNG_BV_WIDE = 'BV_WIDE'; public const CHATBEGRUENUNG_LV_WIDE = 'LV_WIDE'; - public const CHATBEGRUENUNG_OV_WIDE = 'OV_WIDE'; + public const CHATBEGRUENUNG_KV_WIDE = 'KV_WIDE'; /** * Gets allowable values of the enum @@ -268,7 +268,7 @@ public function getOverallAllowableValues() self::OVERALL__PUBLIC, self::OVERALL_BV_WIDE, self::OVERALL_LV_WIDE, - self::OVERALL_OV_WIDE, + self::OVERALL_KV_WIDE, ]; } @@ -284,7 +284,7 @@ public function getEmailAllowableValues() self::EMAIL__PUBLIC, self::EMAIL_BV_WIDE, self::EMAIL_LV_WIDE, - self::EMAIL_OV_WIDE, + self::EMAIL_KV_WIDE, ]; } @@ -300,7 +300,7 @@ public function getChatbegruenungAllowableValues() self::CHATBEGRUENUNG__PUBLIC, self::CHATBEGRUENUNG_BV_WIDE, self::CHATBEGRUENUNG_LV_WIDE, - self::CHATBEGRUENUNG_OV_WIDE, + self::CHATBEGRUENUNG_KV_WIDE, ]; } diff --git a/test/Model/FindProfilesResponseMetaTest.php b/test/Model/FindProfilesResponseMetaTest.php new file mode 100644 index 0000000..75ddf25 --- /dev/null +++ b/test/Model/FindProfilesResponseMetaTest.php @@ -0,0 +1,117 @@ +OpenAPI Spec in JSON
OpenAPI Spec in YAML
### Offboarding Every service conntected to Grünes Netz needs to remove users when they are removed from `saml.gruene.de`. Connected services need to pull a list of users waiting for removal at least once a week. api.gruene.de needs to be informed whether the user did not exist or was removed. API tokens can be obtained from `technik@verdigado.com`. + * + * The version of the OpenAPI document: 0.1.0 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 6.4.0 + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. + */ + +namespace Verdigado\GrueneApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * FindProfilesResponseMetaTest Class Doc Comment + * + * @category Class + * @description FindProfilesResponseMeta + * @package Verdigado\GrueneApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class FindProfilesResponseMetaTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "FindProfilesResponseMeta" + */ + public function testFindProfilesResponseMeta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offset" + */ + public function testPropertyOffset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "limit" + */ + public function testPropertyLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "has_next" + */ + public function testPropertyHasNext() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +}