diff --git a/src/Clients/VaultDataManagerClient/.gitignore b/src/Clients/VaultDataManagerClient/.gitignore new file mode 100644 index 0000000..9f1681c --- /dev/null +++ b/src/Clients/VaultDataManagerClient/.gitignore @@ -0,0 +1,15 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/src/Clients/VaultDataManagerClient/.openapi-generator-ignore b/src/Clients/VaultDataManagerClient/.openapi-generator-ignore new file mode 100644 index 0000000..beeae89 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/.openapi-generator-ignore @@ -0,0 +1,38 @@ +# IMPORTANT: this file is generated with the option `openapiGeneratorIgnoreList` enabled +# (--openapi-generator-ignore-list in CLI for example) so the entries below are pre-populated based +# on the input provided by the users and this file will be overwritten every time when the option is +# enabled (which is the exact opposite of the default behaviour to not overwrite +# .openapi-generator-ignore if the file exists). + +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +# The following entries are pre-populated based on the input obtained via +# the option `openapiGeneratorIgnoreList` (--openapi-generator-ignore-list in CLI for example). +github +travis.yaml +git_push.sh +.gitlab-ci.yml +.travis.yml +composer.json diff --git a/src/Clients/VaultDataManagerClient/.openapi-generator/FILES b/src/Clients/VaultDataManagerClient/.openapi-generator/FILES new file mode 100644 index 0000000..6df49bc --- /dev/null +++ b/src/Clients/VaultDataManagerClient/.openapi-generator/FILES @@ -0,0 +1,162 @@ +.gitignore +.php-cs-fixer.dist.php +README.md +docs/Api/ConfigApi.md +docs/Api/FilesApi.md +docs/Api/NodesApi.md +docs/Api/ProfileDataApi.md +docs/Model/AwsCredentialExchangeOperationOK.md +docs/Model/ConsumerMetadataDto.md +docs/Model/CorsAwsCredentialExchangeOK.md +docs/Model/CorsDeleteNodeOK.md +docs/Model/CorsGetConfigOK.md +docs/Model/CorsGetScannedFileInfoOK.md +docs/Model/CorsGetWellKnownJwksOK.md +docs/Model/CorsInitNodesOK.md +docs/Model/CorsListNodeChildrenOK.md +docs/Model/CorsListRootNodeChildrenOK.md +docs/Model/CorsListScannedFilesOK.md +docs/Model/CorsMoveNodeOK.md +docs/Model/CorsPermanentlyDeleteNodeOK.md +docs/Model/CorsRestoreNodeFromTrashbinOK.md +docs/Model/CorsStartFileScanOK.md +docs/Model/CorsUpdateProfileDataOK.md +docs/Model/CreateNodeInput.md +docs/Model/CreateNodeOK.md +docs/Model/DeleteNodeDto.md +docs/Model/EdekInfo.md +docs/Model/GetConfigOK.md +docs/Model/GetDetailedNodeInfoOK.md +docs/Model/GetScannedFileInfoOK.md +docs/Model/InitNodesOK.md +docs/Model/InvalidParameterError.md +docs/Model/InvalidParameterErrorDetailsInner.md +docs/Model/JsonWebKeyDto.md +docs/Model/JsonWebKeySetDto.md +docs/Model/ListNodeChildrenOK.md +docs/Model/ListRootNodeChildrenOK.md +docs/Model/ListScannedFilesOK.md +docs/Model/ListScannedFilesOKScannedFilesInner.md +docs/Model/MoveNodeDto.md +docs/Model/MoveNodeInput.md +docs/Model/NodeDto.md +docs/Model/NodeStatus.md +docs/Model/NodeType.md +docs/Model/NotFoundError.md +docs/Model/QueryProfileDataOK.md +docs/Model/RestoreNodeFromTrashbin.md +docs/Model/StartFileScanInput.md +docs/Model/StartFileScanOK.md +docs/Model/UnexpectedError.md +docs/Model/UpdateNodeInput.md +docs/Model/UpdateProfileDataInput.md +docs/Model/UpdateProfileDataOK.md +lib/Api/ConfigApi.php +lib/Api/FilesApi.php +lib/Api/NodesApi.php +lib/Api/ProfileDataApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/InvalidJwtTokenError.php +lib/InvalidParameterError.php +lib/Model/AwsCredentialExchangeOperationOK.php +lib/Model/ConsumerMetadataDto.php +lib/Model/CorsAwsCredentialExchangeOK.php +lib/Model/CorsDeleteNodeOK.php +lib/Model/CorsGetConfigOK.php +lib/Model/CorsGetScannedFileInfoOK.php +lib/Model/CorsGetWellKnownJwksOK.php +lib/Model/CorsInitNodesOK.php +lib/Model/CorsListNodeChildrenOK.php +lib/Model/CorsListRootNodeChildrenOK.php +lib/Model/CorsListScannedFilesOK.php +lib/Model/CorsMoveNodeOK.php +lib/Model/CorsPermanentlyDeleteNodeOK.php +lib/Model/CorsRestoreNodeFromTrashbinOK.php +lib/Model/CorsStartFileScanOK.php +lib/Model/CorsUpdateProfileDataOK.php +lib/Model/CreateNodeInput.php +lib/Model/CreateNodeOK.php +lib/Model/DeleteNodeDto.php +lib/Model/EdekInfo.php +lib/Model/GetConfigOK.php +lib/Model/GetDetailedNodeInfoOK.php +lib/Model/GetScannedFileInfoOK.php +lib/Model/InitNodesOK.php +lib/Model/InvalidParameterError.php +lib/Model/InvalidParameterErrorDetailsInner.php +lib/Model/JsonWebKeyDto.php +lib/Model/JsonWebKeySetDto.php +lib/Model/ListNodeChildrenOK.php +lib/Model/ListRootNodeChildrenOK.php +lib/Model/ListScannedFilesOK.php +lib/Model/ListScannedFilesOKScannedFilesInner.php +lib/Model/ModelInterface.php +lib/Model/MoveNodeDto.php +lib/Model/MoveNodeInput.php +lib/Model/NodeDto.php +lib/Model/NodeStatus.php +lib/Model/NodeType.php +lib/Model/NotFoundError.php +lib/Model/QueryProfileDataOK.php +lib/Model/RestoreNodeFromTrashbin.php +lib/Model/StartFileScanInput.php +lib/Model/StartFileScanOK.php +lib/Model/UnexpectedError.php +lib/Model/UpdateNodeInput.php +lib/Model/UpdateProfileDataInput.php +lib/Model/UpdateProfileDataOK.php +lib/NotFoundError.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/ConfigApiTest.php +test/Api/FilesApiTest.php +test/Api/NodesApiTest.php +test/Api/ProfileDataApiTest.php +test/Model/AwsCredentialExchangeOperationOKTest.php +test/Model/ConsumerMetadataDtoTest.php +test/Model/CorsAwsCredentialExchangeOKTest.php +test/Model/CorsDeleteNodeOKTest.php +test/Model/CorsGetConfigOKTest.php +test/Model/CorsGetScannedFileInfoOKTest.php +test/Model/CorsGetWellKnownJwksOKTest.php +test/Model/CorsInitNodesOKTest.php +test/Model/CorsListNodeChildrenOKTest.php +test/Model/CorsListRootNodeChildrenOKTest.php +test/Model/CorsListScannedFilesOKTest.php +test/Model/CorsMoveNodeOKTest.php +test/Model/CorsPermanentlyDeleteNodeOKTest.php +test/Model/CorsRestoreNodeFromTrashbinOKTest.php +test/Model/CorsStartFileScanOKTest.php +test/Model/CorsUpdateProfileDataOKTest.php +test/Model/CreateNodeInputTest.php +test/Model/CreateNodeOKTest.php +test/Model/DeleteNodeDtoTest.php +test/Model/EdekInfoTest.php +test/Model/GetConfigOKTest.php +test/Model/GetDetailedNodeInfoOKTest.php +test/Model/GetScannedFileInfoOKTest.php +test/Model/InitNodesOKTest.php +test/Model/InvalidParameterErrorDetailsInnerTest.php +test/Model/InvalidParameterErrorTest.php +test/Model/JsonWebKeyDtoTest.php +test/Model/JsonWebKeySetDtoTest.php +test/Model/ListNodeChildrenOKTest.php +test/Model/ListRootNodeChildrenOKTest.php +test/Model/ListScannedFilesOKScannedFilesInnerTest.php +test/Model/ListScannedFilesOKTest.php +test/Model/MoveNodeDtoTest.php +test/Model/MoveNodeInputTest.php +test/Model/NodeDtoTest.php +test/Model/NodeStatusTest.php +test/Model/NodeTypeTest.php +test/Model/NotFoundErrorTest.php +test/Model/QueryProfileDataOKTest.php +test/Model/RestoreNodeFromTrashbinTest.php +test/Model/StartFileScanInputTest.php +test/Model/StartFileScanOKTest.php +test/Model/UnexpectedErrorTest.php +test/Model/UpdateNodeInputTest.php +test/Model/UpdateProfileDataInputTest.php +test/Model/UpdateProfileDataOKTest.php diff --git a/src/Clients/VaultDataManagerClient/.openapi-generator/VERSION b/src/Clients/VaultDataManagerClient/.openapi-generator/VERSION new file mode 100644 index 0000000..4bc5d61 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0 diff --git a/src/Clients/VaultDataManagerClient/.php-cs-fixer.dist.php b/src/Clients/VaultDataManagerClient/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/src/Clients/VaultDataManagerClient/README.md b/src/Clients/VaultDataManagerClient/README.md new file mode 100644 index 0000000..b0ee032 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/README.md @@ -0,0 +1,194 @@ +# vault-data-manager-client + + +For more information, please visit [https://github.com/affinidi/affinidi-tdk](https://github.com/affinidi/affinidi-tdk). + +## Installation & Usage + +### Requirements + +PHP 7.4 and later. +Should also work with PHP 8.0. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), run: + +```bash +composer require affinidi-tdk/affinidi-tdk-php +``` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\ConfigApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getConfig(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ConfigApi->getConfig: ', $e->getMessage(), PHP_EOL; +} + +``` + +## API Endpoints + +All URIs are relative to *https://api.vault.affinidi.com/vfs* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ConfigApi* | [**getConfig**](docs/Api/ConfigApi.md#getconfig) | **GET** /v1/config | +*FilesApi* | [**getScannedFileInfo**](docs/Api/FilesApi.md#getscannedfileinfo) | **GET** /v1/scanned-files/{scannedFileJobId} | +*FilesApi* | [**listScannedFiles**](docs/Api/FilesApi.md#listscannedfiles) | **GET** /v1/scanned-files/ | +*FilesApi* | [**startFileScan**](docs/Api/FilesApi.md#startfilescan) | **POST** /v1/nodes/{nodeId}/file/scan | +*NodesApi* | [**createNode**](docs/Api/NodesApi.md#createnode) | **POST** /v1/nodes | +*NodesApi* | [**deleteNode**](docs/Api/NodesApi.md#deletenode) | **DELETE** /v1/nodes/{nodeId} | +*NodesApi* | [**getDetailedNodeInfo**](docs/Api/NodesApi.md#getdetailednodeinfo) | **GET** /v1/nodes/{nodeId} | +*NodesApi* | [**initNodes**](docs/Api/NodesApi.md#initnodes) | **POST** /v1/nodes/init | +*NodesApi* | [**listNodeChildren**](docs/Api/NodesApi.md#listnodechildren) | **GET** /v1/nodes/{nodeId}/children | +*NodesApi* | [**listRootNodeChildren**](docs/Api/NodesApi.md#listrootnodechildren) | **GET** /v1/nodes | +*NodesApi* | [**moveNode**](docs/Api/NodesApi.md#movenode) | **POST** /v1/nodes/{nodeId}/move | +*NodesApi* | [**permanentlyDeleteNode**](docs/Api/NodesApi.md#permanentlydeletenode) | **DELETE** /v1/nodes/{nodeId}/remove/{nodeIdToRemove} | +*NodesApi* | [**restoreNodeFromTrashbin**](docs/Api/NodesApi.md#restorenodefromtrashbin) | **POST** /v1/nodes/{nodeId}/restore/{nodeIdToRestore} | +*NodesApi* | [**updateNode**](docs/Api/NodesApi.md#updatenode) | **PATCH** /v1/nodes/{nodeId} | +*ProfileDataApi* | [**updateProfileData**](docs/Api/ProfileDataApi.md#updateprofiledata) | **PATCH** /v1/nodes/{nodeId}/profile-data | + +## Models + +- [AwsCredentialExchangeOperationOK](docs/Model/AwsCredentialExchangeOperationOK.md) +- [ConsumerMetadataDto](docs/Model/ConsumerMetadataDto.md) +- [CorsAwsCredentialExchangeOK](docs/Model/CorsAwsCredentialExchangeOK.md) +- [CorsDeleteNodeOK](docs/Model/CorsDeleteNodeOK.md) +- [CorsGetConfigOK](docs/Model/CorsGetConfigOK.md) +- [CorsGetScannedFileInfoOK](docs/Model/CorsGetScannedFileInfoOK.md) +- [CorsGetWellKnownJwksOK](docs/Model/CorsGetWellKnownJwksOK.md) +- [CorsInitNodesOK](docs/Model/CorsInitNodesOK.md) +- [CorsListNodeChildrenOK](docs/Model/CorsListNodeChildrenOK.md) +- [CorsListRootNodeChildrenOK](docs/Model/CorsListRootNodeChildrenOK.md) +- [CorsListScannedFilesOK](docs/Model/CorsListScannedFilesOK.md) +- [CorsMoveNodeOK](docs/Model/CorsMoveNodeOK.md) +- [CorsPermanentlyDeleteNodeOK](docs/Model/CorsPermanentlyDeleteNodeOK.md) +- [CorsRestoreNodeFromTrashbinOK](docs/Model/CorsRestoreNodeFromTrashbinOK.md) +- [CorsStartFileScanOK](docs/Model/CorsStartFileScanOK.md) +- [CorsUpdateProfileDataOK](docs/Model/CorsUpdateProfileDataOK.md) +- [CreateNodeInput](docs/Model/CreateNodeInput.md) +- [CreateNodeOK](docs/Model/CreateNodeOK.md) +- [DeleteNodeDto](docs/Model/DeleteNodeDto.md) +- [EdekInfo](docs/Model/EdekInfo.md) +- [GetConfigOK](docs/Model/GetConfigOK.md) +- [GetDetailedNodeInfoOK](docs/Model/GetDetailedNodeInfoOK.md) +- [GetScannedFileInfoOK](docs/Model/GetScannedFileInfoOK.md) +- [InitNodesOK](docs/Model/InitNodesOK.md) +- [InvalidParameterError](docs/Model/InvalidParameterError.md) +- [InvalidParameterErrorDetailsInner](docs/Model/InvalidParameterErrorDetailsInner.md) +- [JsonWebKeyDto](docs/Model/JsonWebKeyDto.md) +- [JsonWebKeySetDto](docs/Model/JsonWebKeySetDto.md) +- [ListNodeChildrenOK](docs/Model/ListNodeChildrenOK.md) +- [ListRootNodeChildrenOK](docs/Model/ListRootNodeChildrenOK.md) +- [ListScannedFilesOK](docs/Model/ListScannedFilesOK.md) +- [ListScannedFilesOKScannedFilesInner](docs/Model/ListScannedFilesOKScannedFilesInner.md) +- [MoveNodeDto](docs/Model/MoveNodeDto.md) +- [MoveNodeInput](docs/Model/MoveNodeInput.md) +- [NodeDto](docs/Model/NodeDto.md) +- [NodeStatus](docs/Model/NodeStatus.md) +- [NodeType](docs/Model/NodeType.md) +- [NotFoundError](docs/Model/NotFoundError.md) +- [QueryProfileDataOK](docs/Model/QueryProfileDataOK.md) +- [RestoreNodeFromTrashbin](docs/Model/RestoreNodeFromTrashbin.md) +- [StartFileScanInput](docs/Model/StartFileScanInput.md) +- [StartFileScanOK](docs/Model/StartFileScanOK.md) +- [UnexpectedError](docs/Model/UnexpectedError.md) +- [UpdateNodeInput](docs/Model/UpdateNodeInput.md) +- [UpdateProfileDataInput](docs/Model/UpdateProfileDataInput.md) +- [UpdateProfileDataOK](docs/Model/UpdateProfileDataOK.md) + +## Authorization + +Authentication schemes defined for the API: +### AwsSigV4 + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + + +### ApiKey + +- **Type**: API key +- **API key parameter name**: x-api-key +- **Location**: HTTP header + + +### bearerAuth + +- **Type**: Bearer authentication (JWT) + +### ConsumerTokenAuth + +- **Type**: API key +- **API key parameter name**: authorization +- **Location**: HTTP header + + +### UserTokenAuth + +- **Type**: API key +- **API key parameter name**: authorization +- **Location**: HTTP header + + +### ProjectTokenAuth + +- **Type**: API key +- **API key parameter name**: authorization +- **Location**: HTTP header + + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + +info@affinidi.com + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0.0` + - Generator version: `7.9.0` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/src/Clients/VaultDataManagerClient/docs/Api/ConfigApi.md b/src/Clients/VaultDataManagerClient/docs/Api/ConfigApi.md new file mode 100644 index 0000000..aedae87 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Api/ConfigApi.md @@ -0,0 +1,67 @@ +# AffinidiTdk\Clients\VaultDataManagerClient\ConfigApi + +All URIs are relative to https://api.vault.affinidi.com/vfs, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getConfig()**](ConfigApi.md#getConfig) | **GET** /v1/config | | + + +## `getConfig()` + +```php +getConfig(): \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK +``` + + + +Retrieves the user profile name and the maximum number of profiles, with default values set to 'default' and 1, respectively. + +### Example + +```php +setApiKey('Authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\ConfigApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getConfig(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ConfigApi->getConfig: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK**](../Model/GetConfigOK.md) + +### Authorization + +[AwsSigV4](../../README.md#AwsSigV4) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Api/FilesApi.md b/src/Clients/VaultDataManagerClient/docs/Api/FilesApi.md new file mode 100644 index 0000000..2feb388 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Api/FilesApi.md @@ -0,0 +1,197 @@ +# AffinidiTdk\Clients\VaultDataManagerClient\FilesApi + +All URIs are relative to https://api.vault.affinidi.com/vfs, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getScannedFileInfo()**](FilesApi.md#getScannedFileInfo) | **GET** /v1/scanned-files/{scannedFileJobId} | | +| [**listScannedFiles()**](FilesApi.md#listScannedFiles) | **GET** /v1/scanned-files/ | | +| [**startFileScan()**](FilesApi.md#startFileScan) | **POST** /v1/nodes/{nodeId}/file/scan | | + + +## `getScannedFileInfo()` + +```php +getScannedFileInfo($scanned_file_job_id, $exclusive_start_key): \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK +``` + + + +Get the details of a scanned file using the textract jobId + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\FilesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$scanned_file_job_id = 'scanned_file_job_id_example'; // string | Scanned file jobId. +$exclusive_start_key = 'exclusive_start_key_example'; // string | The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + +try { + $result = $apiInstance->getScannedFileInfo($scanned_file_job_id, $exclusive_start_key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->getScannedFileInfo: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **scanned_file_job_id** | **string**| Scanned file jobId. | | +| **exclusive_start_key** | **string**| The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. | [optional] | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK**](../Model/GetScannedFileInfoOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listScannedFiles()` + +```php +listScannedFiles(): \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK +``` + + + +List all the the scanned files with all the details, e.g. status and jobId + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\FilesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listScannedFiles(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->listScannedFiles: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK**](../Model/ListScannedFilesOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `startFileScan()` + +```php +startFileScan($node_id, $start_file_scan_input): \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK +``` + + + +Start a scan of the file under this node and provide a textract job + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\FilesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string | Description for nodeId. +$start_file_scan_input = new \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput(); // \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput | StartFileScan + +try { + $result = $apiInstance->startFileScan($node_id, $start_file_scan_input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->startFileScan: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| Description for nodeId. | | +| **start_file_scan_input** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput**](../Model/StartFileScanInput.md)| StartFileScan | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK**](../Model/StartFileScanOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Api/NodesApi.md b/src/Clients/VaultDataManagerClient/docs/Api/NodesApi.md new file mode 100644 index 0000000..7587646 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Api/NodesApi.md @@ -0,0 +1,646 @@ +# AffinidiTdk\Clients\VaultDataManagerClient\NodesApi + +All URIs are relative to https://api.vault.affinidi.com/vfs, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createNode()**](NodesApi.md#createNode) | **POST** /v1/nodes | | +| [**deleteNode()**](NodesApi.md#deleteNode) | **DELETE** /v1/nodes/{nodeId} | | +| [**getDetailedNodeInfo()**](NodesApi.md#getDetailedNodeInfo) | **GET** /v1/nodes/{nodeId} | | +| [**initNodes()**](NodesApi.md#initNodes) | **POST** /v1/nodes/init | | +| [**listNodeChildren()**](NodesApi.md#listNodeChildren) | **GET** /v1/nodes/{nodeId}/children | | +| [**listRootNodeChildren()**](NodesApi.md#listRootNodeChildren) | **GET** /v1/nodes | | +| [**moveNode()**](NodesApi.md#moveNode) | **POST** /v1/nodes/{nodeId}/move | | +| [**permanentlyDeleteNode()**](NodesApi.md#permanentlyDeleteNode) | **DELETE** /v1/nodes/{nodeId}/remove/{nodeIdToRemove} | | +| [**restoreNodeFromTrashbin()**](NodesApi.md#restoreNodeFromTrashbin) | **POST** /v1/nodes/{nodeId}/restore/{nodeIdToRestore} | | +| [**updateNode()**](NodesApi.md#updateNode) | **PATCH** /v1/nodes/{nodeId} | | + + +## `createNode()` + +```php +createNode($create_node_input): \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK +``` + + + +creates node + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_node_input = new \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput(); // \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput | CreateNode + +try { + $result = $apiInstance->createNode($create_node_input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->createNode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_node_input** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput**](../Model/CreateNodeInput.md)| CreateNode | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK**](../Model/CreateNodeOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteNode()` + +```php +deleteNode($node_id): \AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto +``` + + + +Mark a node and any attached files for deletion. If the node is a folder, perform the same action for all its children if the profile type is PROFILE, VC_ROOT, or VC. For other node types, move them to the TRASH_BIN node. + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string + +try { + $result = $apiInstance->deleteNode($node_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->deleteNode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto**](../Model/DeleteNodeDto.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDetailedNodeInfo()` + +```php +getDetailedNodeInfo($node_id, $dek): \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK +``` + + + +Gets detailed information about the node + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string +$dek = 'dek_example'; // string | A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided + +try { + $result = $apiInstance->getDetailedNodeInfo($node_id, $dek); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->getDetailedNodeInfo: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| | | +| **dek** | **string**| A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided | [optional] | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK**](../Model/GetDetailedNodeInfoOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `initNodes()` + +```php +initNodes(): \AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK +``` + + + +Initialize root node, and TRASH_BIN + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->initNodes(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->initNodes: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK**](../Model/InitNodesOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listNodeChildren()` + +```php +listNodeChildren($node_id, $limit, $exclusive_start_key): \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK +``` + + + +lists children of the node + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string | Description for nodeId. +$limit = 10; // int | Maximum number of records to fetch in a list +$exclusive_start_key = 'exclusive_start_key_example'; // string | exclusiveStartKey for retrieving the next batch of data. + +try { + $result = $apiInstance->listNodeChildren($node_id, $limit, $exclusive_start_key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->listNodeChildren: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| Description for nodeId. | | +| **limit** | **int**| Maximum number of records to fetch in a list | [optional] [default to 10] | +| **exclusive_start_key** | **string**| exclusiveStartKey for retrieving the next batch of data. | [optional] | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK**](../Model/ListNodeChildrenOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listRootNodeChildren()` + +```php +listRootNodeChildren(): \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK +``` + + + +lists children of the root node for the consumer + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listRootNodeChildren(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->listRootNodeChildren: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK**](../Model/ListRootNodeChildrenOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `moveNode()` + +```php +moveNode($node_id, $move_node_input): \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto +``` + + + +Moves a node from source to destination along with the hierarchy + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string +$move_node_input = new \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput(); // \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput | MoveNode + +try { + $result = $apiInstance->moveNode($node_id, $move_node_input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->moveNode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| | | +| **move_node_input** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput**](../Model/MoveNodeInput.md)| MoveNode | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto**](../Model/MoveNodeDto.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `permanentlyDeleteNode()` + +```php +permanentlyDeleteNode($node_id, $node_id_to_remove) +``` + + + +Permanently delete a node from TRASH_BIN, if the node is not in the TRASH_BIN it cannot delete. + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string | nodeId of the TRASH_BIN +$node_id_to_remove = 'node_id_to_remove_example'; // string | nodeId of the node to be deleted from TRASH_BIN + +try { + $apiInstance->permanentlyDeleteNode($node_id, $node_id_to_remove); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->permanentlyDeleteNode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| nodeId of the TRASH_BIN | | +| **node_id_to_remove** | **string**| nodeId of the node to be deleted from TRASH_BIN | | + +### Return type + +void (empty response body) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `restoreNodeFromTrashbin()` + +```php +restoreNodeFromTrashbin($node_id, $node_id_to_restore, $restore_node_from_trashbin): \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto +``` + + + +Restore node marked for deletion from TRASH_BIN + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string | nodeId of the TRASH_BIN +$node_id_to_restore = 'node_id_to_restore_example'; // string | nodeId of the node to be restored from TRASH_BIN +$restore_node_from_trashbin = new \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin(); // \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin | RestoreNodeFromTrashbin + +try { + $result = $apiInstance->restoreNodeFromTrashbin($node_id, $node_id_to_restore, $restore_node_from_trashbin); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->restoreNodeFromTrashbin: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| nodeId of the TRASH_BIN | | +| **node_id_to_restore** | **string**| nodeId of the node to be restored from TRASH_BIN | | +| **restore_node_from_trashbin** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin**](../Model/RestoreNodeFromTrashbin.md)| RestoreNodeFromTrashbin | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto**](../Model/MoveNodeDto.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateNode()` + +```php +updateNode($node_id, $update_node_input): \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto +``` + + + +Updates a node + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\NodesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string | Description for nodeId. +$update_node_input = new \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput(); // \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput | UpdateNodeInput + +try { + $result = $apiInstance->updateNode($node_id, $update_node_input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling NodesApi->updateNode: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| Description for nodeId. | | +| **update_node_input** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput**](../Model/UpdateNodeInput.md)| UpdateNodeInput | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto**](../Model/NodeDto.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Api/ProfileDataApi.md b/src/Clients/VaultDataManagerClient/docs/Api/ProfileDataApi.md new file mode 100644 index 0000000..18450f1 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Api/ProfileDataApi.md @@ -0,0 +1,72 @@ +# AffinidiTdk\Clients\VaultDataManagerClient\ProfileDataApi + +All URIs are relative to https://api.vault.affinidi.com/vfs, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**updateProfileData()**](ProfileDataApi.md#updateProfileData) | **PATCH** /v1/nodes/{nodeId}/profile-data | | + + +## `updateProfileData()` + +```php +updateProfileData($node_id, $update_profile_data_input): \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK +``` + + + +Updates the profile with the given data + +### Example + +```php +setApiKey('authorization', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = AffinidiTdk\Clients\VaultDataManagerClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('authorization', 'Bearer'); + + +$apiInstance = new AffinidiTdk\Clients\VaultDataManagerClient\Api\ProfileDataApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$node_id = 'node_id_example'; // string +$update_profile_data_input = new \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput(); // \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput | Updates the schema with the given data + +try { + $result = $apiInstance->updateProfileData($node_id, $update_profile_data_input); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProfileDataApi->updateProfileData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **node_id** | **string**| | | +| **update_profile_data_input** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput**](../Model/UpdateProfileDataInput.md)| Updates the schema with the given data | | + +### Return type + +[**\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK**](../Model/UpdateProfileDataOK.md) + +### Authorization + +[ConsumerTokenAuth](../../README.md#ConsumerTokenAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/AwsCredentialExchangeOperationOK.md b/src/Clients/VaultDataManagerClient/docs/Model/AwsCredentialExchangeOperationOK.md new file mode 100644 index 0000000..b7da07e --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/AwsCredentialExchangeOperationOK.md @@ -0,0 +1,10 @@ +# # AwsCredentialExchangeOperationOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **string** | | +**identity_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/ConsumerMetadataDto.md b/src/Clients/VaultDataManagerClient/docs/Model/ConsumerMetadataDto.md new file mode 100644 index 0000000..4fd8a52 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/ConsumerMetadataDto.md @@ -0,0 +1,22 @@ +# # ConsumerMetadataDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**node_id** | **string** | | +**status** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus**](NodeStatus.md) | | +**file_count** | **float** | | [optional] +**folder_count** | **float** | | [optional] +**profile_count** | **float** | | [optional] +**name** | **string** | | +**consumer_id** | **string** | | +**created_at** | **string** | [GEN] ISO 8601 string of the creation date/time the entity | +**modified_at** | **string** | [GEN] ISO 8601 string of the modification date/time the entity | +**created_by** | **string** | [GEN] Identifier of the user who created the entity | +**modified_by** | **string** | [GEN] Identifier of the user who last updated the entity | +**description** | **string** | Description of the node | +**type** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType**](NodeType.md) | | +**consumed_file_storage** | **float** | Tracks the amount of bytes used by the stored data. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsAwsCredentialExchangeOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsAwsCredentialExchangeOK.md new file mode 100644 index 0000000..303d1b9 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsAwsCredentialExchangeOK.md @@ -0,0 +1,9 @@ +# # CorsAwsCredentialExchangeOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_aws_credential_exchange_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsDeleteNodeOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsDeleteNodeOK.md new file mode 100644 index 0000000..158262d --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsDeleteNodeOK.md @@ -0,0 +1,9 @@ +# # CorsDeleteNodeOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_delete_node_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsGetConfigOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsGetConfigOK.md new file mode 100644 index 0000000..f224ca0 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsGetConfigOK.md @@ -0,0 +1,9 @@ +# # CorsGetConfigOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_get_config_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsGetScannedFileInfoOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsGetScannedFileInfoOK.md new file mode 100644 index 0000000..5c36221 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsGetScannedFileInfoOK.md @@ -0,0 +1,9 @@ +# # CorsGetScannedFileInfoOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_get_scanned_file_info_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsGetWellKnownJwksOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsGetWellKnownJwksOK.md new file mode 100644 index 0000000..0316213 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsGetWellKnownJwksOK.md @@ -0,0 +1,9 @@ +# # CorsGetWellKnownJwksOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_get_well_known_jwks_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsInitNodesOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsInitNodesOK.md new file mode 100644 index 0000000..21fbdfb --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsInitNodesOK.md @@ -0,0 +1,9 @@ +# # CorsInitNodesOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_init_nodes_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsListNodeChildrenOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsListNodeChildrenOK.md new file mode 100644 index 0000000..5dbbe63 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsListNodeChildrenOK.md @@ -0,0 +1,9 @@ +# # CorsListNodeChildrenOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_list_node_children_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsListRootNodeChildrenOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsListRootNodeChildrenOK.md new file mode 100644 index 0000000..fffe6de --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsListRootNodeChildrenOK.md @@ -0,0 +1,9 @@ +# # CorsListRootNodeChildrenOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_list_root_node_children_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsListScannedFilesOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsListScannedFilesOK.md new file mode 100644 index 0000000..3530d8a --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsListScannedFilesOK.md @@ -0,0 +1,9 @@ +# # CorsListScannedFilesOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_list_scanned_files_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsMoveNodeOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsMoveNodeOK.md new file mode 100644 index 0000000..3a1963d --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsMoveNodeOK.md @@ -0,0 +1,9 @@ +# # CorsMoveNodeOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_move_node_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsPermanentlyDeleteNodeOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsPermanentlyDeleteNodeOK.md new file mode 100644 index 0000000..33003c8 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsPermanentlyDeleteNodeOK.md @@ -0,0 +1,9 @@ +# # CorsPermanentlyDeleteNodeOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_permanently_delete_node_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsRestoreNodeFromTrashbinOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsRestoreNodeFromTrashbinOK.md new file mode 100644 index 0000000..def89a9 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsRestoreNodeFromTrashbinOK.md @@ -0,0 +1,9 @@ +# # CorsRestoreNodeFromTrashbinOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_restore_node_from_trashbin_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsStartFileScanOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsStartFileScanOK.md new file mode 100644 index 0000000..93481bc --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsStartFileScanOK.md @@ -0,0 +1,9 @@ +# # CorsStartFileScanOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_start_file_scan_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CorsUpdateProfileDataOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CorsUpdateProfileDataOK.md new file mode 100644 index 0000000..f634e64 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CorsUpdateProfileDataOK.md @@ -0,0 +1,9 @@ +# # CorsUpdateProfileDataOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cors_update_profile_data_ok** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CreateNodeInput.md b/src/Clients/VaultDataManagerClient/docs/Model/CreateNodeInput.md new file mode 100644 index 0000000..e1dfdc3 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CreateNodeInput.md @@ -0,0 +1,15 @@ +# # CreateNodeInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the item | +**type** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType**](NodeType.md) | | +**description** | **string** | description of profile if creating a new profile | [optional] +**parent_node_id** | **string** | parent node id, if not provided then root element is used | [optional] +**edek_info** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo**](EdekInfo.md) | | [optional] +**dek** | **string** | A base64 encoded data encryption key, encrypted using VFS public key, required for node types [FILE, PROFILE] | [optional] +**metadata** | **string** | metadata of the node in stringified json format | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/CreateNodeOK.md b/src/Clients/VaultDataManagerClient/docs/Model/CreateNodeOK.md new file mode 100644 index 0000000..8e2621c --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/CreateNodeOK.md @@ -0,0 +1,12 @@ +# # CreateNodeOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**node_id** | **string** | | +**url** | **string** | | [optional] +**link** | **string** | | [optional] +**fields** | **array** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/DeleteNodeDto.md b/src/Clients/VaultDataManagerClient/docs/Model/DeleteNodeDto.md new file mode 100644 index 0000000..c3e24a9 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/DeleteNodeDto.md @@ -0,0 +1,9 @@ +# # DeleteNodeDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_node_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/EdekInfo.md b/src/Clients/VaultDataManagerClient/docs/Model/EdekInfo.md new file mode 100644 index 0000000..1e65d0f --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/EdekInfo.md @@ -0,0 +1,10 @@ +# # EdekInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**edek** | **string** | | +**dekek_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/GetConfigOK.md b/src/Clients/VaultDataManagerClient/docs/Model/GetConfigOK.md new file mode 100644 index 0000000..e36f88e --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/GetConfigOK.md @@ -0,0 +1,10 @@ +# # GetConfigOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**profile_name** | **string** | | +**maximum_profiles** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/GetDetailedNodeInfoOK.md b/src/Clients/VaultDataManagerClient/docs/Model/GetDetailedNodeInfoOK.md new file mode 100644 index 0000000..7067b4b --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/GetDetailedNodeInfoOK.md @@ -0,0 +1,30 @@ +# # GetDetailedNodeInfoOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**node_id** | **string** | A unique identifier of current node | +**status** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus**](NodeStatus.md) | | +**file_count** | **float** | number of files in current node | [optional] +**profile_count** | **float** | number of profiles in current node | [optional] +**folder_count** | **float** | number of folders in current node | [optional] +**vc_count** | **float** | number of vcCount in current node | [optional] +**name** | **string** | display name of current node | +**consumer_id** | **string** | unique identifier for consumer | +**parent_node_id** | **string** | parent node path | +**profile_id** | **string** | A unique identifier of profile, under which current node is created | +**created_at** | **string** | creation date/time of the node | +**modified_at** | **string** | modification date/time of the node | +**created_by** | **string** | Identifier of the user who created the node | +**modified_by** | **string** | Identifier of the user who last updated the node | +**description** | **string** | Description of the node | +**type** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType**](NodeType.md) | | +**link** | **string** | id of the file, used for FILE node only | [optional] +**schema** | **string** | name of the schema, used for PROFILE node only | [optional] +**consumed_file_storage** | **float** | amount of bytes used by the stored data, used for ROOT_ELEMENT only for now | [optional] +**edek_info** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo**](EdekInfo.md) | | [optional] +**metadata** | **string** | A JSON string format containing metadata of the node | [optional] +**get_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/GetScannedFileInfoOK.md b/src/Clients/VaultDataManagerClient/docs/Model/GetScannedFileInfoOK.md new file mode 100644 index 0000000..97e0770 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/GetScannedFileInfoOK.md @@ -0,0 +1,16 @@ +# # GetScannedFileInfoOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | +**job_id** | **string** | A unique, randomly generated idetifier | +**status** | **string** | Status of the file scanning once initiated | +**profile_id** | **string** | A unique, randomly generated identifier | +**exclusive_start_key** | **string** | The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. | [optional] +**node_id** | **string** | A unique, randomly generated identifier | +**created_at** | **string** | | +**name** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/InitNodesOK.md b/src/Clients/VaultDataManagerClient/docs/Model/InitNodesOK.md new file mode 100644 index 0000000..3da82e8 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/InitNodesOK.md @@ -0,0 +1,10 @@ +# # InitNodesOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**consumer_metadata** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\ConsumerMetadataDto**](ConsumerMetadataDto.md) | | [optional] +**default_profile** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto**](NodeDto.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/InvalidParameterError.md b/src/Clients/VaultDataManagerClient/docs/Model/InvalidParameterError.md new file mode 100644 index 0000000..18c8aab --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/InvalidParameterError.md @@ -0,0 +1,13 @@ +# # InvalidParameterError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**message** | **string** | | +**http_status_code** | **float** | | +**trace_id** | **string** | | +**details** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]**](InvalidParameterErrorDetailsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/InvalidParameterErrorDetailsInner.md b/src/Clients/VaultDataManagerClient/docs/Model/InvalidParameterErrorDetailsInner.md new file mode 100644 index 0000000..c1b27be --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/InvalidParameterErrorDetailsInner.md @@ -0,0 +1,12 @@ +# # InvalidParameterErrorDetailsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**issue** | **string** | | +**field** | **string** | | [optional] +**value** | **string** | | [optional] +**location** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/JsonWebKeyDto.md b/src/Clients/VaultDataManagerClient/docs/Model/JsonWebKeyDto.md new file mode 100644 index 0000000..d9491ba --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/JsonWebKeyDto.md @@ -0,0 +1,17 @@ +# # JsonWebKeyDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kid** | **string** | | +**kty** | **string** | | +**n** | **string** | | [optional] +**e** | **string** | | [optional] +**x** | **string** | | [optional] +**y** | **string** | | [optional] +**crv** | **string** | | [optional] +**alg** | **string** | | +**use** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/JsonWebKeySetDto.md b/src/Clients/VaultDataManagerClient/docs/Model/JsonWebKeySetDto.md new file mode 100644 index 0000000..cd40b09 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/JsonWebKeySetDto.md @@ -0,0 +1,9 @@ +# # JsonWebKeySetDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keys** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\JsonWebKeyDto[]**](JsonWebKeyDto.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/ListNodeChildrenOK.md b/src/Clients/VaultDataManagerClient/docs/Model/ListNodeChildrenOK.md new file mode 100644 index 0000000..5018a9b --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/ListNodeChildrenOK.md @@ -0,0 +1,10 @@ +# # ListNodeChildrenOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nodes** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]**](NodeDto.md) | | [optional] +**last_evaluated_key** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/ListRootNodeChildrenOK.md b/src/Clients/VaultDataManagerClient/docs/Model/ListRootNodeChildrenOK.md new file mode 100644 index 0000000..31d8627 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/ListRootNodeChildrenOK.md @@ -0,0 +1,9 @@ +# # ListRootNodeChildrenOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nodes** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]**](NodeDto.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/ListScannedFilesOK.md b/src/Clients/VaultDataManagerClient/docs/Model/ListScannedFilesOK.md new file mode 100644 index 0000000..870cb46 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/ListScannedFilesOK.md @@ -0,0 +1,9 @@ +# # ListScannedFilesOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scanned_files** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOKScannedFilesInner[]**](ListScannedFilesOKScannedFilesInner.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/ListScannedFilesOKScannedFilesInner.md b/src/Clients/VaultDataManagerClient/docs/Model/ListScannedFilesOKScannedFilesInner.md new file mode 100644 index 0000000..d3f456c --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/ListScannedFilesOKScannedFilesInner.md @@ -0,0 +1,14 @@ +# # ListScannedFilesOKScannedFilesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_id** | **string** | A unique, randomly generated identifier | +**status** | **string** | The Status of the listed files | +**profile_id** | **string** | A unique, randomly generated identifier | +**node_id** | **string** | | +**created_at** | **string** | | +**name** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/MoveNodeDto.md b/src/Clients/VaultDataManagerClient/docs/Model/MoveNodeDto.md new file mode 100644 index 0000000..3a9b579 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/MoveNodeDto.md @@ -0,0 +1,9 @@ +# # MoveNodeDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_node_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/MoveNodeInput.md b/src/Clients/VaultDataManagerClient/docs/Model/MoveNodeInput.md new file mode 100644 index 0000000..a8d95ca --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/MoveNodeInput.md @@ -0,0 +1,10 @@ +# # MoveNodeInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination_node_id** | **string** | Parent to which current node should be moved | +**resolve_name_conflicts_automatically** | **bool** | automatically update the name of Node if target Node has children with the same name. If not provided, name won't be updated automatically | [optional] [default to false] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/NodeDto.md b/src/Clients/VaultDataManagerClient/docs/Model/NodeDto.md new file mode 100644 index 0000000..c1a8efc --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/NodeDto.md @@ -0,0 +1,29 @@ +# # NodeDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**node_id** | **string** | A unique identifier of current node | +**status** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus**](NodeStatus.md) | | +**file_count** | **float** | number of files in current node | [optional] +**profile_count** | **float** | number of profiles in current node | [optional] +**folder_count** | **float** | number of folders in current node | [optional] +**vc_count** | **float** | number of vcCount in current node | [optional] +**name** | **string** | display name of current node | +**consumer_id** | **string** | unique identifier for consumer | +**parent_node_id** | **string** | parent node path | +**profile_id** | **string** | A unique identifier of profile, under which current node is created | +**created_at** | **string** | creation date/time of the node | +**modified_at** | **string** | modification date/time of the node | +**created_by** | **string** | Identifier of the user who created the node | +**modified_by** | **string** | Identifier of the user who last updated the node | +**description** | **string** | Description of the node | +**type** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType**](NodeType.md) | | +**link** | **string** | id of the file, used for FILE node only | [optional] +**schema** | **string** | name of the schema, used for PROFILE node only | [optional] +**consumed_file_storage** | **float** | amount of bytes used by the stored data, used for ROOT_ELEMENT only for now | [optional] +**edek_info** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo**](EdekInfo.md) | | [optional] +**metadata** | **string** | A JSON string format containing metadata of the node | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/NodeStatus.md b/src/Clients/VaultDataManagerClient/docs/Model/NodeStatus.md new file mode 100644 index 0000000..24034d6 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/NodeStatus.md @@ -0,0 +1,8 @@ +# # NodeStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/NodeType.md b/src/Clients/VaultDataManagerClient/docs/Model/NodeType.md new file mode 100644 index 0000000..088904c --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/NodeType.md @@ -0,0 +1,8 @@ +# # NodeType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/NotFoundError.md b/src/Clients/VaultDataManagerClient/docs/Model/NotFoundError.md new file mode 100644 index 0000000..b396ab7 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/NotFoundError.md @@ -0,0 +1,13 @@ +# # NotFoundError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**message** | **string** | | +**http_status_code** | **float** | | +**trace_id** | **string** | | +**details** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]**](InvalidParameterErrorDetailsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/QueryProfileDataOK.md b/src/Clients/VaultDataManagerClient/docs/Model/QueryProfileDataOK.md new file mode 100644 index 0000000..a1cffb4 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/QueryProfileDataOK.md @@ -0,0 +1,9 @@ +# # QueryProfileDataOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/RestoreNodeFromTrashbin.md b/src/Clients/VaultDataManagerClient/docs/Model/RestoreNodeFromTrashbin.md new file mode 100644 index 0000000..ef77c12 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/RestoreNodeFromTrashbin.md @@ -0,0 +1,9 @@ +# # RestoreNodeFromTrashbin + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**restore_to_profile_id** | **string** | The base64 encoded nodeId of the profile which is base64 encoded, to which node will be restored | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/StartFileScanInput.md b/src/Clients/VaultDataManagerClient/docs/Model/StartFileScanInput.md new file mode 100644 index 0000000..c512148 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/StartFileScanInput.md @@ -0,0 +1,9 @@ +# # StartFileScanInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dek** | **string** | A base64 encoded data encryption key, encrypted using VFS public key. This is important as this is used when starting document scan and also while uploading the file to s3 | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/StartFileScanOK.md b/src/Clients/VaultDataManagerClient/docs/Model/StartFileScanOK.md new file mode 100644 index 0000000..c3e5980 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/StartFileScanOK.md @@ -0,0 +1,10 @@ +# # StartFileScanOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_id** | **string** | | +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/UnexpectedError.md b/src/Clients/VaultDataManagerClient/docs/Model/UnexpectedError.md new file mode 100644 index 0000000..0cba093 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/UnexpectedError.md @@ -0,0 +1,13 @@ +# # UnexpectedError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**message** | **string** | | +**http_status_code** | **float** | | +**trace_id** | **string** | | +**details** | [**\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]**](InvalidParameterErrorDetailsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/UpdateNodeInput.md b/src/Clients/VaultDataManagerClient/docs/Model/UpdateNodeInput.md new file mode 100644 index 0000000..f7150a3 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/UpdateNodeInput.md @@ -0,0 +1,11 @@ +# # UpdateNodeInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the node | [optional] +**description** | **string** | Description of the node | [optional] +**metadata** | **string** | metadata of the node in stringified json format | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/UpdateProfileDataInput.md b/src/Clients/VaultDataManagerClient/docs/Model/UpdateProfileDataInput.md new file mode 100644 index 0000000..1d1bc7d --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/UpdateProfileDataInput.md @@ -0,0 +1,10 @@ +# # UpdateProfileDataInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dek** | **string** | A base64 encoded data encryption key, encrypted using VFS public key. This is used to get profile data from s3 | +**data** | **object** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/docs/Model/UpdateProfileDataOK.md b/src/Clients/VaultDataManagerClient/docs/Model/UpdateProfileDataOK.md new file mode 100644 index 0000000..7bd7b65 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/docs/Model/UpdateProfileDataOK.md @@ -0,0 +1,9 @@ +# # UpdateProfileDataOK + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Clients/VaultDataManagerClient/lib/Api/ConfigApi.php b/src/Clients/VaultDataManagerClient/lib/Api/ConfigApi.php new file mode 100644 index 0000000..ff3e549 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Api/ConfigApi.php @@ -0,0 +1,481 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getConfig + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfig'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function getConfig(string $contentType = self::contentTypes['getConfig'][0]) + { + list($response) = $this->getConfigWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getConfigWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfig'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function getConfigWithHttpInfo(string $contentType = self::contentTypes['getConfig'][0]) + { + $request = $this->getConfigRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getConfigAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getConfigAsync(string $contentType = self::contentTypes['getConfig'][0]) + { + return $this->getConfigAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getConfigAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getConfigAsyncWithHttpInfo(string $contentType = self::contentTypes['getConfig'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetConfigOK'; + $request = $this->getConfigRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getConfig' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConfig'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getConfigRequest(string $contentType = self::contentTypes['getConfig'][0]) + { + + + $resourcePath = '/v1/config'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/Api/FilesApi.php b/src/Clients/VaultDataManagerClient/lib/Api/FilesApi.php new file mode 100644 index 0000000..082c193 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Api/FilesApi.php @@ -0,0 +1,1232 @@ + [ + 'application/json', + ], + 'listScannedFiles' => [ + 'application/json', + ], + 'startFileScan' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getScannedFileInfo + * + * @param string $scanned_file_job_id Scanned file jobId. (required) + * @param string|null $exclusive_start_key The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScannedFileInfo'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function getScannedFileInfo($scanned_file_job_id, $exclusive_start_key = null, string $contentType = self::contentTypes['getScannedFileInfo'][0]) + { + list($response) = $this->getScannedFileInfoWithHttpInfo($scanned_file_job_id, $exclusive_start_key, $contentType); + return $response; + } + + /** + * Operation getScannedFileInfoWithHttpInfo + * + * @param string $scanned_file_job_id Scanned file jobId. (required) + * @param string|null $exclusive_start_key The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScannedFileInfo'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function getScannedFileInfoWithHttpInfo($scanned_file_job_id, $exclusive_start_key = null, string $contentType = self::contentTypes['getScannedFileInfo'][0]) + { + $request = $this->getScannedFileInfoRequest($scanned_file_job_id, $exclusive_start_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getScannedFileInfoAsync + * + * @param string $scanned_file_job_id Scanned file jobId. (required) + * @param string|null $exclusive_start_key The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScannedFileInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getScannedFileInfoAsync($scanned_file_job_id, $exclusive_start_key = null, string $contentType = self::contentTypes['getScannedFileInfo'][0]) + { + return $this->getScannedFileInfoAsyncWithHttpInfo($scanned_file_job_id, $exclusive_start_key, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getScannedFileInfoAsyncWithHttpInfo + * + * @param string $scanned_file_job_id Scanned file jobId. (required) + * @param string|null $exclusive_start_key The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScannedFileInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getScannedFileInfoAsyncWithHttpInfo($scanned_file_job_id, $exclusive_start_key = null, string $contentType = self::contentTypes['getScannedFileInfo'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetScannedFileInfoOK'; + $request = $this->getScannedFileInfoRequest($scanned_file_job_id, $exclusive_start_key, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getScannedFileInfo' + * + * @param string $scanned_file_job_id Scanned file jobId. (required) + * @param string|null $exclusive_start_key The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getScannedFileInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getScannedFileInfoRequest($scanned_file_job_id, $exclusive_start_key = null, string $contentType = self::contentTypes['getScannedFileInfo'][0]) + { + + // verify the required parameter 'scanned_file_job_id' is set + if ($scanned_file_job_id === null || (is_array($scanned_file_job_id) && count($scanned_file_job_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $scanned_file_job_id when calling getScannedFileInfo' + ); + } + + + + $resourcePath = '/v1/scanned-files/{scannedFileJobId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $exclusive_start_key, + 'exclusiveStartKey', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($scanned_file_job_id !== null) { + $resourcePath = str_replace( + '{' . 'scannedFileJobId' . '}', + ObjectSerializer::toPathValue($scanned_file_job_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listScannedFiles + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScannedFiles'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function listScannedFiles(string $contentType = self::contentTypes['listScannedFiles'][0]) + { + list($response) = $this->listScannedFilesWithHttpInfo($contentType); + return $response; + } + + /** + * Operation listScannedFilesWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScannedFiles'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function listScannedFilesWithHttpInfo(string $contentType = self::contentTypes['listScannedFiles'][0]) + { + $request = $this->listScannedFilesRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listScannedFilesAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScannedFiles'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listScannedFilesAsync(string $contentType = self::contentTypes['listScannedFiles'][0]) + { + return $this->listScannedFilesAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listScannedFilesAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScannedFiles'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listScannedFilesAsyncWithHttpInfo(string $contentType = self::contentTypes['listScannedFiles'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOK'; + $request = $this->listScannedFilesRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listScannedFiles' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listScannedFiles'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listScannedFilesRequest(string $contentType = self::contentTypes['listScannedFiles'][0]) + { + + + $resourcePath = '/v1/scanned-files/'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation startFileScan + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput $start_file_scan_input StartFileScan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startFileScan'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function startFileScan($node_id, $start_file_scan_input, string $contentType = self::contentTypes['startFileScan'][0]) + { + list($response) = $this->startFileScanWithHttpInfo($node_id, $start_file_scan_input, $contentType); + return $response; + } + + /** + * Operation startFileScanWithHttpInfo + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput $start_file_scan_input StartFileScan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startFileScan'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function startFileScanWithHttpInfo($node_id, $start_file_scan_input, string $contentType = self::contentTypes['startFileScan'][0]) + { + $request = $this->startFileScanRequest($node_id, $start_file_scan_input, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation startFileScanAsync + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput $start_file_scan_input StartFileScan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startFileScan'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function startFileScanAsync($node_id, $start_file_scan_input, string $contentType = self::contentTypes['startFileScan'][0]) + { + return $this->startFileScanAsyncWithHttpInfo($node_id, $start_file_scan_input, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation startFileScanAsyncWithHttpInfo + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput $start_file_scan_input StartFileScan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startFileScan'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function startFileScanAsyncWithHttpInfo($node_id, $start_file_scan_input, string $contentType = self::contentTypes['startFileScan'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanOK'; + $request = $this->startFileScanRequest($node_id, $start_file_scan_input, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'startFileScan' + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\StartFileScanInput $start_file_scan_input StartFileScan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['startFileScan'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function startFileScanRequest($node_id, $start_file_scan_input, string $contentType = self::contentTypes['startFileScan'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling startFileScan' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling FilesApi.startFileScan, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + // verify the required parameter 'start_file_scan_input' is set + if ($start_file_scan_input === null || (is_array($start_file_scan_input) && count($start_file_scan_input) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_file_scan_input when calling startFileScan' + ); + } + + + $resourcePath = '/v1/nodes/{nodeId}/file/scan'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($start_file_scan_input)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($start_file_scan_input)); + } else { + $httpBody = $start_file_scan_input; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/Api/NodesApi.php b/src/Clients/VaultDataManagerClient/lib/Api/NodesApi.php new file mode 100644 index 0000000..92b4f2a --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Api/NodesApi.php @@ -0,0 +1,3732 @@ + [ + 'application/json', + ], + 'deleteNode' => [ + 'application/json', + ], + 'getDetailedNodeInfo' => [ + 'application/json', + ], + 'initNodes' => [ + 'application/json', + ], + 'listNodeChildren' => [ + 'application/json', + ], + 'listRootNodeChildren' => [ + 'application/json', + ], + 'moveNode' => [ + 'application/json', + ], + 'permanentlyDeleteNode' => [ + 'application/json', + ], + 'restoreNodeFromTrashbin' => [ + 'application/json', + ], + 'updateNode' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createNode + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput $create_node_input CreateNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function createNode($create_node_input, string $contentType = self::contentTypes['createNode'][0]) + { + list($response) = $this->createNodeWithHttpInfo($create_node_input, $contentType); + return $response; + } + + /** + * Operation createNodeWithHttpInfo + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput $create_node_input CreateNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function createNodeWithHttpInfo($create_node_input, string $contentType = self::contentTypes['createNode'][0]) + { + $request = $this->createNodeRequest($create_node_input, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createNodeAsync + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput $create_node_input CreateNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createNodeAsync($create_node_input, string $contentType = self::contentTypes['createNode'][0]) + { + return $this->createNodeAsyncWithHttpInfo($create_node_input, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createNodeAsyncWithHttpInfo + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput $create_node_input CreateNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createNodeAsyncWithHttpInfo($create_node_input, string $contentType = self::contentTypes['createNode'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeOK'; + $request = $this->createNodeRequest($create_node_input, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createNode' + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\CreateNodeInput $create_node_input CreateNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createNodeRequest($create_node_input, string $contentType = self::contentTypes['createNode'][0]) + { + + // verify the required parameter 'create_node_input' is set + if ($create_node_input === null || (is_array($create_node_input) && count($create_node_input) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_node_input when calling createNode' + ); + } + + + $resourcePath = '/v1/nodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_node_input)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_node_input)); + } else { + $httpBody = $create_node_input; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteNode + * + * @param string $node_id node_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function deleteNode($node_id, string $contentType = self::contentTypes['deleteNode'][0]) + { + list($response) = $this->deleteNodeWithHttpInfo($node_id, $contentType); + return $response; + } + + /** + * Operation deleteNodeWithHttpInfo + * + * @param string $node_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteNodeWithHttpInfo($node_id, string $contentType = self::contentTypes['deleteNode'][0]) + { + $request = $this->deleteNodeRequest($node_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteNodeAsync + * + * @param string $node_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteNodeAsync($node_id, string $contentType = self::contentTypes['deleteNode'][0]) + { + return $this->deleteNodeAsyncWithHttpInfo($node_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteNodeAsyncWithHttpInfo + * + * @param string $node_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteNodeAsyncWithHttpInfo($node_id, string $contentType = self::contentTypes['deleteNode'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\DeleteNodeDto'; + $request = $this->deleteNodeRequest($node_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteNode' + * + * @param string $node_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteNodeRequest($node_id, string $contentType = self::contentTypes['deleteNode'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling deleteNode' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling NodesApi.deleteNode, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + + $resourcePath = '/v1/nodes/{nodeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDetailedNodeInfo + * + * @param string $node_id node_id (required) + * @param string|null $dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDetailedNodeInfo'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function getDetailedNodeInfo($node_id, $dek = null, string $contentType = self::contentTypes['getDetailedNodeInfo'][0]) + { + list($response) = $this->getDetailedNodeInfoWithHttpInfo($node_id, $dek, $contentType); + return $response; + } + + /** + * Operation getDetailedNodeInfoWithHttpInfo + * + * @param string $node_id (required) + * @param string|null $dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDetailedNodeInfo'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function getDetailedNodeInfoWithHttpInfo($node_id, $dek = null, string $contentType = self::contentTypes['getDetailedNodeInfo'][0]) + { + $request = $this->getDetailedNodeInfoRequest($node_id, $dek, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDetailedNodeInfoAsync + * + * @param string $node_id (required) + * @param string|null $dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDetailedNodeInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDetailedNodeInfoAsync($node_id, $dek = null, string $contentType = self::contentTypes['getDetailedNodeInfo'][0]) + { + return $this->getDetailedNodeInfoAsyncWithHttpInfo($node_id, $dek, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDetailedNodeInfoAsyncWithHttpInfo + * + * @param string $node_id (required) + * @param string|null $dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDetailedNodeInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDetailedNodeInfoAsyncWithHttpInfo($node_id, $dek = null, string $contentType = self::contentTypes['getDetailedNodeInfo'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\GetDetailedNodeInfoOK'; + $request = $this->getDetailedNodeInfoRequest($node_id, $dek, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDetailedNodeInfo' + * + * @param string $node_id (required) + * @param string|null $dek A base64url encoded data encryption key, encrypted using VFS public key. getUrl will not be returned if dek is not provided (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDetailedNodeInfo'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDetailedNodeInfoRequest($node_id, $dek = null, string $contentType = self::contentTypes['getDetailedNodeInfo'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling getDetailedNodeInfo' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling NodesApi.getDetailedNodeInfo, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + + + $resourcePath = '/v1/nodes/{nodeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $dek, + 'dek', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation initNodes + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['initNodes'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + * @deprecated + */ + public function initNodes(string $contentType = self::contentTypes['initNodes'][0]) + { + list($response) = $this->initNodesWithHttpInfo($contentType); + return $response; + } + + /** + * Operation initNodesWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['initNodes'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function initNodesWithHttpInfo(string $contentType = self::contentTypes['initNodes'][0]) + { + $request = $this->initNodesRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation initNodesAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['initNodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function initNodesAsync(string $contentType = self::contentTypes['initNodes'][0]) + { + return $this->initNodesAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation initNodesAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['initNodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function initNodesAsyncWithHttpInfo(string $contentType = self::contentTypes['initNodes'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InitNodesOK'; + $request = $this->initNodesRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'initNodes' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['initNodes'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function initNodesRequest(string $contentType = self::contentTypes['initNodes'][0]) + { + + + $resourcePath = '/v1/nodes/init'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listNodeChildren + * + * @param string $node_id Description for nodeId. (required) + * @param int|null $limit Maximum number of records to fetch in a list (optional, default to 10) + * @param string|null $exclusive_start_key exclusiveStartKey for retrieving the next batch of data. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNodeChildren'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function listNodeChildren($node_id, $limit = 10, $exclusive_start_key = null, string $contentType = self::contentTypes['listNodeChildren'][0]) + { + list($response) = $this->listNodeChildrenWithHttpInfo($node_id, $limit, $exclusive_start_key, $contentType); + return $response; + } + + /** + * Operation listNodeChildrenWithHttpInfo + * + * @param string $node_id Description for nodeId. (required) + * @param int|null $limit Maximum number of records to fetch in a list (optional, default to 10) + * @param string|null $exclusive_start_key exclusiveStartKey for retrieving the next batch of data. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNodeChildren'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function listNodeChildrenWithHttpInfo($node_id, $limit = 10, $exclusive_start_key = null, string $contentType = self::contentTypes['listNodeChildren'][0]) + { + $request = $this->listNodeChildrenRequest($node_id, $limit, $exclusive_start_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listNodeChildrenAsync + * + * @param string $node_id Description for nodeId. (required) + * @param int|null $limit Maximum number of records to fetch in a list (optional, default to 10) + * @param string|null $exclusive_start_key exclusiveStartKey for retrieving the next batch of data. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNodeChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listNodeChildrenAsync($node_id, $limit = 10, $exclusive_start_key = null, string $contentType = self::contentTypes['listNodeChildren'][0]) + { + return $this->listNodeChildrenAsyncWithHttpInfo($node_id, $limit, $exclusive_start_key, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listNodeChildrenAsyncWithHttpInfo + * + * @param string $node_id Description for nodeId. (required) + * @param int|null $limit Maximum number of records to fetch in a list (optional, default to 10) + * @param string|null $exclusive_start_key exclusiveStartKey for retrieving the next batch of data. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNodeChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listNodeChildrenAsyncWithHttpInfo($node_id, $limit = 10, $exclusive_start_key = null, string $contentType = self::contentTypes['listNodeChildren'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListNodeChildrenOK'; + $request = $this->listNodeChildrenRequest($node_id, $limit, $exclusive_start_key, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listNodeChildren' + * + * @param string $node_id Description for nodeId. (required) + * @param int|null $limit Maximum number of records to fetch in a list (optional, default to 10) + * @param string|null $exclusive_start_key exclusiveStartKey for retrieving the next batch of data. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listNodeChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listNodeChildrenRequest($node_id, $limit = 10, $exclusive_start_key = null, string $contentType = self::contentTypes['listNodeChildren'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling listNodeChildren' + ); + } + + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling NodesApi.listNodeChildren, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling NodesApi.listNodeChildren, must be bigger than or equal to 1.'); + } + + if ($exclusive_start_key !== null && strlen($exclusive_start_key) > 3000) { + throw new \InvalidArgumentException('invalid length for "$exclusive_start_key" when calling NodesApi.listNodeChildren, must be smaller than or equal to 3000.'); + } + + + $resourcePath = '/v1/nodes/{nodeId}/children'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $exclusive_start_key, + 'exclusiveStartKey', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listRootNodeChildren + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRootNodeChildren'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function listRootNodeChildren(string $contentType = self::contentTypes['listRootNodeChildren'][0]) + { + list($response) = $this->listRootNodeChildrenWithHttpInfo($contentType); + return $response; + } + + /** + * Operation listRootNodeChildrenWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRootNodeChildren'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function listRootNodeChildrenWithHttpInfo(string $contentType = self::contentTypes['listRootNodeChildren'][0]) + { + $request = $this->listRootNodeChildrenRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listRootNodeChildrenAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRootNodeChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRootNodeChildrenAsync(string $contentType = self::contentTypes['listRootNodeChildren'][0]) + { + return $this->listRootNodeChildrenAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listRootNodeChildrenAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRootNodeChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listRootNodeChildrenAsyncWithHttpInfo(string $contentType = self::contentTypes['listRootNodeChildren'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListRootNodeChildrenOK'; + $request = $this->listRootNodeChildrenRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listRootNodeChildren' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listRootNodeChildren'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listRootNodeChildrenRequest(string $contentType = self::contentTypes['listRootNodeChildren'][0]) + { + + + $resourcePath = '/v1/nodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation moveNode + * + * @param string $node_id node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput $move_node_input MoveNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function moveNode($node_id, $move_node_input, string $contentType = self::contentTypes['moveNode'][0]) + { + list($response) = $this->moveNodeWithHttpInfo($node_id, $move_node_input, $contentType); + return $response; + } + + /** + * Operation moveNodeWithHttpInfo + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput $move_node_input MoveNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function moveNodeWithHttpInfo($node_id, $move_node_input, string $contentType = self::contentTypes['moveNode'][0]) + { + $request = $this->moveNodeRequest($node_id, $move_node_input, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation moveNodeAsync + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput $move_node_input MoveNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function moveNodeAsync($node_id, $move_node_input, string $contentType = self::contentTypes['moveNode'][0]) + { + return $this->moveNodeAsyncWithHttpInfo($node_id, $move_node_input, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation moveNodeAsyncWithHttpInfo + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput $move_node_input MoveNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function moveNodeAsyncWithHttpInfo($node_id, $move_node_input, string $contentType = self::contentTypes['moveNode'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto'; + $request = $this->moveNodeRequest($node_id, $move_node_input, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'moveNode' + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeInput $move_node_input MoveNode (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function moveNodeRequest($node_id, $move_node_input, string $contentType = self::contentTypes['moveNode'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling moveNode' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling NodesApi.moveNode, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + // verify the required parameter 'move_node_input' is set + if ($move_node_input === null || (is_array($move_node_input) && count($move_node_input) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $move_node_input when calling moveNode' + ); + } + + + $resourcePath = '/v1/nodes/{nodeId}/move'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($move_node_input)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($move_node_input)); + } else { + $httpBody = $move_node_input; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation permanentlyDeleteNode + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_remove nodeId of the node to be deleted from TRASH_BIN (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['permanentlyDeleteNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function permanentlyDeleteNode($node_id, $node_id_to_remove, string $contentType = self::contentTypes['permanentlyDeleteNode'][0]) + { + $this->permanentlyDeleteNodeWithHttpInfo($node_id, $node_id_to_remove, $contentType); + } + + /** + * Operation permanentlyDeleteNodeWithHttpInfo + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_remove nodeId of the node to be deleted from TRASH_BIN (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['permanentlyDeleteNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function permanentlyDeleteNodeWithHttpInfo($node_id, $node_id_to_remove, string $contentType = self::contentTypes['permanentlyDeleteNode'][0]) + { + $request = $this->permanentlyDeleteNodeRequest($node_id, $node_id_to_remove, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation permanentlyDeleteNodeAsync + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_remove nodeId of the node to be deleted from TRASH_BIN (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['permanentlyDeleteNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function permanentlyDeleteNodeAsync($node_id, $node_id_to_remove, string $contentType = self::contentTypes['permanentlyDeleteNode'][0]) + { + return $this->permanentlyDeleteNodeAsyncWithHttpInfo($node_id, $node_id_to_remove, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation permanentlyDeleteNodeAsyncWithHttpInfo + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_remove nodeId of the node to be deleted from TRASH_BIN (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['permanentlyDeleteNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function permanentlyDeleteNodeAsyncWithHttpInfo($node_id, $node_id_to_remove, string $contentType = self::contentTypes['permanentlyDeleteNode'][0]) + { + $returnType = ''; + $request = $this->permanentlyDeleteNodeRequest($node_id, $node_id_to_remove, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'permanentlyDeleteNode' + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_remove nodeId of the node to be deleted from TRASH_BIN (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['permanentlyDeleteNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function permanentlyDeleteNodeRequest($node_id, $node_id_to_remove, string $contentType = self::contentTypes['permanentlyDeleteNode'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling permanentlyDeleteNode' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling NodesApi.permanentlyDeleteNode, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + // verify the required parameter 'node_id_to_remove' is set + if ($node_id_to_remove === null || (is_array($node_id_to_remove) && count($node_id_to_remove) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id_to_remove when calling permanentlyDeleteNode' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id_to_remove)) { + throw new \InvalidArgumentException("invalid value for \"node_id_to_remove\" when calling NodesApi.permanentlyDeleteNode, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + + $resourcePath = '/v1/nodes/{nodeId}/remove/{nodeIdToRemove}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + // path params + if ($node_id_to_remove !== null) { + $resourcePath = str_replace( + '{' . 'nodeIdToRemove' . '}', + ObjectSerializer::toPathValue($node_id_to_remove), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation restoreNodeFromTrashbin + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_restore nodeId of the node to be restored from TRASH_BIN (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin $restore_node_from_trashbin RestoreNodeFromTrashbin (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNodeFromTrashbin'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function restoreNodeFromTrashbin($node_id, $node_id_to_restore, $restore_node_from_trashbin, string $contentType = self::contentTypes['restoreNodeFromTrashbin'][0]) + { + list($response) = $this->restoreNodeFromTrashbinWithHttpInfo($node_id, $node_id_to_restore, $restore_node_from_trashbin, $contentType); + return $response; + } + + /** + * Operation restoreNodeFromTrashbinWithHttpInfo + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_restore nodeId of the node to be restored from TRASH_BIN (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin $restore_node_from_trashbin RestoreNodeFromTrashbin (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNodeFromTrashbin'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function restoreNodeFromTrashbinWithHttpInfo($node_id, $node_id_to_restore, $restore_node_from_trashbin, string $contentType = self::contentTypes['restoreNodeFromTrashbin'][0]) + { + $request = $this->restoreNodeFromTrashbinRequest($node_id, $node_id_to_restore, $restore_node_from_trashbin, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 202: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation restoreNodeFromTrashbinAsync + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_restore nodeId of the node to be restored from TRASH_BIN (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin $restore_node_from_trashbin RestoreNodeFromTrashbin (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNodeFromTrashbin'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreNodeFromTrashbinAsync($node_id, $node_id_to_restore, $restore_node_from_trashbin, string $contentType = self::contentTypes['restoreNodeFromTrashbin'][0]) + { + return $this->restoreNodeFromTrashbinAsyncWithHttpInfo($node_id, $node_id_to_restore, $restore_node_from_trashbin, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation restoreNodeFromTrashbinAsyncWithHttpInfo + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_restore nodeId of the node to be restored from TRASH_BIN (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin $restore_node_from_trashbin RestoreNodeFromTrashbin (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNodeFromTrashbin'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreNodeFromTrashbinAsyncWithHttpInfo($node_id, $node_id_to_restore, $restore_node_from_trashbin, string $contentType = self::contentTypes['restoreNodeFromTrashbin'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\MoveNodeDto'; + $request = $this->restoreNodeFromTrashbinRequest($node_id, $node_id_to_restore, $restore_node_from_trashbin, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'restoreNodeFromTrashbin' + * + * @param string $node_id nodeId of the TRASH_BIN (required) + * @param string $node_id_to_restore nodeId of the node to be restored from TRASH_BIN (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\RestoreNodeFromTrashbin $restore_node_from_trashbin RestoreNodeFromTrashbin (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNodeFromTrashbin'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function restoreNodeFromTrashbinRequest($node_id, $node_id_to_restore, $restore_node_from_trashbin, string $contentType = self::contentTypes['restoreNodeFromTrashbin'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling restoreNodeFromTrashbin' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling NodesApi.restoreNodeFromTrashbin, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + // verify the required parameter 'node_id_to_restore' is set + if ($node_id_to_restore === null || (is_array($node_id_to_restore) && count($node_id_to_restore) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id_to_restore when calling restoreNodeFromTrashbin' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id_to_restore)) { + throw new \InvalidArgumentException("invalid value for \"node_id_to_restore\" when calling NodesApi.restoreNodeFromTrashbin, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + // verify the required parameter 'restore_node_from_trashbin' is set + if ($restore_node_from_trashbin === null || (is_array($restore_node_from_trashbin) && count($restore_node_from_trashbin) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $restore_node_from_trashbin when calling restoreNodeFromTrashbin' + ); + } + + + $resourcePath = '/v1/nodes/{nodeId}/restore/{nodeIdToRestore}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + // path params + if ($node_id_to_restore !== null) { + $resourcePath = str_replace( + '{' . 'nodeIdToRestore' . '}', + ObjectSerializer::toPathValue($node_id_to_restore), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($restore_node_from_trashbin)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($restore_node_from_trashbin)); + } else { + $httpBody = $restore_node_from_trashbin; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateNode + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput $update_node_input UpdateNodeInput (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function updateNode($node_id, $update_node_input, string $contentType = self::contentTypes['updateNode'][0]) + { + list($response) = $this->updateNodeWithHttpInfo($node_id, $update_node_input, $contentType); + return $response; + } + + /** + * Operation updateNodeWithHttpInfo + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput $update_node_input UpdateNodeInput (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNode'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function updateNodeWithHttpInfo($node_id, $update_node_input, string $contentType = self::contentTypes['updateNode'][0]) + { + $request = $this->updateNodeRequest($node_id, $update_node_input, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateNodeAsync + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput $update_node_input UpdateNodeInput (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateNodeAsync($node_id, $update_node_input, string $contentType = self::contentTypes['updateNode'][0]) + { + return $this->updateNodeAsyncWithHttpInfo($node_id, $update_node_input, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateNodeAsyncWithHttpInfo + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput $update_node_input UpdateNodeInput (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateNodeAsyncWithHttpInfo($node_id, $update_node_input, string $contentType = self::contentTypes['updateNode'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto'; + $request = $this->updateNodeRequest($node_id, $update_node_input, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateNode' + * + * @param string $node_id Description for nodeId. (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateNodeInput $update_node_input UpdateNodeInput (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNode'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateNodeRequest($node_id, $update_node_input, string $contentType = self::contentTypes['updateNode'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling updateNode' + ); + } + + // verify the required parameter 'update_node_input' is set + if ($update_node_input === null || (is_array($update_node_input) && count($update_node_input) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_node_input when calling updateNode' + ); + } + + + $resourcePath = '/v1/nodes/{nodeId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_node_input)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_node_input)); + } else { + $httpBody = $update_node_input; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/Api/ProfileDataApi.php b/src/Clients/VaultDataManagerClient/lib/Api/ProfileDataApi.php new file mode 100644 index 0000000..7406718 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Api/ProfileDataApi.php @@ -0,0 +1,523 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation updateProfileData + * + * @param string $node_id node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput $update_profile_data_input Updates the schema with the given data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProfileData'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError + */ + public function updateProfileData($node_id, $update_profile_data_input, string $contentType = self::contentTypes['updateProfileData'][0]) + { + list($response) = $this->updateProfileDataWithHttpInfo($node_id, $update_profile_data_input, $contentType); + return $response; + } + + /** + * Operation updateProfileDataWithHttpInfo + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput $update_profile_data_input Updates the schema with the given data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProfileData'] to see the possible values for this operation + * + * @throws \AffinidiTdk\Clients\VaultDataManagerClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK|\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError, HTTP status code, HTTP response headers (array of strings) + */ + public function updateProfileDataWithHttpInfo($node_id, $update_profile_data_input, string $contentType = self::contentTypes['updateProfileData'][0]) + { + $request = $this->updateProfileDataRequest($node_id, $update_profile_data_input, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $jsonResponse = json_decode($e->getResponse()->getBody()); + if ($jsonResponse->name === 'InvalidJwtTokenError') { + $issue = $jsonResponse->details[0]->issue; + throw new InvalidJwtTokenError($issue, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'NotFoundError') { + throw new NotFoundError($jsonResponse->message, $jsonResponse->traceId); + } + + if ($jsonResponse->name === 'InvalidParameterError') { + throw new InvalidParameterError($jsonResponse->message, $jsonResponse->details, $jsonResponse->traceId); + } + + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateProfileDataAsync + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput $update_profile_data_input Updates the schema with the given data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProfileData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateProfileDataAsync($node_id, $update_profile_data_input, string $contentType = self::contentTypes['updateProfileData'][0]) + { + return $this->updateProfileDataAsyncWithHttpInfo($node_id, $update_profile_data_input, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateProfileDataAsyncWithHttpInfo + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput $update_profile_data_input Updates the schema with the given data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProfileData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateProfileDataAsyncWithHttpInfo($node_id, $update_profile_data_input, string $contentType = self::contentTypes['updateProfileData'][0]) + { + $returnType = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataOK'; + $request = $this->updateProfileDataRequest($node_id, $update_profile_data_input, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + 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(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateProfileData' + * + * @param string $node_id (required) + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\UpdateProfileDataInput $update_profile_data_input Updates the schema with the given data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProfileData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateProfileDataRequest($node_id, $update_profile_data_input, string $contentType = self::contentTypes['updateProfileData'][0]) + { + + // verify the required parameter 'node_id' is set + if ($node_id === null || (is_array($node_id) && count($node_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $node_id when calling updateProfileData' + ); + } + if (!preg_match("/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/", $node_id)) { + throw new \InvalidArgumentException("invalid value for \"node_id\" when calling ProfileDataApi.updateProfileData, must conform to the pattern /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/."); + } + + // verify the required parameter 'update_profile_data_input' is set + if ($update_profile_data_input === null || (is_array($update_profile_data_input) && count($update_profile_data_input) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_profile_data_input when calling updateProfileData' + ); + } + + + $resourcePath = '/v1/nodes/{nodeId}/profile-data'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($node_id !== null) { + $resourcePath = str_replace( + '{' . 'nodeId' . '}', + ObjectSerializer::toPathValue($node_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_profile_data_input)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_profile_data_input)); + } else { + $httpBody = $update_profile_data_input; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('authorization'); + if ($apiKey !== null) { + $headers['authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/ApiException.php b/src/Clients/VaultDataManagerClient/lib/ApiException.php new file mode 100644 index 0000000..ee79e6b --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/ApiException.php @@ -0,0 +1,120 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[][]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/Configuration.php b/src/Clients/VaultDataManagerClient/lib/Configuration.php new file mode 100644 index 0000000..dca204f --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Configuration.php @@ -0,0 +1,545 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** @var callable|null */ + protected $apiKeyRefreshCallback; + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * @param callable|null $callback Optional hook for retrieving the API key with + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key, callable|null $callback = null) + { + if ($callback && is_callable($callback)) { + // Set the callback if provided + $this->apiKeyRefreshCallback = $callback; + } + + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + if ($this->apiKeyRefreshCallback) { + $this->apiKeys[$apiKeyIdentifier] = ($this->apiKeyRefreshCallback)(); + } + + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (AffinidiTdk\Clients\VaultDataManagerClient) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 1.0.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "https://api.vault.affinidi.com/vfs", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); + } + + $host = $hostSettings[$hostIndex]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/HeaderSelector.php b/src/Clients/VaultDataManagerClient/lib/HeaderSelector.php new file mode 100644 index 0000000..bb0f7fc --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/HeaderSelector.php @@ -0,0 +1,274 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader(array $accept): ?string + { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = $this->selectJsonMimeList($accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/InvalidJwtTokenError.php b/src/Clients/VaultDataManagerClient/lib/InvalidJwtTokenError.php new file mode 100644 index 0000000..e5d02d8 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/InvalidJwtTokenError.php @@ -0,0 +1,80 @@ + $this->name, + 'message' => $this->message, + 'issue' => $issue, + 'traceId' => $traceId + ]; + + parent::__construct(json_encode($message), 403); + $this->issue = $issue; + $this->traceId = $traceId; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/InvalidParameterError.php b/src/Clients/VaultDataManagerClient/lib/InvalidParameterError.php new file mode 100644 index 0000000..49af48c --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/InvalidParameterError.php @@ -0,0 +1,75 @@ + $this->name, + 'message' => $message, + 'details' => $details, + 'traceId' => $traceId + ]; + + parent::__construct(json_encode($message), 400); + $this->details = $details; + $this->traceId = $traceId; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/Model/AwsCredentialExchangeOperationOK.php b/src/Clients/VaultDataManagerClient/lib/Model/AwsCredentialExchangeOperationOK.php new file mode 100644 index 0000000..9cc27bb --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/AwsCredentialExchangeOperationOK.php @@ -0,0 +1,450 @@ + + */ +class AwsCredentialExchangeOperationOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AwsCredentialExchangeOperationOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'token' => 'string', + 'identity_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'token' => null, + 'identity_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'token' => false, + 'identity_id' => 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 = [ + 'token' => 'token', + 'identity_id' => 'identityId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken', + 'identity_id' => 'setIdentityId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'token' => 'getToken', + 'identity_id' => 'getIdentityId' + ]; + + /** + * 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('token', $data ?? [], null); + $this->setIfExists('identity_id', $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 = []; + + if ($this->container['token'] === null) { + $invalidProperties[] = "'token' can't be null"; + } + if ($this->container['identity_id'] === null) { + $invalidProperties[] = "'identity_id' can't be null"; + } + 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 token + * + * @return string + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string $token token + * + * @return self + */ + public function setToken($token) + { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } + $this->container['token'] = $token; + + return $this; + } + + /** + * Gets identity_id + * + * @return string + */ + public function getIdentityId() + { + return $this->container['identity_id']; + } + + /** + * Sets identity_id + * + * @param string $identity_id identity_id + * + * @return self + */ + public function setIdentityId($identity_id) + { + if (is_null($identity_id)) { + throw new \InvalidArgumentException('non-nullable identity_id cannot be null'); + } + $this->container['identity_id'] = $identity_id; + + 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/src/Clients/VaultDataManagerClient/lib/Model/ConsumerMetadataDto.php b/src/Clients/VaultDataManagerClient/lib/Model/ConsumerMetadataDto.php new file mode 100644 index 0000000..8c07e92 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/ConsumerMetadataDto.php @@ -0,0 +1,885 @@ + + */ +class ConsumerMetadataDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConsumerMetadataDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'node_id' => 'string', + 'status' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus', + 'file_count' => 'float', + 'folder_count' => 'float', + 'profile_count' => 'float', + 'name' => 'string', + 'consumer_id' => 'string', + 'created_at' => 'string', + 'modified_at' => 'string', + 'created_by' => 'string', + 'modified_by' => 'string', + 'description' => 'string', + 'type' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType', + 'consumed_file_storage' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'node_id' => null, + 'status' => null, + 'file_count' => null, + 'folder_count' => null, + 'profile_count' => null, + 'name' => null, + 'consumer_id' => null, + 'created_at' => null, + 'modified_at' => null, + 'created_by' => null, + 'modified_by' => null, + 'description' => null, + 'type' => null, + 'consumed_file_storage' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'node_id' => false, + 'status' => false, + 'file_count' => false, + 'folder_count' => false, + 'profile_count' => false, + 'name' => false, + 'consumer_id' => false, + 'created_at' => false, + 'modified_at' => false, + 'created_by' => false, + 'modified_by' => false, + 'description' => false, + 'type' => false, + 'consumed_file_storage' => 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 = [ + 'node_id' => 'nodeId', + 'status' => 'status', + 'file_count' => 'fileCount', + 'folder_count' => 'folderCount', + 'profile_count' => 'profileCount', + 'name' => 'name', + 'consumer_id' => 'consumerId', + 'created_at' => 'createdAt', + 'modified_at' => 'modifiedAt', + 'created_by' => 'createdBy', + 'modified_by' => 'modifiedBy', + 'description' => 'description', + 'type' => 'type', + 'consumed_file_storage' => 'consumedFileStorage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'node_id' => 'setNodeId', + 'status' => 'setStatus', + 'file_count' => 'setFileCount', + 'folder_count' => 'setFolderCount', + 'profile_count' => 'setProfileCount', + 'name' => 'setName', + 'consumer_id' => 'setConsumerId', + 'created_at' => 'setCreatedAt', + 'modified_at' => 'setModifiedAt', + 'created_by' => 'setCreatedBy', + 'modified_by' => 'setModifiedBy', + 'description' => 'setDescription', + 'type' => 'setType', + 'consumed_file_storage' => 'setConsumedFileStorage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'node_id' => 'getNodeId', + 'status' => 'getStatus', + 'file_count' => 'getFileCount', + 'folder_count' => 'getFolderCount', + 'profile_count' => 'getProfileCount', + 'name' => 'getName', + 'consumer_id' => 'getConsumerId', + 'created_at' => 'getCreatedAt', + 'modified_at' => 'getModifiedAt', + 'created_by' => 'getCreatedBy', + 'modified_by' => 'getModifiedBy', + 'description' => 'getDescription', + 'type' => 'getType', + 'consumed_file_storage' => 'getConsumedFileStorage' + ]; + + /** + * 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('node_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('file_count', $data ?? [], null); + $this->setIfExists('folder_count', $data ?? [], null); + $this->setIfExists('profile_count', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('consumer_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('modified_at', $data ?? [], null); + $this->setIfExists('created_by', $data ?? [], null); + $this->setIfExists('modified_by', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('consumed_file_storage', $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 = []; + + if ($this->container['node_id'] === null) { + $invalidProperties[] = "'node_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['consumer_id'] === null) { + $invalidProperties[] = "'consumer_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['modified_at'] === null) { + $invalidProperties[] = "'modified_at' can't be null"; + } + if ($this->container['created_by'] === null) { + $invalidProperties[] = "'created_by' can't be null"; + } + if ($this->container['modified_by'] === null) { + $invalidProperties[] = "'modified_by' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['consumed_file_storage'] === null) { + $invalidProperties[] = "'consumed_file_storage' can't be null"; + } + 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 node_id + * + * @return string + */ + public function getNodeId() + { + return $this->container['node_id']; + } + + /** + * Sets node_id + * + * @param string $node_id node_id + * + * @return self + */ + public function setNodeId($node_id) + { + if (is_null($node_id)) { + throw new \InvalidArgumentException('non-nullable node_id cannot be null'); + } + $this->container['node_id'] = $node_id; + + return $this; + } + + /** + * Gets status + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets file_count + * + * @return float|null + */ + public function getFileCount() + { + return $this->container['file_count']; + } + + /** + * Sets file_count + * + * @param float|null $file_count file_count + * + * @return self + */ + public function setFileCount($file_count) + { + if (is_null($file_count)) { + throw new \InvalidArgumentException('non-nullable file_count cannot be null'); + } + $this->container['file_count'] = $file_count; + + return $this; + } + + /** + * Gets folder_count + * + * @return float|null + */ + public function getFolderCount() + { + return $this->container['folder_count']; + } + + /** + * Sets folder_count + * + * @param float|null $folder_count folder_count + * + * @return self + */ + public function setFolderCount($folder_count) + { + if (is_null($folder_count)) { + throw new \InvalidArgumentException('non-nullable folder_count cannot be null'); + } + $this->container['folder_count'] = $folder_count; + + return $this; + } + + /** + * Gets profile_count + * + * @return float|null + */ + public function getProfileCount() + { + return $this->container['profile_count']; + } + + /** + * Sets profile_count + * + * @param float|null $profile_count profile_count + * + * @return self + */ + public function setProfileCount($profile_count) + { + if (is_null($profile_count)) { + throw new \InvalidArgumentException('non-nullable profile_count cannot be null'); + } + $this->container['profile_count'] = $profile_count; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets consumer_id + * + * @return string + */ + public function getConsumerId() + { + return $this->container['consumer_id']; + } + + /** + * Sets consumer_id + * + * @param string $consumer_id consumer_id + * + * @return self + */ + public function setConsumerId($consumer_id) + { + if (is_null($consumer_id)) { + throw new \InvalidArgumentException('non-nullable consumer_id cannot be null'); + } + $this->container['consumer_id'] = $consumer_id; + + return $this; + } + + /** + * Gets created_at + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string $created_at [GEN] ISO 8601 string of the creation date/time the entity + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets modified_at + * + * @return string + */ + public function getModifiedAt() + { + return $this->container['modified_at']; + } + + /** + * Sets modified_at + * + * @param string $modified_at [GEN] ISO 8601 string of the modification date/time the entity + * + * @return self + */ + public function setModifiedAt($modified_at) + { + if (is_null($modified_at)) { + throw new \InvalidArgumentException('non-nullable modified_at cannot be null'); + } + $this->container['modified_at'] = $modified_at; + + return $this; + } + + /** + * Gets created_by + * + * @return string + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param string $created_by [GEN] Identifier of the user who created the entity + * + * @return self + */ + public function setCreatedBy($created_by) + { + if (is_null($created_by)) { + throw new \InvalidArgumentException('non-nullable created_by cannot be null'); + } + $this->container['created_by'] = $created_by; + + return $this; + } + + /** + * Gets modified_by + * + * @return string + */ + public function getModifiedBy() + { + return $this->container['modified_by']; + } + + /** + * Sets modified_by + * + * @param string $modified_by [GEN] Identifier of the user who last updated the entity + * + * @return self + */ + public function setModifiedBy($modified_by) + { + if (is_null($modified_by)) { + throw new \InvalidArgumentException('non-nullable modified_by cannot be null'); + } + $this->container['modified_by'] = $modified_by; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Description of the node + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets type + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets consumed_file_storage + * + * @return float + */ + public function getConsumedFileStorage() + { + return $this->container['consumed_file_storage']; + } + + /** + * Sets consumed_file_storage + * + * @param float $consumed_file_storage Tracks the amount of bytes used by the stored data. + * + * @return self + */ + public function setConsumedFileStorage($consumed_file_storage) + { + if (is_null($consumed_file_storage)) { + throw new \InvalidArgumentException('non-nullable consumed_file_storage cannot be null'); + } + $this->container['consumed_file_storage'] = $consumed_file_storage; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsAwsCredentialExchangeOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsAwsCredentialExchangeOK.php new file mode 100644 index 0000000..5da9d32 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsAwsCredentialExchangeOK.php @@ -0,0 +1,410 @@ + + */ +class CorsAwsCredentialExchangeOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsAwsCredentialExchangeOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_aws_credential_exchange_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_aws_credential_exchange_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_aws_credential_exchange_ok' => 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 = [ + 'cors_aws_credential_exchange_ok' => 'corsAwsCredentialExchangeOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_aws_credential_exchange_ok' => 'setCorsAwsCredentialExchangeOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_aws_credential_exchange_ok' => 'getCorsAwsCredentialExchangeOk' + ]; + + /** + * 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('cors_aws_credential_exchange_ok', $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 cors_aws_credential_exchange_ok + * + * @return string|null + */ + public function getCorsAwsCredentialExchangeOk() + { + return $this->container['cors_aws_credential_exchange_ok']; + } + + /** + * Sets cors_aws_credential_exchange_ok + * + * @param string|null $cors_aws_credential_exchange_ok cors_aws_credential_exchange_ok + * + * @return self + */ + public function setCorsAwsCredentialExchangeOk($cors_aws_credential_exchange_ok) + { + if (is_null($cors_aws_credential_exchange_ok)) { + throw new \InvalidArgumentException('non-nullable cors_aws_credential_exchange_ok cannot be null'); + } + $this->container['cors_aws_credential_exchange_ok'] = $cors_aws_credential_exchange_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsDeleteNodeOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsDeleteNodeOK.php new file mode 100644 index 0000000..b3e3330 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsDeleteNodeOK.php @@ -0,0 +1,410 @@ + + */ +class CorsDeleteNodeOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsDeleteNodeOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_delete_node_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_delete_node_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_delete_node_ok' => 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 = [ + 'cors_delete_node_ok' => 'corsDeleteNodeOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_delete_node_ok' => 'setCorsDeleteNodeOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_delete_node_ok' => 'getCorsDeleteNodeOk' + ]; + + /** + * 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('cors_delete_node_ok', $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 cors_delete_node_ok + * + * @return string|null + */ + public function getCorsDeleteNodeOk() + { + return $this->container['cors_delete_node_ok']; + } + + /** + * Sets cors_delete_node_ok + * + * @param string|null $cors_delete_node_ok cors_delete_node_ok + * + * @return self + */ + public function setCorsDeleteNodeOk($cors_delete_node_ok) + { + if (is_null($cors_delete_node_ok)) { + throw new \InvalidArgumentException('non-nullable cors_delete_node_ok cannot be null'); + } + $this->container['cors_delete_node_ok'] = $cors_delete_node_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsGetConfigOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsGetConfigOK.php new file mode 100644 index 0000000..6a7a10d --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsGetConfigOK.php @@ -0,0 +1,410 @@ + + */ +class CorsGetConfigOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsGetConfigOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_get_config_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_get_config_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_get_config_ok' => 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 = [ + 'cors_get_config_ok' => 'corsGetConfigOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_get_config_ok' => 'setCorsGetConfigOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_get_config_ok' => 'getCorsGetConfigOk' + ]; + + /** + * 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('cors_get_config_ok', $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 cors_get_config_ok + * + * @return string|null + */ + public function getCorsGetConfigOk() + { + return $this->container['cors_get_config_ok']; + } + + /** + * Sets cors_get_config_ok + * + * @param string|null $cors_get_config_ok cors_get_config_ok + * + * @return self + */ + public function setCorsGetConfigOk($cors_get_config_ok) + { + if (is_null($cors_get_config_ok)) { + throw new \InvalidArgumentException('non-nullable cors_get_config_ok cannot be null'); + } + $this->container['cors_get_config_ok'] = $cors_get_config_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsGetScannedFileInfoOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsGetScannedFileInfoOK.php new file mode 100644 index 0000000..ac1f59f --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsGetScannedFileInfoOK.php @@ -0,0 +1,410 @@ + + */ +class CorsGetScannedFileInfoOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsGetScannedFileInfoOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_get_scanned_file_info_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_get_scanned_file_info_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_get_scanned_file_info_ok' => 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 = [ + 'cors_get_scanned_file_info_ok' => 'corsGetScannedFileInfoOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_get_scanned_file_info_ok' => 'setCorsGetScannedFileInfoOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_get_scanned_file_info_ok' => 'getCorsGetScannedFileInfoOk' + ]; + + /** + * 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('cors_get_scanned_file_info_ok', $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 cors_get_scanned_file_info_ok + * + * @return string|null + */ + public function getCorsGetScannedFileInfoOk() + { + return $this->container['cors_get_scanned_file_info_ok']; + } + + /** + * Sets cors_get_scanned_file_info_ok + * + * @param string|null $cors_get_scanned_file_info_ok cors_get_scanned_file_info_ok + * + * @return self + */ + public function setCorsGetScannedFileInfoOk($cors_get_scanned_file_info_ok) + { + if (is_null($cors_get_scanned_file_info_ok)) { + throw new \InvalidArgumentException('non-nullable cors_get_scanned_file_info_ok cannot be null'); + } + $this->container['cors_get_scanned_file_info_ok'] = $cors_get_scanned_file_info_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsGetWellKnownJwksOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsGetWellKnownJwksOK.php new file mode 100644 index 0000000..4e06cd1 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsGetWellKnownJwksOK.php @@ -0,0 +1,410 @@ + + */ +class CorsGetWellKnownJwksOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsGetWellKnownJwksOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_get_well_known_jwks_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_get_well_known_jwks_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_get_well_known_jwks_ok' => 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 = [ + 'cors_get_well_known_jwks_ok' => 'corsGetWellKnownJwksOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_get_well_known_jwks_ok' => 'setCorsGetWellKnownJwksOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_get_well_known_jwks_ok' => 'getCorsGetWellKnownJwksOk' + ]; + + /** + * 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('cors_get_well_known_jwks_ok', $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 cors_get_well_known_jwks_ok + * + * @return string|null + */ + public function getCorsGetWellKnownJwksOk() + { + return $this->container['cors_get_well_known_jwks_ok']; + } + + /** + * Sets cors_get_well_known_jwks_ok + * + * @param string|null $cors_get_well_known_jwks_ok cors_get_well_known_jwks_ok + * + * @return self + */ + public function setCorsGetWellKnownJwksOk($cors_get_well_known_jwks_ok) + { + if (is_null($cors_get_well_known_jwks_ok)) { + throw new \InvalidArgumentException('non-nullable cors_get_well_known_jwks_ok cannot be null'); + } + $this->container['cors_get_well_known_jwks_ok'] = $cors_get_well_known_jwks_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsInitNodesOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsInitNodesOK.php new file mode 100644 index 0000000..8c713d5 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsInitNodesOK.php @@ -0,0 +1,410 @@ + + */ +class CorsInitNodesOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsInitNodesOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_init_nodes_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_init_nodes_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_init_nodes_ok' => 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 = [ + 'cors_init_nodes_ok' => 'corsInitNodesOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_init_nodes_ok' => 'setCorsInitNodesOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_init_nodes_ok' => 'getCorsInitNodesOk' + ]; + + /** + * 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('cors_init_nodes_ok', $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 cors_init_nodes_ok + * + * @return string|null + */ + public function getCorsInitNodesOk() + { + return $this->container['cors_init_nodes_ok']; + } + + /** + * Sets cors_init_nodes_ok + * + * @param string|null $cors_init_nodes_ok cors_init_nodes_ok + * + * @return self + */ + public function setCorsInitNodesOk($cors_init_nodes_ok) + { + if (is_null($cors_init_nodes_ok)) { + throw new \InvalidArgumentException('non-nullable cors_init_nodes_ok cannot be null'); + } + $this->container['cors_init_nodes_ok'] = $cors_init_nodes_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsListNodeChildrenOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsListNodeChildrenOK.php new file mode 100644 index 0000000..801feb5 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsListNodeChildrenOK.php @@ -0,0 +1,410 @@ + + */ +class CorsListNodeChildrenOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsListNodeChildrenOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_list_node_children_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_list_node_children_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_list_node_children_ok' => 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 = [ + 'cors_list_node_children_ok' => 'corsListNodeChildrenOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_list_node_children_ok' => 'setCorsListNodeChildrenOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_list_node_children_ok' => 'getCorsListNodeChildrenOk' + ]; + + /** + * 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('cors_list_node_children_ok', $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 cors_list_node_children_ok + * + * @return string|null + */ + public function getCorsListNodeChildrenOk() + { + return $this->container['cors_list_node_children_ok']; + } + + /** + * Sets cors_list_node_children_ok + * + * @param string|null $cors_list_node_children_ok cors_list_node_children_ok + * + * @return self + */ + public function setCorsListNodeChildrenOk($cors_list_node_children_ok) + { + if (is_null($cors_list_node_children_ok)) { + throw new \InvalidArgumentException('non-nullable cors_list_node_children_ok cannot be null'); + } + $this->container['cors_list_node_children_ok'] = $cors_list_node_children_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsListRootNodeChildrenOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsListRootNodeChildrenOK.php new file mode 100644 index 0000000..b72c4ec --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsListRootNodeChildrenOK.php @@ -0,0 +1,410 @@ + + */ +class CorsListRootNodeChildrenOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsListRootNodeChildrenOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_list_root_node_children_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_list_root_node_children_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_list_root_node_children_ok' => 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 = [ + 'cors_list_root_node_children_ok' => 'corsListRootNodeChildrenOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_list_root_node_children_ok' => 'setCorsListRootNodeChildrenOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_list_root_node_children_ok' => 'getCorsListRootNodeChildrenOk' + ]; + + /** + * 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('cors_list_root_node_children_ok', $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 cors_list_root_node_children_ok + * + * @return string|null + */ + public function getCorsListRootNodeChildrenOk() + { + return $this->container['cors_list_root_node_children_ok']; + } + + /** + * Sets cors_list_root_node_children_ok + * + * @param string|null $cors_list_root_node_children_ok cors_list_root_node_children_ok + * + * @return self + */ + public function setCorsListRootNodeChildrenOk($cors_list_root_node_children_ok) + { + if (is_null($cors_list_root_node_children_ok)) { + throw new \InvalidArgumentException('non-nullable cors_list_root_node_children_ok cannot be null'); + } + $this->container['cors_list_root_node_children_ok'] = $cors_list_root_node_children_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsListScannedFilesOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsListScannedFilesOK.php new file mode 100644 index 0000000..6134552 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsListScannedFilesOK.php @@ -0,0 +1,410 @@ + + */ +class CorsListScannedFilesOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsListScannedFilesOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_list_scanned_files_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_list_scanned_files_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_list_scanned_files_ok' => 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 = [ + 'cors_list_scanned_files_ok' => 'corsListScannedFilesOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_list_scanned_files_ok' => 'setCorsListScannedFilesOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_list_scanned_files_ok' => 'getCorsListScannedFilesOk' + ]; + + /** + * 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('cors_list_scanned_files_ok', $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 cors_list_scanned_files_ok + * + * @return string|null + */ + public function getCorsListScannedFilesOk() + { + return $this->container['cors_list_scanned_files_ok']; + } + + /** + * Sets cors_list_scanned_files_ok + * + * @param string|null $cors_list_scanned_files_ok cors_list_scanned_files_ok + * + * @return self + */ + public function setCorsListScannedFilesOk($cors_list_scanned_files_ok) + { + if (is_null($cors_list_scanned_files_ok)) { + throw new \InvalidArgumentException('non-nullable cors_list_scanned_files_ok cannot be null'); + } + $this->container['cors_list_scanned_files_ok'] = $cors_list_scanned_files_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsMoveNodeOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsMoveNodeOK.php new file mode 100644 index 0000000..62d428a --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsMoveNodeOK.php @@ -0,0 +1,410 @@ + + */ +class CorsMoveNodeOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsMoveNodeOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_move_node_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_move_node_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_move_node_ok' => 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 = [ + 'cors_move_node_ok' => 'corsMoveNodeOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_move_node_ok' => 'setCorsMoveNodeOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_move_node_ok' => 'getCorsMoveNodeOk' + ]; + + /** + * 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('cors_move_node_ok', $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 cors_move_node_ok + * + * @return string|null + */ + public function getCorsMoveNodeOk() + { + return $this->container['cors_move_node_ok']; + } + + /** + * Sets cors_move_node_ok + * + * @param string|null $cors_move_node_ok cors_move_node_ok + * + * @return self + */ + public function setCorsMoveNodeOk($cors_move_node_ok) + { + if (is_null($cors_move_node_ok)) { + throw new \InvalidArgumentException('non-nullable cors_move_node_ok cannot be null'); + } + $this->container['cors_move_node_ok'] = $cors_move_node_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsPermanentlyDeleteNodeOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsPermanentlyDeleteNodeOK.php new file mode 100644 index 0000000..4418887 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsPermanentlyDeleteNodeOK.php @@ -0,0 +1,410 @@ + + */ +class CorsPermanentlyDeleteNodeOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsPermanentlyDeleteNodeOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_permanently_delete_node_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_permanently_delete_node_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_permanently_delete_node_ok' => 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 = [ + 'cors_permanently_delete_node_ok' => 'corsPermanentlyDeleteNodeOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_permanently_delete_node_ok' => 'setCorsPermanentlyDeleteNodeOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_permanently_delete_node_ok' => 'getCorsPermanentlyDeleteNodeOk' + ]; + + /** + * 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('cors_permanently_delete_node_ok', $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 cors_permanently_delete_node_ok + * + * @return string|null + */ + public function getCorsPermanentlyDeleteNodeOk() + { + return $this->container['cors_permanently_delete_node_ok']; + } + + /** + * Sets cors_permanently_delete_node_ok + * + * @param string|null $cors_permanently_delete_node_ok cors_permanently_delete_node_ok + * + * @return self + */ + public function setCorsPermanentlyDeleteNodeOk($cors_permanently_delete_node_ok) + { + if (is_null($cors_permanently_delete_node_ok)) { + throw new \InvalidArgumentException('non-nullable cors_permanently_delete_node_ok cannot be null'); + } + $this->container['cors_permanently_delete_node_ok'] = $cors_permanently_delete_node_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsRestoreNodeFromTrashbinOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsRestoreNodeFromTrashbinOK.php new file mode 100644 index 0000000..0ead5b7 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsRestoreNodeFromTrashbinOK.php @@ -0,0 +1,410 @@ + + */ +class CorsRestoreNodeFromTrashbinOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsRestoreNodeFromTrashbinOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_restore_node_from_trashbin_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_restore_node_from_trashbin_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_restore_node_from_trashbin_ok' => 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 = [ + 'cors_restore_node_from_trashbin_ok' => 'corsRestoreNodeFromTrashbinOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_restore_node_from_trashbin_ok' => 'setCorsRestoreNodeFromTrashbinOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_restore_node_from_trashbin_ok' => 'getCorsRestoreNodeFromTrashbinOk' + ]; + + /** + * 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('cors_restore_node_from_trashbin_ok', $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 cors_restore_node_from_trashbin_ok + * + * @return string|null + */ + public function getCorsRestoreNodeFromTrashbinOk() + { + return $this->container['cors_restore_node_from_trashbin_ok']; + } + + /** + * Sets cors_restore_node_from_trashbin_ok + * + * @param string|null $cors_restore_node_from_trashbin_ok cors_restore_node_from_trashbin_ok + * + * @return self + */ + public function setCorsRestoreNodeFromTrashbinOk($cors_restore_node_from_trashbin_ok) + { + if (is_null($cors_restore_node_from_trashbin_ok)) { + throw new \InvalidArgumentException('non-nullable cors_restore_node_from_trashbin_ok cannot be null'); + } + $this->container['cors_restore_node_from_trashbin_ok'] = $cors_restore_node_from_trashbin_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsStartFileScanOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsStartFileScanOK.php new file mode 100644 index 0000000..e6043b1 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsStartFileScanOK.php @@ -0,0 +1,410 @@ + + */ +class CorsStartFileScanOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsStartFileScanOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_start_file_scan_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_start_file_scan_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_start_file_scan_ok' => 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 = [ + 'cors_start_file_scan_ok' => 'corsStartFileScanOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_start_file_scan_ok' => 'setCorsStartFileScanOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_start_file_scan_ok' => 'getCorsStartFileScanOk' + ]; + + /** + * 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('cors_start_file_scan_ok', $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 cors_start_file_scan_ok + * + * @return string|null + */ + public function getCorsStartFileScanOk() + { + return $this->container['cors_start_file_scan_ok']; + } + + /** + * Sets cors_start_file_scan_ok + * + * @param string|null $cors_start_file_scan_ok cors_start_file_scan_ok + * + * @return self + */ + public function setCorsStartFileScanOk($cors_start_file_scan_ok) + { + if (is_null($cors_start_file_scan_ok)) { + throw new \InvalidArgumentException('non-nullable cors_start_file_scan_ok cannot be null'); + } + $this->container['cors_start_file_scan_ok'] = $cors_start_file_scan_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CorsUpdateProfileDataOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CorsUpdateProfileDataOK.php new file mode 100644 index 0000000..5b57c31 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CorsUpdateProfileDataOK.php @@ -0,0 +1,410 @@ + + */ +class CorsUpdateProfileDataOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CorsUpdateProfileDataOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cors_update_profile_data_ok' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cors_update_profile_data_ok' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cors_update_profile_data_ok' => 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 = [ + 'cors_update_profile_data_ok' => 'corsUpdateProfileDataOk' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cors_update_profile_data_ok' => 'setCorsUpdateProfileDataOk' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cors_update_profile_data_ok' => 'getCorsUpdateProfileDataOk' + ]; + + /** + * 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('cors_update_profile_data_ok', $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 cors_update_profile_data_ok + * + * @return string|null + */ + public function getCorsUpdateProfileDataOk() + { + return $this->container['cors_update_profile_data_ok']; + } + + /** + * Sets cors_update_profile_data_ok + * + * @param string|null $cors_update_profile_data_ok cors_update_profile_data_ok + * + * @return self + */ + public function setCorsUpdateProfileDataOk($cors_update_profile_data_ok) + { + if (is_null($cors_update_profile_data_ok)) { + throw new \InvalidArgumentException('non-nullable cors_update_profile_data_ok cannot be null'); + } + $this->container['cors_update_profile_data_ok'] = $cors_update_profile_data_ok; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CreateNodeInput.php b/src/Clients/VaultDataManagerClient/lib/Model/CreateNodeInput.php new file mode 100644 index 0000000..45f7127 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CreateNodeInput.php @@ -0,0 +1,628 @@ + + */ +class CreateNodeInput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateNodeInput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'type' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType', + 'description' => 'string', + 'parent_node_id' => 'string', + 'edek_info' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo', + 'dek' => 'string', + 'metadata' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'type' => null, + 'description' => null, + 'parent_node_id' => null, + 'edek_info' => null, + 'dek' => null, + 'metadata' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'type' => false, + 'description' => false, + 'parent_node_id' => false, + 'edek_info' => false, + 'dek' => false, + 'metadata' => 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 = [ + 'name' => 'name', + 'type' => 'type', + 'description' => 'description', + 'parent_node_id' => 'parentNodeId', + 'edek_info' => 'edekInfo', + 'dek' => 'dek', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'type' => 'setType', + 'description' => 'setDescription', + 'parent_node_id' => 'setParentNodeId', + 'edek_info' => 'setEdekInfo', + 'dek' => 'setDek', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'type' => 'getType', + 'description' => 'getDescription', + 'parent_node_id' => 'getParentNodeId', + 'edek_info' => 'getEdekInfo', + 'dek' => 'getDek', + 'metadata' => 'getMetadata' + ]; + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('parent_node_id', $data ?? [], null); + $this->setIfExists('edek_info', $data ?? [], null); + $this->setIfExists('dek', $data ?? [], null); + $this->setIfExists('metadata', $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 = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ((mb_strlen($this->container['name']) > 128)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 128."; + } + + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the item + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 128)) { + throw new \InvalidArgumentException('invalid length for $name when calling CreateNodeInput., must be smaller than or equal to 128.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description of profile if creating a new profile + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets parent_node_id + * + * @return string|null + */ + public function getParentNodeId() + { + return $this->container['parent_node_id']; + } + + /** + * Sets parent_node_id + * + * @param string|null $parent_node_id parent node id, if not provided then root element is used + * + * @return self + */ + public function setParentNodeId($parent_node_id) + { + if (is_null($parent_node_id)) { + throw new \InvalidArgumentException('non-nullable parent_node_id cannot be null'); + } + $this->container['parent_node_id'] = $parent_node_id; + + return $this; + } + + /** + * Gets edek_info + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo|null + */ + public function getEdekInfo() + { + return $this->container['edek_info']; + } + + /** + * Sets edek_info + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo|null $edek_info edek_info + * + * @return self + */ + public function setEdekInfo($edek_info) + { + if (is_null($edek_info)) { + throw new \InvalidArgumentException('non-nullable edek_info cannot be null'); + } + $this->container['edek_info'] = $edek_info; + + return $this; + } + + /** + * Gets dek + * + * @return string|null + */ + public function getDek() + { + return $this->container['dek']; + } + + /** + * Sets dek + * + * @param string|null $dek A base64 encoded data encryption key, encrypted using VFS public key, required for node types [FILE, PROFILE] + * + * @return self + */ + public function setDek($dek) + { + if (is_null($dek)) { + throw new \InvalidArgumentException('non-nullable dek cannot be null'); + } + $this->container['dek'] = $dek; + + return $this; + } + + /** + * Gets metadata + * + * @return string|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param string|null $metadata metadata of the node in stringified json format + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + 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/src/Clients/VaultDataManagerClient/lib/Model/CreateNodeOK.php b/src/Clients/VaultDataManagerClient/lib/Model/CreateNodeOK.php new file mode 100644 index 0000000..894b576 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/CreateNodeOK.php @@ -0,0 +1,515 @@ + + */ +class CreateNodeOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateNodeOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'node_id' => 'string', + 'url' => 'string', + 'link' => 'string', + 'fields' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'node_id' => null, + 'url' => null, + 'link' => null, + 'fields' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'node_id' => false, + 'url' => false, + 'link' => false, + 'fields' => 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 = [ + 'node_id' => 'nodeId', + 'url' => 'url', + 'link' => 'link', + 'fields' => 'fields' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'node_id' => 'setNodeId', + 'url' => 'setUrl', + 'link' => 'setLink', + 'fields' => 'setFields' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'node_id' => 'getNodeId', + 'url' => 'getUrl', + 'link' => 'getLink', + 'fields' => 'getFields' + ]; + + /** + * 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('node_id', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('fields', $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 = []; + + if ($this->container['node_id'] === null) { + $invalidProperties[] = "'node_id' can't be null"; + } + 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 node_id + * + * @return string + */ + public function getNodeId() + { + return $this->container['node_id']; + } + + /** + * Sets node_id + * + * @param string $node_id node_id + * + * @return self + */ + public function setNodeId($node_id) + { + if (is_null($node_id)) { + throw new \InvalidArgumentException('non-nullable node_id cannot be null'); + } + $this->container['node_id'] = $node_id; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link link + * + * @return self + */ + public function setLink($link) + { + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets fields + * + * @return array|null + */ + public function getFields() + { + return $this->container['fields']; + } + + /** + * Sets fields + * + * @param array|null $fields fields + * + * @return self + */ + public function setFields($fields) + { + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } + $this->container['fields'] = $fields; + + 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/src/Clients/VaultDataManagerClient/lib/Model/DeleteNodeDto.php b/src/Clients/VaultDataManagerClient/lib/Model/DeleteNodeDto.php new file mode 100644 index 0000000..2a785fe --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/DeleteNodeDto.php @@ -0,0 +1,410 @@ + + */ +class DeleteNodeDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DeleteNodeDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'new_node_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'new_node_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'new_node_id' => 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 = [ + 'new_node_id' => 'newNodeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'new_node_id' => 'setNewNodeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'new_node_id' => 'getNewNodeId' + ]; + + /** + * 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('new_node_id', $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 new_node_id + * + * @return string|null + */ + public function getNewNodeId() + { + return $this->container['new_node_id']; + } + + /** + * Sets new_node_id + * + * @param string|null $new_node_id new_node_id + * + * @return self + */ + public function setNewNodeId($new_node_id) + { + if (is_null($new_node_id)) { + throw new \InvalidArgumentException('non-nullable new_node_id cannot be null'); + } + $this->container['new_node_id'] = $new_node_id; + + 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/src/Clients/VaultDataManagerClient/lib/Model/EdekInfo.php b/src/Clients/VaultDataManagerClient/lib/Model/EdekInfo.php new file mode 100644 index 0000000..ab4bef3 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/EdekInfo.php @@ -0,0 +1,451 @@ + + */ +class EdekInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EdekInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'edek' => 'string', + 'dekek_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'edek' => null, + 'dekek_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'edek' => false, + 'dekek_id' => 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 = [ + 'edek' => 'edek', + 'dekek_id' => 'dekekId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'edek' => 'setEdek', + 'dekek_id' => 'setDekekId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'edek' => 'getEdek', + 'dekek_id' => 'getDekekId' + ]; + + /** + * 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('edek', $data ?? [], null); + $this->setIfExists('dekek_id', $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 = []; + + if ($this->container['edek'] === null) { + $invalidProperties[] = "'edek' can't be null"; + } + if ($this->container['dekek_id'] === null) { + $invalidProperties[] = "'dekek_id' can't be null"; + } + 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 edek + * + * @return string + */ + public function getEdek() + { + return $this->container['edek']; + } + + /** + * Sets edek + * + * @param string $edek edek + * + * @return self + */ + public function setEdek($edek) + { + if (is_null($edek)) { + throw new \InvalidArgumentException('non-nullable edek cannot be null'); + } + $this->container['edek'] = $edek; + + return $this; + } + + /** + * Gets dekek_id + * + * @return string + */ + public function getDekekId() + { + return $this->container['dekek_id']; + } + + /** + * Sets dekek_id + * + * @param string $dekek_id dekek_id + * + * @return self + */ + public function setDekekId($dekek_id) + { + if (is_null($dekek_id)) { + throw new \InvalidArgumentException('non-nullable dekek_id cannot be null'); + } + $this->container['dekek_id'] = $dekek_id; + + 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/src/Clients/VaultDataManagerClient/lib/Model/GetConfigOK.php b/src/Clients/VaultDataManagerClient/lib/Model/GetConfigOK.php new file mode 100644 index 0000000..0c00b86 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/GetConfigOK.php @@ -0,0 +1,450 @@ + + */ +class GetConfigOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetConfigOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'profile_name' => 'string', + 'maximum_profiles' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'profile_name' => null, + 'maximum_profiles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'profile_name' => false, + 'maximum_profiles' => 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 = [ + 'profile_name' => 'profileName', + 'maximum_profiles' => 'maximumProfiles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'profile_name' => 'setProfileName', + 'maximum_profiles' => 'setMaximumProfiles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'profile_name' => 'getProfileName', + 'maximum_profiles' => 'getMaximumProfiles' + ]; + + /** + * 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('profile_name', $data ?? [], null); + $this->setIfExists('maximum_profiles', $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 = []; + + if ($this->container['profile_name'] === null) { + $invalidProperties[] = "'profile_name' can't be null"; + } + if ($this->container['maximum_profiles'] === null) { + $invalidProperties[] = "'maximum_profiles' can't be null"; + } + 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 profile_name + * + * @return string + */ + public function getProfileName() + { + return $this->container['profile_name']; + } + + /** + * Sets profile_name + * + * @param string $profile_name profile_name + * + * @return self + */ + public function setProfileName($profile_name) + { + if (is_null($profile_name)) { + throw new \InvalidArgumentException('non-nullable profile_name cannot be null'); + } + $this->container['profile_name'] = $profile_name; + + return $this; + } + + /** + * Gets maximum_profiles + * + * @return float + */ + public function getMaximumProfiles() + { + return $this->container['maximum_profiles']; + } + + /** + * Sets maximum_profiles + * + * @param float $maximum_profiles maximum_profiles + * + * @return self + */ + public function setMaximumProfiles($maximum_profiles) + { + if (is_null($maximum_profiles)) { + throw new \InvalidArgumentException('non-nullable maximum_profiles cannot be null'); + } + $this->container['maximum_profiles'] = $maximum_profiles; + + 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/src/Clients/VaultDataManagerClient/lib/Model/GetDetailedNodeInfoOK.php b/src/Clients/VaultDataManagerClient/lib/Model/GetDetailedNodeInfoOK.php new file mode 100644 index 0000000..67c18f9 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/GetDetailedNodeInfoOK.php @@ -0,0 +1,1160 @@ + + */ +class GetDetailedNodeInfoOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetDetailedNodeInfoOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'node_id' => 'string', + 'status' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus', + 'file_count' => 'float', + 'profile_count' => 'float', + 'folder_count' => 'float', + 'vc_count' => 'float', + 'name' => 'string', + 'consumer_id' => 'string', + 'parent_node_id' => 'string', + 'profile_id' => 'string', + 'created_at' => 'string', + 'modified_at' => 'string', + 'created_by' => 'string', + 'modified_by' => 'string', + 'description' => 'string', + 'type' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType', + 'link' => 'string', + 'schema' => 'string', + 'consumed_file_storage' => 'float', + 'edek_info' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo', + 'metadata' => 'string', + 'get_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'node_id' => null, + 'status' => null, + 'file_count' => null, + 'profile_count' => null, + 'folder_count' => null, + 'vc_count' => null, + 'name' => null, + 'consumer_id' => null, + 'parent_node_id' => null, + 'profile_id' => null, + 'created_at' => null, + 'modified_at' => null, + 'created_by' => null, + 'modified_by' => null, + 'description' => null, + 'type' => null, + 'link' => null, + 'schema' => null, + 'consumed_file_storage' => null, + 'edek_info' => null, + 'metadata' => null, + 'get_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'node_id' => false, + 'status' => false, + 'file_count' => false, + 'profile_count' => false, + 'folder_count' => false, + 'vc_count' => false, + 'name' => false, + 'consumer_id' => false, + 'parent_node_id' => false, + 'profile_id' => false, + 'created_at' => false, + 'modified_at' => false, + 'created_by' => false, + 'modified_by' => false, + 'description' => false, + 'type' => false, + 'link' => false, + 'schema' => false, + 'consumed_file_storage' => false, + 'edek_info' => false, + 'metadata' => false, + 'get_url' => 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 = [ + 'node_id' => 'nodeId', + 'status' => 'status', + 'file_count' => 'fileCount', + 'profile_count' => 'profileCount', + 'folder_count' => 'folderCount', + 'vc_count' => 'vcCount', + 'name' => 'name', + 'consumer_id' => 'consumerId', + 'parent_node_id' => 'parentNodeId', + 'profile_id' => 'profileId', + 'created_at' => 'createdAt', + 'modified_at' => 'modifiedAt', + 'created_by' => 'createdBy', + 'modified_by' => 'modifiedBy', + 'description' => 'description', + 'type' => 'type', + 'link' => 'link', + 'schema' => 'schema', + 'consumed_file_storage' => 'consumedFileStorage', + 'edek_info' => 'edekInfo', + 'metadata' => 'metadata', + 'get_url' => 'getUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'node_id' => 'setNodeId', + 'status' => 'setStatus', + 'file_count' => 'setFileCount', + 'profile_count' => 'setProfileCount', + 'folder_count' => 'setFolderCount', + 'vc_count' => 'setVcCount', + 'name' => 'setName', + 'consumer_id' => 'setConsumerId', + 'parent_node_id' => 'setParentNodeId', + 'profile_id' => 'setProfileId', + 'created_at' => 'setCreatedAt', + 'modified_at' => 'setModifiedAt', + 'created_by' => 'setCreatedBy', + 'modified_by' => 'setModifiedBy', + 'description' => 'setDescription', + 'type' => 'setType', + 'link' => 'setLink', + 'schema' => 'setSchema', + 'consumed_file_storage' => 'setConsumedFileStorage', + 'edek_info' => 'setEdekInfo', + 'metadata' => 'setMetadata', + 'get_url' => 'setGetUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'node_id' => 'getNodeId', + 'status' => 'getStatus', + 'file_count' => 'getFileCount', + 'profile_count' => 'getProfileCount', + 'folder_count' => 'getFolderCount', + 'vc_count' => 'getVcCount', + 'name' => 'getName', + 'consumer_id' => 'getConsumerId', + 'parent_node_id' => 'getParentNodeId', + 'profile_id' => 'getProfileId', + 'created_at' => 'getCreatedAt', + 'modified_at' => 'getModifiedAt', + 'created_by' => 'getCreatedBy', + 'modified_by' => 'getModifiedBy', + 'description' => 'getDescription', + 'type' => 'getType', + 'link' => 'getLink', + 'schema' => 'getSchema', + 'consumed_file_storage' => 'getConsumedFileStorage', + 'edek_info' => 'getEdekInfo', + 'metadata' => 'getMetadata', + 'get_url' => 'getGetUrl' + ]; + + /** + * 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('node_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('file_count', $data ?? [], null); + $this->setIfExists('profile_count', $data ?? [], null); + $this->setIfExists('folder_count', $data ?? [], null); + $this->setIfExists('vc_count', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('consumer_id', $data ?? [], null); + $this->setIfExists('parent_node_id', $data ?? [], null); + $this->setIfExists('profile_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('modified_at', $data ?? [], null); + $this->setIfExists('created_by', $data ?? [], null); + $this->setIfExists('modified_by', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('schema', $data ?? [], null); + $this->setIfExists('consumed_file_storage', $data ?? [], null); + $this->setIfExists('edek_info', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('get_url', $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 = []; + + if ($this->container['node_id'] === null) { + $invalidProperties[] = "'node_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['consumer_id'] === null) { + $invalidProperties[] = "'consumer_id' can't be null"; + } + if ($this->container['parent_node_id'] === null) { + $invalidProperties[] = "'parent_node_id' can't be null"; + } + if ($this->container['profile_id'] === null) { + $invalidProperties[] = "'profile_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['modified_at'] === null) { + $invalidProperties[] = "'modified_at' can't be null"; + } + if ($this->container['created_by'] === null) { + $invalidProperties[] = "'created_by' can't be null"; + } + if ($this->container['modified_by'] === null) { + $invalidProperties[] = "'modified_by' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 node_id + * + * @return string + */ + public function getNodeId() + { + return $this->container['node_id']; + } + + /** + * Sets node_id + * + * @param string $node_id A unique identifier of current node + * + * @return self + */ + public function setNodeId($node_id) + { + if (is_null($node_id)) { + throw new \InvalidArgumentException('non-nullable node_id cannot be null'); + } + $this->container['node_id'] = $node_id; + + return $this; + } + + /** + * Gets status + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets file_count + * + * @return float|null + */ + public function getFileCount() + { + return $this->container['file_count']; + } + + /** + * Sets file_count + * + * @param float|null $file_count number of files in current node + * + * @return self + */ + public function setFileCount($file_count) + { + if (is_null($file_count)) { + throw new \InvalidArgumentException('non-nullable file_count cannot be null'); + } + $this->container['file_count'] = $file_count; + + return $this; + } + + /** + * Gets profile_count + * + * @return float|null + */ + public function getProfileCount() + { + return $this->container['profile_count']; + } + + /** + * Sets profile_count + * + * @param float|null $profile_count number of profiles in current node + * + * @return self + */ + public function setProfileCount($profile_count) + { + if (is_null($profile_count)) { + throw new \InvalidArgumentException('non-nullable profile_count cannot be null'); + } + $this->container['profile_count'] = $profile_count; + + return $this; + } + + /** + * Gets folder_count + * + * @return float|null + */ + public function getFolderCount() + { + return $this->container['folder_count']; + } + + /** + * Sets folder_count + * + * @param float|null $folder_count number of folders in current node + * + * @return self + */ + public function setFolderCount($folder_count) + { + if (is_null($folder_count)) { + throw new \InvalidArgumentException('non-nullable folder_count cannot be null'); + } + $this->container['folder_count'] = $folder_count; + + return $this; + } + + /** + * Gets vc_count + * + * @return float|null + */ + public function getVcCount() + { + return $this->container['vc_count']; + } + + /** + * Sets vc_count + * + * @param float|null $vc_count number of vcCount in current node + * + * @return self + */ + public function setVcCount($vc_count) + { + if (is_null($vc_count)) { + throw new \InvalidArgumentException('non-nullable vc_count cannot be null'); + } + $this->container['vc_count'] = $vc_count; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name display name of current node + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets consumer_id + * + * @return string + */ + public function getConsumerId() + { + return $this->container['consumer_id']; + } + + /** + * Sets consumer_id + * + * @param string $consumer_id unique identifier for consumer + * + * @return self + */ + public function setConsumerId($consumer_id) + { + if (is_null($consumer_id)) { + throw new \InvalidArgumentException('non-nullable consumer_id cannot be null'); + } + $this->container['consumer_id'] = $consumer_id; + + return $this; + } + + /** + * Gets parent_node_id + * + * @return string + */ + public function getParentNodeId() + { + return $this->container['parent_node_id']; + } + + /** + * Sets parent_node_id + * + * @param string $parent_node_id parent node path + * + * @return self + */ + public function setParentNodeId($parent_node_id) + { + if (is_null($parent_node_id)) { + throw new \InvalidArgumentException('non-nullable parent_node_id cannot be null'); + } + $this->container['parent_node_id'] = $parent_node_id; + + return $this; + } + + /** + * Gets profile_id + * + * @return string + */ + public function getProfileId() + { + return $this->container['profile_id']; + } + + /** + * Sets profile_id + * + * @param string $profile_id A unique identifier of profile, under which current node is created + * + * @return self + */ + public function setProfileId($profile_id) + { + if (is_null($profile_id)) { + throw new \InvalidArgumentException('non-nullable profile_id cannot be null'); + } + $this->container['profile_id'] = $profile_id; + + return $this; + } + + /** + * Gets created_at + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string $created_at creation date/time of the node + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets modified_at + * + * @return string + */ + public function getModifiedAt() + { + return $this->container['modified_at']; + } + + /** + * Sets modified_at + * + * @param string $modified_at modification date/time of the node + * + * @return self + */ + public function setModifiedAt($modified_at) + { + if (is_null($modified_at)) { + throw new \InvalidArgumentException('non-nullable modified_at cannot be null'); + } + $this->container['modified_at'] = $modified_at; + + return $this; + } + + /** + * Gets created_by + * + * @return string + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param string $created_by Identifier of the user who created the node + * + * @return self + */ + public function setCreatedBy($created_by) + { + if (is_null($created_by)) { + throw new \InvalidArgumentException('non-nullable created_by cannot be null'); + } + $this->container['created_by'] = $created_by; + + return $this; + } + + /** + * Gets modified_by + * + * @return string + */ + public function getModifiedBy() + { + return $this->container['modified_by']; + } + + /** + * Sets modified_by + * + * @param string $modified_by Identifier of the user who last updated the node + * + * @return self + */ + public function setModifiedBy($modified_by) + { + if (is_null($modified_by)) { + throw new \InvalidArgumentException('non-nullable modified_by cannot be null'); + } + $this->container['modified_by'] = $modified_by; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Description of the node + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets type + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link id of the file, used for FILE node only + * + * @return self + */ + public function setLink($link) + { + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets schema + * + * @return string|null + */ + public function getSchema() + { + return $this->container['schema']; + } + + /** + * Sets schema + * + * @param string|null $schema name of the schema, used for PROFILE node only + * + * @return self + */ + public function setSchema($schema) + { + if (is_null($schema)) { + throw new \InvalidArgumentException('non-nullable schema cannot be null'); + } + $this->container['schema'] = $schema; + + return $this; + } + + /** + * Gets consumed_file_storage + * + * @return float|null + */ + public function getConsumedFileStorage() + { + return $this->container['consumed_file_storage']; + } + + /** + * Sets consumed_file_storage + * + * @param float|null $consumed_file_storage amount of bytes used by the stored data, used for ROOT_ELEMENT only for now + * + * @return self + */ + public function setConsumedFileStorage($consumed_file_storage) + { + if (is_null($consumed_file_storage)) { + throw new \InvalidArgumentException('non-nullable consumed_file_storage cannot be null'); + } + $this->container['consumed_file_storage'] = $consumed_file_storage; + + return $this; + } + + /** + * Gets edek_info + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo|null + */ + public function getEdekInfo() + { + return $this->container['edek_info']; + } + + /** + * Sets edek_info + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo|null $edek_info edek_info + * + * @return self + */ + public function setEdekInfo($edek_info) + { + if (is_null($edek_info)) { + throw new \InvalidArgumentException('non-nullable edek_info cannot be null'); + } + $this->container['edek_info'] = $edek_info; + + return $this; + } + + /** + * Gets metadata + * + * @return string|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param string|null $metadata A JSON string format containing metadata of the node + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets get_url + * + * @return string|null + */ + public function getGetUrl() + { + return $this->container['get_url']; + } + + /** + * Sets get_url + * + * @param string|null $get_url get_url + * + * @return self + */ + public function setGetUrl($get_url) + { + if (is_null($get_url)) { + throw new \InvalidArgumentException('non-nullable get_url cannot be null'); + } + $this->container['get_url'] = $get_url; + + 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/src/Clients/VaultDataManagerClient/lib/Model/GetScannedFileInfoOK.php b/src/Clients/VaultDataManagerClient/lib/Model/GetScannedFileInfoOK.php new file mode 100644 index 0000000..3ebcb1d --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/GetScannedFileInfoOK.php @@ -0,0 +1,669 @@ + + */ +class GetScannedFileInfoOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetScannedFileInfoOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'object', + 'job_id' => 'string', + 'status' => 'string', + 'profile_id' => 'string', + 'exclusive_start_key' => 'string', + 'node_id' => 'string', + 'created_at' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'job_id' => null, + 'status' => null, + 'profile_id' => null, + 'exclusive_start_key' => null, + 'node_id' => null, + 'created_at' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'job_id' => false, + 'status' => false, + 'profile_id' => false, + 'exclusive_start_key' => false, + 'node_id' => false, + 'created_at' => false, + 'name' => 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 = [ + 'data' => 'data', + 'job_id' => 'jobId', + 'status' => 'status', + 'profile_id' => 'profileId', + 'exclusive_start_key' => 'exclusiveStartKey', + 'node_id' => 'nodeId', + 'created_at' => 'createdAt', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'job_id' => 'setJobId', + 'status' => 'setStatus', + 'profile_id' => 'setProfileId', + 'exclusive_start_key' => 'setExclusiveStartKey', + 'node_id' => 'setNodeId', + 'created_at' => 'setCreatedAt', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'job_id' => 'getJobId', + 'status' => 'getStatus', + 'profile_id' => 'getProfileId', + 'exclusive_start_key' => 'getExclusiveStartKey', + 'node_id' => 'getNodeId', + 'created_at' => 'getCreatedAt', + 'name' => 'getName' + ]; + + /** + * 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('data', $data ?? [], null); + $this->setIfExists('job_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('profile_id', $data ?? [], null); + $this->setIfExists('exclusive_start_key', $data ?? [], null); + $this->setIfExists('node_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('name', $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 = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['job_id'] === null) { + $invalidProperties[] = "'job_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['profile_id'] === null) { + $invalidProperties[] = "'profile_id' can't be null"; + } + if ($this->container['node_id'] === null) { + $invalidProperties[] = "'node_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + 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 data + * + * @return object + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets job_id + * + * @return string + */ + public function getJobId() + { + return $this->container['job_id']; + } + + /** + * Sets job_id + * + * @param string $job_id A unique, randomly generated idetifier + * + * @return self + */ + public function setJobId($job_id) + { + if (is_null($job_id)) { + throw new \InvalidArgumentException('non-nullable job_id cannot be null'); + } + $this->container['job_id'] = $job_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the file scanning once initiated + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets profile_id + * + * @return string + */ + public function getProfileId() + { + return $this->container['profile_id']; + } + + /** + * Sets profile_id + * + * @param string $profile_id A unique, randomly generated identifier + * + * @return self + */ + public function setProfileId($profile_id) + { + if (is_null($profile_id)) { + throw new \InvalidArgumentException('non-nullable profile_id cannot be null'); + } + $this->container['profile_id'] = $profile_id; + + return $this; + } + + /** + * Gets exclusive_start_key + * + * @return string|null + */ + public function getExclusiveStartKey() + { + return $this->container['exclusive_start_key']; + } + + /** + * Sets exclusive_start_key + * + * @param string|null $exclusive_start_key The base64url encoded key of the first item that this operation will evaluate (it is not returned). Use the value that was returned in the previous operation. + * + * @return self + */ + public function setExclusiveStartKey($exclusive_start_key) + { + if (is_null($exclusive_start_key)) { + throw new \InvalidArgumentException('non-nullable exclusive_start_key cannot be null'); + } + $this->container['exclusive_start_key'] = $exclusive_start_key; + + return $this; + } + + /** + * Gets node_id + * + * @return string + */ + public function getNodeId() + { + return $this->container['node_id']; + } + + /** + * Sets node_id + * + * @param string $node_id A unique, randomly generated identifier + * + * @return self + */ + public function setNodeId($node_id) + { + if (is_null($node_id)) { + throw new \InvalidArgumentException('non-nullable node_id cannot be null'); + } + $this->container['node_id'] = $node_id; + + return $this; + } + + /** + * Gets created_at + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + 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/src/Clients/VaultDataManagerClient/lib/Model/InitNodesOK.php b/src/Clients/VaultDataManagerClient/lib/Model/InitNodesOK.php new file mode 100644 index 0000000..f4d13b2 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/InitNodesOK.php @@ -0,0 +1,444 @@ + + */ +class InitNodesOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InitNodesOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'consumer_metadata' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ConsumerMetadataDto', + 'default_profile' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'consumer_metadata' => null, + 'default_profile' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'consumer_metadata' => false, + 'default_profile' => 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 = [ + 'consumer_metadata' => 'consumerMetadata', + 'default_profile' => 'defaultProfile' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'consumer_metadata' => 'setConsumerMetadata', + 'default_profile' => 'setDefaultProfile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'consumer_metadata' => 'getConsumerMetadata', + 'default_profile' => 'getDefaultProfile' + ]; + + /** + * 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('consumer_metadata', $data ?? [], null); + $this->setIfExists('default_profile', $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 consumer_metadata + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\ConsumerMetadataDto|null + */ + public function getConsumerMetadata() + { + return $this->container['consumer_metadata']; + } + + /** + * Sets consumer_metadata + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\ConsumerMetadataDto|null $consumer_metadata consumer_metadata + * + * @return self + */ + public function setConsumerMetadata($consumer_metadata) + { + if (is_null($consumer_metadata)) { + throw new \InvalidArgumentException('non-nullable consumer_metadata cannot be null'); + } + $this->container['consumer_metadata'] = $consumer_metadata; + + return $this; + } + + /** + * Gets default_profile + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto|null + */ + public function getDefaultProfile() + { + return $this->container['default_profile']; + } + + /** + * Sets default_profile + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto|null $default_profile default_profile + * + * @return self + */ + public function setDefaultProfile($default_profile) + { + if (is_null($default_profile)) { + throw new \InvalidArgumentException('non-nullable default_profile cannot be null'); + } + $this->container['default_profile'] = $default_profile; + + 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/src/Clients/VaultDataManagerClient/lib/Model/InvalidParameterError.php b/src/Clients/VaultDataManagerClient/lib/Model/InvalidParameterError.php new file mode 100644 index 0000000..eabf87c --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/InvalidParameterError.php @@ -0,0 +1,655 @@ + + */ +class InvalidParameterError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidParameterError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'message' => 'string', + 'http_status_code' => 'float', + 'trace_id' => 'string', + 'details' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'message' => null, + 'http_status_code' => null, + 'trace_id' => null, + 'details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'http_status_code' => false, + 'trace_id' => false, + 'details' => 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 = [ + 'name' => 'name', + 'message' => 'message', + 'http_status_code' => 'httpStatusCode', + 'trace_id' => 'traceId', + 'details' => 'details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'message' => 'setMessage', + 'http_status_code' => 'setHttpStatusCode', + 'trace_id' => 'setTraceId', + 'details' => 'setDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'message' => 'getMessage', + 'http_status_code' => 'getHttpStatusCode', + 'trace_id' => 'getTraceId', + 'details' => 'getDetails' + ]; + + /** + * 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; + } + + public const NAME_INVALID_PARAMETER_ERROR = 'InvalidParameterError'; + public const MESSAGE_INVALID_PARAMETER___PARAM = 'Invalid parameter: ${param}.'; + public const HTTP_STATUS_CODE_NUMBER_400 = 400; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_INVALID_PARAMETER_ERROR, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMessageAllowableValues() + { + return [ + self::MESSAGE_INVALID_PARAMETER___PARAM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getHttpStatusCodeAllowableValues() + { + return [ + self::HTTP_STATUS_CODE_NUMBER_400, + ]; + } + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('http_status_code', $data ?? [], null); + $this->setIfExists('trace_id', $data ?? [], null); + $this->setIfExists('details', $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 = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'name', must be one of '%s'", + $this->container['name'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + $allowedValues = $this->getMessageAllowableValues(); + if (!is_null($this->container['message']) && !in_array($this->container['message'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'message', must be one of '%s'", + $this->container['message'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['http_status_code'] === null) { + $invalidProperties[] = "'http_status_code' can't be null"; + } + $allowedValues = $this->getHttpStatusCodeAllowableValues(); + if (!is_null($this->container['http_status_code']) && !in_array($this->container['http_status_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'http_status_code', must be one of '%s'", + $this->container['http_status_code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['trace_id'] === null) { + $invalidProperties[] = "'trace_id' can't be null"; + } + 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $allowedValues = $this->getNameAllowableValues(); + if (!in_array($name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'name', must be one of '%s'", + $name, + implode("', '", $allowedValues) + ) + ); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $allowedValues = $this->getMessageAllowableValues(); + if (!in_array($message, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'message', must be one of '%s'", + $message, + implode("', '", $allowedValues) + ) + ); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets http_status_code + * + * @return float + */ + public function getHttpStatusCode() + { + return $this->container['http_status_code']; + } + + /** + * Sets http_status_code + * + * @param float $http_status_code http_status_code + * + * @return self + */ + public function setHttpStatusCode($http_status_code) + { + if (is_null($http_status_code)) { + throw new \InvalidArgumentException('non-nullable http_status_code cannot be null'); + } + $allowedValues = $this->getHttpStatusCodeAllowableValues(); + if (!in_array($http_status_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'http_status_code', must be one of '%s'", + $http_status_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['http_status_code'] = $http_status_code; + + return $this; + } + + /** + * Gets trace_id + * + * @return string + */ + public function getTraceId() + { + return $this->container['trace_id']; + } + + /** + * Sets trace_id + * + * @param string $trace_id trace_id + * + * @return self + */ + public function setTraceId($trace_id) + { + if (is_null($trace_id)) { + throw new \InvalidArgumentException('non-nullable trace_id cannot be null'); + } + $this->container['trace_id'] = $trace_id; + + return $this; + } + + /** + * Gets details + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]|null $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + 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/src/Clients/VaultDataManagerClient/lib/Model/InvalidParameterErrorDetailsInner.php b/src/Clients/VaultDataManagerClient/lib/Model/InvalidParameterErrorDetailsInner.php new file mode 100644 index 0000000..e982361 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/InvalidParameterErrorDetailsInner.php @@ -0,0 +1,515 @@ + + */ +class InvalidParameterErrorDetailsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidParameterError_details_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'issue' => 'string', + 'field' => 'string', + 'value' => 'string', + 'location' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'issue' => null, + 'field' => null, + 'value' => null, + 'location' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'issue' => false, + 'field' => false, + 'value' => false, + 'location' => 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 = [ + 'issue' => 'issue', + 'field' => 'field', + 'value' => 'value', + 'location' => 'location' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'issue' => 'setIssue', + 'field' => 'setField', + 'value' => 'setValue', + 'location' => 'setLocation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'issue' => 'getIssue', + 'field' => 'getField', + 'value' => 'getValue', + 'location' => 'getLocation' + ]; + + /** + * 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('issue', $data ?? [], null); + $this->setIfExists('field', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('location', $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 = []; + + if ($this->container['issue'] === null) { + $invalidProperties[] = "'issue' can't be null"; + } + 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 issue + * + * @return string + */ + public function getIssue() + { + return $this->container['issue']; + } + + /** + * Sets issue + * + * @param string $issue issue + * + * @return self + */ + public function setIssue($issue) + { + if (is_null($issue)) { + throw new \InvalidArgumentException('non-nullable issue cannot be null'); + } + $this->container['issue'] = $issue; + + return $this; + } + + /** + * Gets field + * + * @return string|null + */ + public function getField() + { + return $this->container['field']; + } + + /** + * Sets field + * + * @param string|null $field field + * + * @return self + */ + public function setField($field) + { + if (is_null($field)) { + throw new \InvalidArgumentException('non-nullable field cannot be null'); + } + $this->container['field'] = $field; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets location + * + * @return string|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param string|null $location location + * + * @return self + */ + public function setLocation($location) + { + if (is_null($location)) { + throw new \InvalidArgumentException('non-nullable location cannot be null'); + } + $this->container['location'] = $location; + + 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/src/Clients/VaultDataManagerClient/lib/Model/JsonWebKeyDto.php b/src/Clients/VaultDataManagerClient/lib/Model/JsonWebKeyDto.php new file mode 100644 index 0000000..56e0122 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/JsonWebKeyDto.php @@ -0,0 +1,694 @@ + + */ +class JsonWebKeyDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JsonWebKeyDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'kid' => 'string', + 'kty' => 'string', + 'n' => 'string', + 'e' => 'string', + 'x' => 'string', + 'y' => 'string', + 'crv' => 'string', + 'alg' => 'string', + 'use' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'kid' => null, + 'kty' => null, + 'n' => null, + 'e' => null, + 'x' => null, + 'y' => null, + 'crv' => null, + 'alg' => null, + 'use' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'kid' => false, + 'kty' => false, + 'n' => false, + 'e' => false, + 'x' => false, + 'y' => false, + 'crv' => false, + 'alg' => false, + 'use' => 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 = [ + 'kid' => 'kid', + 'kty' => 'kty', + 'n' => 'n', + 'e' => 'e', + 'x' => 'x', + 'y' => 'y', + 'crv' => 'crv', + 'alg' => 'alg', + 'use' => 'use' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'kid' => 'setKid', + 'kty' => 'setKty', + 'n' => 'setN', + 'e' => 'setE', + 'x' => 'setX', + 'y' => 'setY', + 'crv' => 'setCrv', + 'alg' => 'setAlg', + 'use' => 'setUse' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'kid' => 'getKid', + 'kty' => 'getKty', + 'n' => 'getN', + 'e' => 'getE', + 'x' => 'getX', + 'y' => 'getY', + 'crv' => 'getCrv', + 'alg' => 'getAlg', + 'use' => 'getUse' + ]; + + /** + * 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('kid', $data ?? [], null); + $this->setIfExists('kty', $data ?? [], null); + $this->setIfExists('n', $data ?? [], null); + $this->setIfExists('e', $data ?? [], null); + $this->setIfExists('x', $data ?? [], null); + $this->setIfExists('y', $data ?? [], null); + $this->setIfExists('crv', $data ?? [], null); + $this->setIfExists('alg', $data ?? [], null); + $this->setIfExists('use', $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 = []; + + if ($this->container['kid'] === null) { + $invalidProperties[] = "'kid' can't be null"; + } + if ($this->container['kty'] === null) { + $invalidProperties[] = "'kty' can't be null"; + } + if ($this->container['alg'] === null) { + $invalidProperties[] = "'alg' can't be null"; + } + if ($this->container['use'] === null) { + $invalidProperties[] = "'use' can't be null"; + } + 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 kid + * + * @return string + */ + public function getKid() + { + return $this->container['kid']; + } + + /** + * Sets kid + * + * @param string $kid kid + * + * @return self + */ + public function setKid($kid) + { + if (is_null($kid)) { + throw new \InvalidArgumentException('non-nullable kid cannot be null'); + } + $this->container['kid'] = $kid; + + return $this; + } + + /** + * Gets kty + * + * @return string + */ + public function getKty() + { + return $this->container['kty']; + } + + /** + * Sets kty + * + * @param string $kty kty + * + * @return self + */ + public function setKty($kty) + { + if (is_null($kty)) { + throw new \InvalidArgumentException('non-nullable kty cannot be null'); + } + $this->container['kty'] = $kty; + + return $this; + } + + /** + * Gets n + * + * @return string|null + */ + public function getN() + { + return $this->container['n']; + } + + /** + * Sets n + * + * @param string|null $n n + * + * @return self + */ + public function setN($n) + { + if (is_null($n)) { + throw new \InvalidArgumentException('non-nullable n cannot be null'); + } + $this->container['n'] = $n; + + return $this; + } + + /** + * Gets e + * + * @return string|null + */ + public function getE() + { + return $this->container['e']; + } + + /** + * Sets e + * + * @param string|null $e e + * + * @return self + */ + public function setE($e) + { + if (is_null($e)) { + throw new \InvalidArgumentException('non-nullable e cannot be null'); + } + $this->container['e'] = $e; + + return $this; + } + + /** + * Gets x + * + * @return string|null + */ + public function getX() + { + return $this->container['x']; + } + + /** + * Sets x + * + * @param string|null $x x + * + * @return self + */ + public function setX($x) + { + if (is_null($x)) { + throw new \InvalidArgumentException('non-nullable x cannot be null'); + } + $this->container['x'] = $x; + + return $this; + } + + /** + * Gets y + * + * @return string|null + */ + public function getY() + { + return $this->container['y']; + } + + /** + * Sets y + * + * @param string|null $y y + * + * @return self + */ + public function setY($y) + { + if (is_null($y)) { + throw new \InvalidArgumentException('non-nullable y cannot be null'); + } + $this->container['y'] = $y; + + return $this; + } + + /** + * Gets crv + * + * @return string|null + */ + public function getCrv() + { + return $this->container['crv']; + } + + /** + * Sets crv + * + * @param string|null $crv crv + * + * @return self + */ + public function setCrv($crv) + { + if (is_null($crv)) { + throw new \InvalidArgumentException('non-nullable crv cannot be null'); + } + $this->container['crv'] = $crv; + + return $this; + } + + /** + * Gets alg + * + * @return string + */ + public function getAlg() + { + return $this->container['alg']; + } + + /** + * Sets alg + * + * @param string $alg alg + * + * @return self + */ + public function setAlg($alg) + { + if (is_null($alg)) { + throw new \InvalidArgumentException('non-nullable alg cannot be null'); + } + $this->container['alg'] = $alg; + + return $this; + } + + /** + * Gets use + * + * @return string + */ + public function getUse() + { + return $this->container['use']; + } + + /** + * Sets use + * + * @param string $use use + * + * @return self + */ + public function setUse($use) + { + if (is_null($use)) { + throw new \InvalidArgumentException('non-nullable use cannot be null'); + } + $this->container['use'] = $use; + + 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/src/Clients/VaultDataManagerClient/lib/Model/JsonWebKeySetDto.php b/src/Clients/VaultDataManagerClient/lib/Model/JsonWebKeySetDto.php new file mode 100644 index 0000000..9aacc65 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/JsonWebKeySetDto.php @@ -0,0 +1,422 @@ + + */ +class JsonWebKeySetDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'JsonWebKeySetDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'keys' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\JsonWebKeyDto[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'keys' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'keys' => 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 = [ + 'keys' => 'keys' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'keys' => 'setKeys' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'keys' => 'getKeys' + ]; + + /** + * 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('keys', $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 = []; + + if ($this->container['keys'] === null) { + $invalidProperties[] = "'keys' can't be null"; + } + if ((count($this->container['keys']) < 1)) { + $invalidProperties[] = "invalid value for 'keys', number of items must be greater than or equal to 1."; + } + + 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 keys + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\JsonWebKeyDto[] + */ + public function getKeys() + { + return $this->container['keys']; + } + + /** + * Sets keys + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\JsonWebKeyDto[] $keys keys + * + * @return self + */ + public function setKeys($keys) + { + if (is_null($keys)) { + throw new \InvalidArgumentException('non-nullable keys cannot be null'); + } + + + if ((count($keys) < 1)) { + throw new \InvalidArgumentException('invalid length for $keys when calling JsonWebKeySetDto., number of items must be greater than or equal to 1.'); + } + $this->container['keys'] = $keys; + + 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/src/Clients/VaultDataManagerClient/lib/Model/ListNodeChildrenOK.php b/src/Clients/VaultDataManagerClient/lib/Model/ListNodeChildrenOK.php new file mode 100644 index 0000000..e5380a7 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/ListNodeChildrenOK.php @@ -0,0 +1,444 @@ + + */ +class ListNodeChildrenOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListNodeChildrenOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'nodes' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]', + 'last_evaluated_key' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'nodes' => null, + 'last_evaluated_key' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nodes' => false, + 'last_evaluated_key' => 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 = [ + 'nodes' => 'nodes', + 'last_evaluated_key' => 'lastEvaluatedKey' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nodes' => 'setNodes', + 'last_evaluated_key' => 'setLastEvaluatedKey' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nodes' => 'getNodes', + 'last_evaluated_key' => 'getLastEvaluatedKey' + ]; + + /** + * 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('nodes', $data ?? [], null); + $this->setIfExists('last_evaluated_key', $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 nodes + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]|null + */ + public function getNodes() + { + return $this->container['nodes']; + } + + /** + * Sets nodes + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]|null $nodes nodes + * + * @return self + */ + public function setNodes($nodes) + { + if (is_null($nodes)) { + throw new \InvalidArgumentException('non-nullable nodes cannot be null'); + } + $this->container['nodes'] = $nodes; + + return $this; + } + + /** + * Gets last_evaluated_key + * + * @return string|null + */ + public function getLastEvaluatedKey() + { + return $this->container['last_evaluated_key']; + } + + /** + * Sets last_evaluated_key + * + * @param string|null $last_evaluated_key last_evaluated_key + * + * @return self + */ + public function setLastEvaluatedKey($last_evaluated_key) + { + if (is_null($last_evaluated_key)) { + throw new \InvalidArgumentException('non-nullable last_evaluated_key cannot be null'); + } + $this->container['last_evaluated_key'] = $last_evaluated_key; + + 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/src/Clients/VaultDataManagerClient/lib/Model/ListRootNodeChildrenOK.php b/src/Clients/VaultDataManagerClient/lib/Model/ListRootNodeChildrenOK.php new file mode 100644 index 0000000..6acdc90 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/ListRootNodeChildrenOK.php @@ -0,0 +1,410 @@ + + */ +class ListRootNodeChildrenOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListRootNodeChildrenOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'nodes' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'nodes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nodes' => 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 = [ + 'nodes' => 'nodes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nodes' => 'setNodes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nodes' => 'getNodes' + ]; + + /** + * 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('nodes', $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 nodes + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]|null + */ + public function getNodes() + { + return $this->container['nodes']; + } + + /** + * Sets nodes + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeDto[]|null $nodes nodes + * + * @return self + */ + public function setNodes($nodes) + { + if (is_null($nodes)) { + throw new \InvalidArgumentException('non-nullable nodes cannot be null'); + } + $this->container['nodes'] = $nodes; + + 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/src/Clients/VaultDataManagerClient/lib/Model/ListScannedFilesOK.php b/src/Clients/VaultDataManagerClient/lib/Model/ListScannedFilesOK.php new file mode 100644 index 0000000..1328cb8 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/ListScannedFilesOK.php @@ -0,0 +1,413 @@ + + */ +class ListScannedFilesOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListScannedFilesOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scanned_files' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOKScannedFilesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scanned_files' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'scanned_files' => 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 = [ + 'scanned_files' => 'scannedFiles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scanned_files' => 'setScannedFiles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scanned_files' => 'getScannedFiles' + ]; + + /** + * 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('scanned_files', $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 = []; + + if ($this->container['scanned_files'] === null) { + $invalidProperties[] = "'scanned_files' can't be null"; + } + 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 scanned_files + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOKScannedFilesInner[] + */ + public function getScannedFiles() + { + return $this->container['scanned_files']; + } + + /** + * Sets scanned_files + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\ListScannedFilesOKScannedFilesInner[] $scanned_files scanned_files + * + * @return self + */ + public function setScannedFiles($scanned_files) + { + if (is_null($scanned_files)) { + throw new \InvalidArgumentException('non-nullable scanned_files cannot be null'); + } + $this->container['scanned_files'] = $scanned_files; + + 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/src/Clients/VaultDataManagerClient/lib/Model/ListScannedFilesOKScannedFilesInner.php b/src/Clients/VaultDataManagerClient/lib/Model/ListScannedFilesOKScannedFilesInner.php new file mode 100644 index 0000000..0baf417 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/ListScannedFilesOKScannedFilesInner.php @@ -0,0 +1,598 @@ + + */ +class ListScannedFilesOKScannedFilesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListScannedFilesOK_scannedFiles_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'job_id' => 'string', + 'status' => 'string', + 'profile_id' => 'string', + 'node_id' => 'string', + 'created_at' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'job_id' => null, + 'status' => null, + 'profile_id' => null, + 'node_id' => null, + 'created_at' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'job_id' => false, + 'status' => false, + 'profile_id' => false, + 'node_id' => false, + 'created_at' => false, + 'name' => 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 = [ + 'job_id' => 'jobId', + 'status' => 'status', + 'profile_id' => 'profileId', + 'node_id' => 'nodeId', + 'created_at' => 'createdAt', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'job_id' => 'setJobId', + 'status' => 'setStatus', + 'profile_id' => 'setProfileId', + 'node_id' => 'setNodeId', + 'created_at' => 'setCreatedAt', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'job_id' => 'getJobId', + 'status' => 'getStatus', + 'profile_id' => 'getProfileId', + 'node_id' => 'getNodeId', + 'created_at' => 'getCreatedAt', + 'name' => 'getName' + ]; + + /** + * 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('job_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('profile_id', $data ?? [], null); + $this->setIfExists('node_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('name', $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 = []; + + if ($this->container['job_id'] === null) { + $invalidProperties[] = "'job_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['profile_id'] === null) { + $invalidProperties[] = "'profile_id' can't be null"; + } + if ($this->container['node_id'] === null) { + $invalidProperties[] = "'node_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + 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 job_id + * + * @return string + */ + public function getJobId() + { + return $this->container['job_id']; + } + + /** + * Sets job_id + * + * @param string $job_id A unique, randomly generated identifier + * + * @return self + */ + public function setJobId($job_id) + { + if (is_null($job_id)) { + throw new \InvalidArgumentException('non-nullable job_id cannot be null'); + } + $this->container['job_id'] = $job_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The Status of the listed files + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets profile_id + * + * @return string + */ + public function getProfileId() + { + return $this->container['profile_id']; + } + + /** + * Sets profile_id + * + * @param string $profile_id A unique, randomly generated identifier + * + * @return self + */ + public function setProfileId($profile_id) + { + if (is_null($profile_id)) { + throw new \InvalidArgumentException('non-nullable profile_id cannot be null'); + } + $this->container['profile_id'] = $profile_id; + + return $this; + } + + /** + * Gets node_id + * + * @return string + */ + public function getNodeId() + { + return $this->container['node_id']; + } + + /** + * Sets node_id + * + * @param string $node_id node_id + * + * @return self + */ + public function setNodeId($node_id) + { + if (is_null($node_id)) { + throw new \InvalidArgumentException('non-nullable node_id cannot be null'); + } + $this->container['node_id'] = $node_id; + + return $this; + } + + /** + * Gets created_at + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + 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/src/Clients/VaultDataManagerClient/lib/Model/ModelInterface.php b/src/Clients/VaultDataManagerClient/lib/Model/ModelInterface.php new file mode 100644 index 0000000..6c89164 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/ModelInterface.php @@ -0,0 +1,112 @@ + + */ +class MoveNodeDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MoveNodeDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'new_node_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'new_node_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'new_node_id' => 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 = [ + 'new_node_id' => 'newNodeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'new_node_id' => 'setNewNodeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'new_node_id' => 'getNewNodeId' + ]; + + /** + * 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('new_node_id', $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 new_node_id + * + * @return string|null + */ + public function getNewNodeId() + { + return $this->container['new_node_id']; + } + + /** + * Sets new_node_id + * + * @param string|null $new_node_id new_node_id + * + * @return self + */ + public function setNewNodeId($new_node_id) + { + if (is_null($new_node_id)) { + throw new \InvalidArgumentException('non-nullable new_node_id cannot be null'); + } + $this->container['new_node_id'] = $new_node_id; + + 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/src/Clients/VaultDataManagerClient/lib/Model/MoveNodeInput.php b/src/Clients/VaultDataManagerClient/lib/Model/MoveNodeInput.php new file mode 100644 index 0000000..518a3bf --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/MoveNodeInput.php @@ -0,0 +1,447 @@ + + */ +class MoveNodeInput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MoveNodeInput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'destination_node_id' => 'string', + 'resolve_name_conflicts_automatically' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'destination_node_id' => null, + 'resolve_name_conflicts_automatically' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'destination_node_id' => false, + 'resolve_name_conflicts_automatically' => 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 = [ + 'destination_node_id' => 'destinationNodeId', + 'resolve_name_conflicts_automatically' => 'resolveNameConflictsAutomatically' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'destination_node_id' => 'setDestinationNodeId', + 'resolve_name_conflicts_automatically' => 'setResolveNameConflictsAutomatically' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'destination_node_id' => 'getDestinationNodeId', + 'resolve_name_conflicts_automatically' => 'getResolveNameConflictsAutomatically' + ]; + + /** + * 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('destination_node_id', $data ?? [], null); + $this->setIfExists('resolve_name_conflicts_automatically', $data ?? [], false); + } + + /** + * 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 = []; + + if ($this->container['destination_node_id'] === null) { + $invalidProperties[] = "'destination_node_id' can't be null"; + } + 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 destination_node_id + * + * @return string + */ + public function getDestinationNodeId() + { + return $this->container['destination_node_id']; + } + + /** + * Sets destination_node_id + * + * @param string $destination_node_id Parent to which current node should be moved + * + * @return self + */ + public function setDestinationNodeId($destination_node_id) + { + if (is_null($destination_node_id)) { + throw new \InvalidArgumentException('non-nullable destination_node_id cannot be null'); + } + $this->container['destination_node_id'] = $destination_node_id; + + return $this; + } + + /** + * Gets resolve_name_conflicts_automatically + * + * @return bool|null + */ + public function getResolveNameConflictsAutomatically() + { + return $this->container['resolve_name_conflicts_automatically']; + } + + /** + * Sets resolve_name_conflicts_automatically + * + * @param bool|null $resolve_name_conflicts_automatically automatically update the name of Node if target Node has children with the same name. If not provided, name won't be updated automatically + * + * @return self + */ + public function setResolveNameConflictsAutomatically($resolve_name_conflicts_automatically) + { + if (is_null($resolve_name_conflicts_automatically)) { + throw new \InvalidArgumentException('non-nullable resolve_name_conflicts_automatically cannot be null'); + } + $this->container['resolve_name_conflicts_automatically'] = $resolve_name_conflicts_automatically; + + 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/src/Clients/VaultDataManagerClient/lib/Model/NodeDto.php b/src/Clients/VaultDataManagerClient/lib/Model/NodeDto.php new file mode 100644 index 0000000..c3e1324 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/NodeDto.php @@ -0,0 +1,1126 @@ + + */ +class NodeDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NodeDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'node_id' => 'string', + 'status' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus', + 'file_count' => 'float', + 'profile_count' => 'float', + 'folder_count' => 'float', + 'vc_count' => 'float', + 'name' => 'string', + 'consumer_id' => 'string', + 'parent_node_id' => 'string', + 'profile_id' => 'string', + 'created_at' => 'string', + 'modified_at' => 'string', + 'created_by' => 'string', + 'modified_by' => 'string', + 'description' => 'string', + 'type' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType', + 'link' => 'string', + 'schema' => 'string', + 'consumed_file_storage' => 'float', + 'edek_info' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo', + 'metadata' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'node_id' => null, + 'status' => null, + 'file_count' => null, + 'profile_count' => null, + 'folder_count' => null, + 'vc_count' => null, + 'name' => null, + 'consumer_id' => null, + 'parent_node_id' => null, + 'profile_id' => null, + 'created_at' => null, + 'modified_at' => null, + 'created_by' => null, + 'modified_by' => null, + 'description' => null, + 'type' => null, + 'link' => null, + 'schema' => null, + 'consumed_file_storage' => null, + 'edek_info' => null, + 'metadata' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'node_id' => false, + 'status' => false, + 'file_count' => false, + 'profile_count' => false, + 'folder_count' => false, + 'vc_count' => false, + 'name' => false, + 'consumer_id' => false, + 'parent_node_id' => false, + 'profile_id' => false, + 'created_at' => false, + 'modified_at' => false, + 'created_by' => false, + 'modified_by' => false, + 'description' => false, + 'type' => false, + 'link' => false, + 'schema' => false, + 'consumed_file_storage' => false, + 'edek_info' => false, + 'metadata' => 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 = [ + 'node_id' => 'nodeId', + 'status' => 'status', + 'file_count' => 'fileCount', + 'profile_count' => 'profileCount', + 'folder_count' => 'folderCount', + 'vc_count' => 'vcCount', + 'name' => 'name', + 'consumer_id' => 'consumerId', + 'parent_node_id' => 'parentNodeId', + 'profile_id' => 'profileId', + 'created_at' => 'createdAt', + 'modified_at' => 'modifiedAt', + 'created_by' => 'createdBy', + 'modified_by' => 'modifiedBy', + 'description' => 'description', + 'type' => 'type', + 'link' => 'link', + 'schema' => 'schema', + 'consumed_file_storage' => 'consumedFileStorage', + 'edek_info' => 'edekInfo', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'node_id' => 'setNodeId', + 'status' => 'setStatus', + 'file_count' => 'setFileCount', + 'profile_count' => 'setProfileCount', + 'folder_count' => 'setFolderCount', + 'vc_count' => 'setVcCount', + 'name' => 'setName', + 'consumer_id' => 'setConsumerId', + 'parent_node_id' => 'setParentNodeId', + 'profile_id' => 'setProfileId', + 'created_at' => 'setCreatedAt', + 'modified_at' => 'setModifiedAt', + 'created_by' => 'setCreatedBy', + 'modified_by' => 'setModifiedBy', + 'description' => 'setDescription', + 'type' => 'setType', + 'link' => 'setLink', + 'schema' => 'setSchema', + 'consumed_file_storage' => 'setConsumedFileStorage', + 'edek_info' => 'setEdekInfo', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'node_id' => 'getNodeId', + 'status' => 'getStatus', + 'file_count' => 'getFileCount', + 'profile_count' => 'getProfileCount', + 'folder_count' => 'getFolderCount', + 'vc_count' => 'getVcCount', + 'name' => 'getName', + 'consumer_id' => 'getConsumerId', + 'parent_node_id' => 'getParentNodeId', + 'profile_id' => 'getProfileId', + 'created_at' => 'getCreatedAt', + 'modified_at' => 'getModifiedAt', + 'created_by' => 'getCreatedBy', + 'modified_by' => 'getModifiedBy', + 'description' => 'getDescription', + 'type' => 'getType', + 'link' => 'getLink', + 'schema' => 'getSchema', + 'consumed_file_storage' => 'getConsumedFileStorage', + 'edek_info' => 'getEdekInfo', + 'metadata' => 'getMetadata' + ]; + + /** + * 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('node_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('file_count', $data ?? [], null); + $this->setIfExists('profile_count', $data ?? [], null); + $this->setIfExists('folder_count', $data ?? [], null); + $this->setIfExists('vc_count', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('consumer_id', $data ?? [], null); + $this->setIfExists('parent_node_id', $data ?? [], null); + $this->setIfExists('profile_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('modified_at', $data ?? [], null); + $this->setIfExists('created_by', $data ?? [], null); + $this->setIfExists('modified_by', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('schema', $data ?? [], null); + $this->setIfExists('consumed_file_storage', $data ?? [], null); + $this->setIfExists('edek_info', $data ?? [], null); + $this->setIfExists('metadata', $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 = []; + + if ($this->container['node_id'] === null) { + $invalidProperties[] = "'node_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['consumer_id'] === null) { + $invalidProperties[] = "'consumer_id' can't be null"; + } + if ($this->container['parent_node_id'] === null) { + $invalidProperties[] = "'parent_node_id' can't be null"; + } + if ($this->container['profile_id'] === null) { + $invalidProperties[] = "'profile_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['modified_at'] === null) { + $invalidProperties[] = "'modified_at' can't be null"; + } + if ($this->container['created_by'] === null) { + $invalidProperties[] = "'created_by' can't be null"; + } + if ($this->container['modified_by'] === null) { + $invalidProperties[] = "'modified_by' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + 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 node_id + * + * @return string + */ + public function getNodeId() + { + return $this->container['node_id']; + } + + /** + * Sets node_id + * + * @param string $node_id A unique identifier of current node + * + * @return self + */ + public function setNodeId($node_id) + { + if (is_null($node_id)) { + throw new \InvalidArgumentException('non-nullable node_id cannot be null'); + } + $this->container['node_id'] = $node_id; + + return $this; + } + + /** + * Gets status + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeStatus $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets file_count + * + * @return float|null + */ + public function getFileCount() + { + return $this->container['file_count']; + } + + /** + * Sets file_count + * + * @param float|null $file_count number of files in current node + * + * @return self + */ + public function setFileCount($file_count) + { + if (is_null($file_count)) { + throw new \InvalidArgumentException('non-nullable file_count cannot be null'); + } + $this->container['file_count'] = $file_count; + + return $this; + } + + /** + * Gets profile_count + * + * @return float|null + */ + public function getProfileCount() + { + return $this->container['profile_count']; + } + + /** + * Sets profile_count + * + * @param float|null $profile_count number of profiles in current node + * + * @return self + */ + public function setProfileCount($profile_count) + { + if (is_null($profile_count)) { + throw new \InvalidArgumentException('non-nullable profile_count cannot be null'); + } + $this->container['profile_count'] = $profile_count; + + return $this; + } + + /** + * Gets folder_count + * + * @return float|null + */ + public function getFolderCount() + { + return $this->container['folder_count']; + } + + /** + * Sets folder_count + * + * @param float|null $folder_count number of folders in current node + * + * @return self + */ + public function setFolderCount($folder_count) + { + if (is_null($folder_count)) { + throw new \InvalidArgumentException('non-nullable folder_count cannot be null'); + } + $this->container['folder_count'] = $folder_count; + + return $this; + } + + /** + * Gets vc_count + * + * @return float|null + */ + public function getVcCount() + { + return $this->container['vc_count']; + } + + /** + * Sets vc_count + * + * @param float|null $vc_count number of vcCount in current node + * + * @return self + */ + public function setVcCount($vc_count) + { + if (is_null($vc_count)) { + throw new \InvalidArgumentException('non-nullable vc_count cannot be null'); + } + $this->container['vc_count'] = $vc_count; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name display name of current node + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets consumer_id + * + * @return string + */ + public function getConsumerId() + { + return $this->container['consumer_id']; + } + + /** + * Sets consumer_id + * + * @param string $consumer_id unique identifier for consumer + * + * @return self + */ + public function setConsumerId($consumer_id) + { + if (is_null($consumer_id)) { + throw new \InvalidArgumentException('non-nullable consumer_id cannot be null'); + } + $this->container['consumer_id'] = $consumer_id; + + return $this; + } + + /** + * Gets parent_node_id + * + * @return string + */ + public function getParentNodeId() + { + return $this->container['parent_node_id']; + } + + /** + * Sets parent_node_id + * + * @param string $parent_node_id parent node path + * + * @return self + */ + public function setParentNodeId($parent_node_id) + { + if (is_null($parent_node_id)) { + throw new \InvalidArgumentException('non-nullable parent_node_id cannot be null'); + } + $this->container['parent_node_id'] = $parent_node_id; + + return $this; + } + + /** + * Gets profile_id + * + * @return string + */ + public function getProfileId() + { + return $this->container['profile_id']; + } + + /** + * Sets profile_id + * + * @param string $profile_id A unique identifier of profile, under which current node is created + * + * @return self + */ + public function setProfileId($profile_id) + { + if (is_null($profile_id)) { + throw new \InvalidArgumentException('non-nullable profile_id cannot be null'); + } + $this->container['profile_id'] = $profile_id; + + return $this; + } + + /** + * Gets created_at + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param string $created_at creation date/time of the node + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets modified_at + * + * @return string + */ + public function getModifiedAt() + { + return $this->container['modified_at']; + } + + /** + * Sets modified_at + * + * @param string $modified_at modification date/time of the node + * + * @return self + */ + public function setModifiedAt($modified_at) + { + if (is_null($modified_at)) { + throw new \InvalidArgumentException('non-nullable modified_at cannot be null'); + } + $this->container['modified_at'] = $modified_at; + + return $this; + } + + /** + * Gets created_by + * + * @return string + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param string $created_by Identifier of the user who created the node + * + * @return self + */ + public function setCreatedBy($created_by) + { + if (is_null($created_by)) { + throw new \InvalidArgumentException('non-nullable created_by cannot be null'); + } + $this->container['created_by'] = $created_by; + + return $this; + } + + /** + * Gets modified_by + * + * @return string + */ + public function getModifiedBy() + { + return $this->container['modified_by']; + } + + /** + * Sets modified_by + * + * @param string $modified_by Identifier of the user who last updated the node + * + * @return self + */ + public function setModifiedBy($modified_by) + { + if (is_null($modified_by)) { + throw new \InvalidArgumentException('non-nullable modified_by cannot be null'); + } + $this->container['modified_by'] = $modified_by; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Description of the node + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets type + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\NodeType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link id of the file, used for FILE node only + * + * @return self + */ + public function setLink($link) + { + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); + } + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets schema + * + * @return string|null + */ + public function getSchema() + { + return $this->container['schema']; + } + + /** + * Sets schema + * + * @param string|null $schema name of the schema, used for PROFILE node only + * + * @return self + */ + public function setSchema($schema) + { + if (is_null($schema)) { + throw new \InvalidArgumentException('non-nullable schema cannot be null'); + } + $this->container['schema'] = $schema; + + return $this; + } + + /** + * Gets consumed_file_storage + * + * @return float|null + */ + public function getConsumedFileStorage() + { + return $this->container['consumed_file_storage']; + } + + /** + * Sets consumed_file_storage + * + * @param float|null $consumed_file_storage amount of bytes used by the stored data, used for ROOT_ELEMENT only for now + * + * @return self + */ + public function setConsumedFileStorage($consumed_file_storage) + { + if (is_null($consumed_file_storage)) { + throw new \InvalidArgumentException('non-nullable consumed_file_storage cannot be null'); + } + $this->container['consumed_file_storage'] = $consumed_file_storage; + + return $this; + } + + /** + * Gets edek_info + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo|null + */ + public function getEdekInfo() + { + return $this->container['edek_info']; + } + + /** + * Sets edek_info + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\EdekInfo|null $edek_info edek_info + * + * @return self + */ + public function setEdekInfo($edek_info) + { + if (is_null($edek_info)) { + throw new \InvalidArgumentException('non-nullable edek_info cannot be null'); + } + $this->container['edek_info'] = $edek_info; + + return $this; + } + + /** + * Gets metadata + * + * @return string|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param string|null $metadata A JSON string format containing metadata of the node + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + 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/src/Clients/VaultDataManagerClient/lib/Model/NodeStatus.php b/src/Clients/VaultDataManagerClient/lib/Model/NodeStatus.php new file mode 100644 index 0000000..75988f6 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/NodeStatus.php @@ -0,0 +1,73 @@ + + */ +class NotFoundError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NotFoundError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'message' => 'string', + 'http_status_code' => 'float', + 'trace_id' => 'string', + 'details' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'message' => null, + 'http_status_code' => null, + 'trace_id' => null, + 'details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'http_status_code' => false, + 'trace_id' => false, + 'details' => 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 = [ + 'name' => 'name', + 'message' => 'message', + 'http_status_code' => 'httpStatusCode', + 'trace_id' => 'traceId', + 'details' => 'details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'message' => 'setMessage', + 'http_status_code' => 'setHttpStatusCode', + 'trace_id' => 'setTraceId', + 'details' => 'setDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'message' => 'getMessage', + 'http_status_code' => 'getHttpStatusCode', + 'trace_id' => 'getTraceId', + 'details' => 'getDetails' + ]; + + /** + * 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; + } + + public const NAME_NOT_FOUND_ERROR = 'NotFoundError'; + public const MESSAGE_NOT_FOUND___PARAM = 'Not found: ${param}.'; + public const HTTP_STATUS_CODE_NUMBER_404 = 404; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_NOT_FOUND_ERROR, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMessageAllowableValues() + { + return [ + self::MESSAGE_NOT_FOUND___PARAM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getHttpStatusCodeAllowableValues() + { + return [ + self::HTTP_STATUS_CODE_NUMBER_404, + ]; + } + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('http_status_code', $data ?? [], null); + $this->setIfExists('trace_id', $data ?? [], null); + $this->setIfExists('details', $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 = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'name', must be one of '%s'", + $this->container['name'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + $allowedValues = $this->getMessageAllowableValues(); + if (!is_null($this->container['message']) && !in_array($this->container['message'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'message', must be one of '%s'", + $this->container['message'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['http_status_code'] === null) { + $invalidProperties[] = "'http_status_code' can't be null"; + } + $allowedValues = $this->getHttpStatusCodeAllowableValues(); + if (!is_null($this->container['http_status_code']) && !in_array($this->container['http_status_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'http_status_code', must be one of '%s'", + $this->container['http_status_code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['trace_id'] === null) { + $invalidProperties[] = "'trace_id' can't be null"; + } + 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $allowedValues = $this->getNameAllowableValues(); + if (!in_array($name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'name', must be one of '%s'", + $name, + implode("', '", $allowedValues) + ) + ); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $allowedValues = $this->getMessageAllowableValues(); + if (!in_array($message, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'message', must be one of '%s'", + $message, + implode("', '", $allowedValues) + ) + ); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets http_status_code + * + * @return float + */ + public function getHttpStatusCode() + { + return $this->container['http_status_code']; + } + + /** + * Sets http_status_code + * + * @param float $http_status_code http_status_code + * + * @return self + */ + public function setHttpStatusCode($http_status_code) + { + if (is_null($http_status_code)) { + throw new \InvalidArgumentException('non-nullable http_status_code cannot be null'); + } + $allowedValues = $this->getHttpStatusCodeAllowableValues(); + if (!in_array($http_status_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'http_status_code', must be one of '%s'", + $http_status_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['http_status_code'] = $http_status_code; + + return $this; + } + + /** + * Gets trace_id + * + * @return string + */ + public function getTraceId() + { + return $this->container['trace_id']; + } + + /** + * Sets trace_id + * + * @param string $trace_id trace_id + * + * @return self + */ + public function setTraceId($trace_id) + { + if (is_null($trace_id)) { + throw new \InvalidArgumentException('non-nullable trace_id cannot be null'); + } + $this->container['trace_id'] = $trace_id; + + return $this; + } + + /** + * Gets details + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]|null $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + 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/src/Clients/VaultDataManagerClient/lib/Model/QueryProfileDataOK.php b/src/Clients/VaultDataManagerClient/lib/Model/QueryProfileDataOK.php new file mode 100644 index 0000000..7e9aeaf --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/QueryProfileDataOK.php @@ -0,0 +1,410 @@ + + */ +class QueryProfileDataOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QueryProfileDataOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => 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 = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * 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('data', $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 data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + 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/src/Clients/VaultDataManagerClient/lib/Model/RestoreNodeFromTrashbin.php b/src/Clients/VaultDataManagerClient/lib/Model/RestoreNodeFromTrashbin.php new file mode 100644 index 0000000..d5cd1c5 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/RestoreNodeFromTrashbin.php @@ -0,0 +1,410 @@ + + */ +class RestoreNodeFromTrashbin implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RestoreNodeFromTrashbin'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'restore_to_profile_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'restore_to_profile_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'restore_to_profile_id' => 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 = [ + 'restore_to_profile_id' => 'restoreToProfileId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'restore_to_profile_id' => 'setRestoreToProfileId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'restore_to_profile_id' => 'getRestoreToProfileId' + ]; + + /** + * 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('restore_to_profile_id', $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 restore_to_profile_id + * + * @return string|null + */ + public function getRestoreToProfileId() + { + return $this->container['restore_to_profile_id']; + } + + /** + * Sets restore_to_profile_id + * + * @param string|null $restore_to_profile_id The base64 encoded nodeId of the profile which is base64 encoded, to which node will be restored + * + * @return self + */ + public function setRestoreToProfileId($restore_to_profile_id) + { + if (is_null($restore_to_profile_id)) { + throw new \InvalidArgumentException('non-nullable restore_to_profile_id cannot be null'); + } + $this->container['restore_to_profile_id'] = $restore_to_profile_id; + + 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/src/Clients/VaultDataManagerClient/lib/Model/StartFileScanInput.php b/src/Clients/VaultDataManagerClient/lib/Model/StartFileScanInput.php new file mode 100644 index 0000000..f350ec3 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/StartFileScanInput.php @@ -0,0 +1,413 @@ + + */ +class StartFileScanInput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StartFileScanInput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'dek' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dek' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'dek' => 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 = [ + 'dek' => 'dek' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dek' => 'setDek' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dek' => 'getDek' + ]; + + /** + * 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('dek', $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 = []; + + if ($this->container['dek'] === null) { + $invalidProperties[] = "'dek' can't be null"; + } + 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 dek + * + * @return string + */ + public function getDek() + { + return $this->container['dek']; + } + + /** + * Sets dek + * + * @param string $dek A base64 encoded data encryption key, encrypted using VFS public key. This is important as this is used when starting document scan and also while uploading the file to s3 + * + * @return self + */ + public function setDek($dek) + { + if (is_null($dek)) { + throw new \InvalidArgumentException('non-nullable dek cannot be null'); + } + $this->container['dek'] = $dek; + + 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/src/Clients/VaultDataManagerClient/lib/Model/StartFileScanOK.php b/src/Clients/VaultDataManagerClient/lib/Model/StartFileScanOK.php new file mode 100644 index 0000000..0d42e2e --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/StartFileScanOK.php @@ -0,0 +1,486 @@ + + */ +class StartFileScanOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StartFileScanOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'job_id' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'job_id' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'job_id' => false, + 'status' => 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 = [ + 'job_id' => 'jobId', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'job_id' => 'setJobId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'job_id' => 'getJobId', + 'status' => 'getStatus' + ]; + + /** + * 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; + } + + public const STATUS_STARTED = 'STARTED'; + public const STATUS_FAILED = 'FAILED'; + public const STATUS_COMPLETED = 'COMPLETED'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_STARTED, + self::STATUS_FAILED, + self::STATUS_COMPLETED, + ]; + } + + /** + * 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('job_id', $data ?? [], null); + $this->setIfExists('status', $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 = []; + + if ($this->container['job_id'] === null) { + $invalidProperties[] = "'job_id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + 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 job_id + * + * @return string + */ + public function getJobId() + { + return $this->container['job_id']; + } + + /** + * Sets job_id + * + * @param string $job_id job_id + * + * @return self + */ + public function setJobId($job_id) + { + if (is_null($job_id)) { + throw new \InvalidArgumentException('non-nullable job_id cannot be null'); + } + $this->container['job_id'] = $job_id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + 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/src/Clients/VaultDataManagerClient/lib/Model/UnexpectedError.php b/src/Clients/VaultDataManagerClient/lib/Model/UnexpectedError.php new file mode 100644 index 0000000..02de6e4 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/UnexpectedError.php @@ -0,0 +1,654 @@ + + */ +class UnexpectedError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UnexpectedError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'message' => 'string', + 'http_status_code' => 'float', + 'trace_id' => 'string', + 'details' => '\AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'message' => null, + 'http_status_code' => null, + 'trace_id' => null, + 'details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'http_status_code' => false, + 'trace_id' => false, + 'details' => 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 = [ + 'name' => 'name', + 'message' => 'message', + 'http_status_code' => 'httpStatusCode', + 'trace_id' => 'traceId', + 'details' => 'details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'message' => 'setMessage', + 'http_status_code' => 'setHttpStatusCode', + 'trace_id' => 'setTraceId', + 'details' => 'setDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'message' => 'getMessage', + 'http_status_code' => 'getHttpStatusCode', + 'trace_id' => 'getTraceId', + 'details' => 'getDetails' + ]; + + /** + * 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; + } + + public const NAME_UNEXPECTED_ERROR = 'UnexpectedError'; + public const MESSAGE_UNEXPECTED_ERROR_OCCURRED = 'Unexpected Error Occurred.'; + public const HTTP_STATUS_CODE_NUMBER_500 = 500; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_UNEXPECTED_ERROR, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMessageAllowableValues() + { + return [ + self::MESSAGE_UNEXPECTED_ERROR_OCCURRED, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getHttpStatusCodeAllowableValues() + { + return [ + self::HTTP_STATUS_CODE_NUMBER_500, + ]; + } + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('http_status_code', $data ?? [], null); + $this->setIfExists('trace_id', $data ?? [], null); + $this->setIfExists('details', $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 = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'name', must be one of '%s'", + $this->container['name'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + $allowedValues = $this->getMessageAllowableValues(); + if (!is_null($this->container['message']) && !in_array($this->container['message'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'message', must be one of '%s'", + $this->container['message'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['http_status_code'] === null) { + $invalidProperties[] = "'http_status_code' can't be null"; + } + $allowedValues = $this->getHttpStatusCodeAllowableValues(); + if (!is_null($this->container['http_status_code']) && !in_array($this->container['http_status_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'http_status_code', must be one of '%s'", + $this->container['http_status_code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['trace_id'] === null) { + $invalidProperties[] = "'trace_id' can't be null"; + } + 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $allowedValues = $this->getNameAllowableValues(); + if (!in_array($name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'name', must be one of '%s'", + $name, + implode("', '", $allowedValues) + ) + ); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $allowedValues = $this->getMessageAllowableValues(); + if (!in_array($message, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'message', must be one of '%s'", + $message, + implode("', '", $allowedValues) + ) + ); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets http_status_code + * + * @return float + */ + public function getHttpStatusCode() + { + return $this->container['http_status_code']; + } + + /** + * Sets http_status_code + * + * @param float $http_status_code http_status_code + * + * @return self + */ + public function setHttpStatusCode($http_status_code) + { + if (is_null($http_status_code)) { + throw new \InvalidArgumentException('non-nullable http_status_code cannot be null'); + } + $allowedValues = $this->getHttpStatusCodeAllowableValues(); + if (!in_array($http_status_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'http_status_code', must be one of '%s'", + $http_status_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['http_status_code'] = $http_status_code; + + return $this; + } + + /** + * Gets trace_id + * + * @return string + */ + public function getTraceId() + { + return $this->container['trace_id']; + } + + /** + * Sets trace_id + * + * @param string $trace_id trace_id + * + * @return self + */ + public function setTraceId($trace_id) + { + if (is_null($trace_id)) { + throw new \InvalidArgumentException('non-nullable trace_id cannot be null'); + } + $this->container['trace_id'] = $trace_id; + + return $this; + } + + /** + * Gets details + * + * @return \AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \AffinidiTdk\Clients\VaultDataManagerClient\Model\InvalidParameterErrorDetailsInner[]|null $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + throw new \InvalidArgumentException('non-nullable details cannot be null'); + } + $this->container['details'] = $details; + + 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/src/Clients/VaultDataManagerClient/lib/Model/UpdateNodeInput.php b/src/Clients/VaultDataManagerClient/lib/Model/UpdateNodeInput.php new file mode 100644 index 0000000..51662b6 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/UpdateNodeInput.php @@ -0,0 +1,486 @@ + + */ +class UpdateNodeInput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateNodeInput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'metadata' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'metadata' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'description' => false, + 'metadata' => 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 = [ + 'name' => 'name', + 'description' => 'description', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'metadata' => 'getMetadata' + ]; + + /** + * 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('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('metadata', $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 = []; + + if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 128)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 128."; + } + + 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 name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the node + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + if ((mb_strlen($name) > 128)) { + throw new \InvalidArgumentException('invalid length for $name when calling UpdateNodeInput., must be smaller than or equal to 128.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Description of the node + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets metadata + * + * @return string|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param string|null $metadata metadata of the node in stringified json format + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + 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/src/Clients/VaultDataManagerClient/lib/Model/UpdateProfileDataInput.php b/src/Clients/VaultDataManagerClient/lib/Model/UpdateProfileDataInput.php new file mode 100644 index 0000000..ed30003 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/UpdateProfileDataInput.php @@ -0,0 +1,450 @@ + + */ +class UpdateProfileDataInput implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateProfileDataInput'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'dek' => 'string', + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'dek' => null, + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'dek' => false, + 'data' => 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 = [ + 'dek' => 'dek', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'dek' => 'setDek', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'dek' => 'getDek', + 'data' => 'getData' + ]; + + /** + * 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('dek', $data ?? [], null); + $this->setIfExists('data', $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 = []; + + if ($this->container['dek'] === null) { + $invalidProperties[] = "'dek' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + 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 dek + * + * @return string + */ + public function getDek() + { + return $this->container['dek']; + } + + /** + * Sets dek + * + * @param string $dek A base64 encoded data encryption key, encrypted using VFS public key. This is used to get profile data from s3 + * + * @return self + */ + public function setDek($dek) + { + if (is_null($dek)) { + throw new \InvalidArgumentException('non-nullable dek cannot be null'); + } + $this->container['dek'] = $dek; + + return $this; + } + + /** + * Gets data + * + * @return object + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + 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/src/Clients/VaultDataManagerClient/lib/Model/UpdateProfileDataOK.php b/src/Clients/VaultDataManagerClient/lib/Model/UpdateProfileDataOK.php new file mode 100644 index 0000000..cc30a20 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/Model/UpdateProfileDataOK.php @@ -0,0 +1,410 @@ + + */ +class UpdateProfileDataOK implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateProfileDataOK'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => 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 = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * 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('data', $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 data + * + * @return object|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + 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/src/Clients/VaultDataManagerClient/lib/NotFoundError.php b/src/Clients/VaultDataManagerClient/lib/NotFoundError.php new file mode 100644 index 0000000..601b2ae --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/NotFoundError.php @@ -0,0 +1,73 @@ + $this->name, + 'message' => $message, + 'traceId' => $traceId + ]; + + parent::__construct(json_encode($message), 404); + $this->traceId = $traceId; + } +} diff --git a/src/Clients/VaultDataManagerClient/lib/ObjectSerializer.php b/src/Clients/VaultDataManagerClient/lib/ObjectSerializer.php new file mode 100644 index 0000000..3df9d98 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/lib/ObjectSerializer.php @@ -0,0 +1,618 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue($value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For string values, '' is considered empty. + case 'string': + return $value === ''; + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param float|int|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\AffinidiTdk\Clients\VaultDataManagerClient\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/src/Clients/VaultDataManagerClient/phpunit.xml.dist b/src/Clients/VaultDataManagerClient/phpunit.xml.dist new file mode 100644 index 0000000..485899a --- /dev/null +++ b/src/Clients/VaultDataManagerClient/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + + diff --git a/src/Clients/VaultDataManagerClient/test/Api/ConfigApiTest.php b/src/Clients/VaultDataManagerClient/test/Api/ConfigApiTest.php new file mode 100644 index 0000000..5eea5a3 --- /dev/null +++ b/src/Clients/VaultDataManagerClient/test/Api/ConfigApiTest.php @@ -0,0 +1,86 @@ +