From 224f526d357d06483965d7a6d194549526bbc01f Mon Sep 17 00:00:00 2001 From: Slawomir Wieczorek Date: Wed, 22 Jan 2025 13:17:45 +0100 Subject: [PATCH] HELLODATA-1881 - sftpgo --- docs/docs/images/20250121155015.png | Bin 0 -> 59921 bytes docs/docs/manuals/user-manual.md | 138 +- .../hello-data-sidecar-sftpgo/Dockerfile | 37 + .../hello-data-sidecar-sftpgo/pom.xml | 221 + .../sidecars/sftpgo/HDSidecarSftpGo.java | 43 + .../sidecars/sftpgo/client/api/AdminsApi.java | 1651 ++++ .../sftpgo/client/api/ApiKeysApi.java | 549 ++ .../sftpgo/client/api/ConnectionsApi.java | 224 + .../sftpgo/client/api/DataRetentionApi.java | 250 + .../sftpgo/client/api/DefenderApi.java | 322 + .../sftpgo/client/api/EventManagerApi.java | 1170 +++ .../sidecars/sftpgo/client/api/EventsApi.java | 529 ++ .../sftpgo/client/api/FoldersApi.java | 560 ++ .../sidecars/sftpgo/client/api/GroupsApi.java | 560 ++ .../sftpgo/client/api/HealthcheckApi.java | 112 + .../sftpgo/client/api/IpListsApi.java | 601 ++ .../sftpgo/client/api/MaintenanceApi.java | 532 ++ .../sftpgo/client/api/PublicSharesApi.java | 628 ++ .../sidecars/sftpgo/client/api/QuotaApi.java | 771 ++ .../sidecars/sftpgo/client/api/RolesApi.java | 548 ++ .../sidecars/sftpgo/client/api/TokenApi.java | 384 + .../sftpgo/client/api/UserApisApi.java | 2873 +++++++ .../sidecars/sftpgo/client/api/UsersApi.java | 871 ++ .../sftpgo/client/invoker/ApiClient.java | 736 ++ .../client/invoker/JavaTimeFormatter.java | 64 + .../client/invoker/RFC3339DateFormat.java | 58 + .../client/invoker/ServerConfiguration.java | 72 + .../sftpgo/client/invoker/ServerVariable.java | 37 + .../sftpgo/client/invoker/StringUtil.java | 83 + .../client/invoker/auth/ApiKeyAuth.java | 75 + .../client/invoker/auth/Authentication.java | 27 + .../client/invoker/auth/HttpBasicAuth.java | 51 + .../client/invoker/auth/HttpBearerAuth.java | 48 + .../sidecars/sftpgo/client/model/APIKey.java | 414 + .../sftpgo/client/model/APIKeyScope.java | 59 + .../client/model/AddApiKey201Response.java | 135 + .../sidecars/sftpgo/client/model/Admin.java | 564 ++ .../sftpgo/client/model/AdminFilters.java | 311 + .../client/model/AdminGroupMapping.java | 135 + .../model/AdminGroupMappingOptions.java | 141 + .../sftpgo/client/model/AdminPermissions.java | 85 + .../sftpgo/client/model/AdminPreferences.java | 134 + .../sftpgo/client/model/AdminProfile.java | 165 + .../model/AdminResetPasswordRequest.java | 135 + .../sftpgo/client/model/AdminTOTPConfig.java | 166 + .../client/model/AzureBlobFsConfig.java | 484 ++ .../sftpgo/client/model/BackupData.java | 466 ++ .../sftpgo/client/model/BandwidthLimit.java | 176 + .../sftpgo/client/model/BaseEventAction.java | 272 + .../client/model/BaseEventActionOptions.java | 328 + .../sftpgo/client/model/BaseEventRule.java | 358 + .../sftpgo/client/model/BaseTOTPConfig.java | 166 + .../sftpgo/client/model/BaseUserFilters.java | 943 +++ .../client/model/BaseVirtualFolder.java | 364 + .../sftpgo/client/model/ConditionOptions.java | 495 ++ .../sftpgo/client/model/ConditionPattern.java | 134 + .../sftpgo/client/model/ConnectionStatus.java | 435 + .../sftpgo/client/model/CryptFsConfig.java | 170 + .../client/model/DataProviderStatus.java | 165 + .../sftpgo/client/model/DefenderEntry.java | 197 + .../sftpgo/client/model/DirEntry.java | 197 + .../sftpgo/client/model/DumpDataScopes.java | 77 + .../client/model/Dumpdata200Response.java | 531 ++ .../sftpgo/client/model/EventAction.java | 335 + .../model/EventActionCommandConfig.java | 218 + .../model/EventActionDataRetentionConfig.java | 115 + .../client/model/EventActionEmailConfig.java | 320 + .../model/EventActionFilesystemConfig.java | 335 + .../client/model/EventActionFsCompress.java | 145 + .../client/model/EventActionHTTPConfig.java | 453 + .../model/EventActionIDPAccountCheck.java | 200 + .../client/model/EventActionMinimal.java | 166 + .../client/model/EventActionOptions.java | 165 + .../model/EventActionPasswordExpiration.java | 103 + .../sftpgo/client/model/EventActionTypes.java | 83 + .../model/EventActionUserInactivity.java | 134 + .../sftpgo/client/model/EventConditions.java | 387 + .../sftpgo/client/model/EventProtocols.java | 75 + .../sftpgo/client/model/EventRule.java | 401 + .../sftpgo/client/model/EventRuleMinimal.java | 401 + .../client/model/EventTriggerTypes.java | 69 + .../sftpgo/client/model/FTPDBinding.java | 638 ++ .../client/model/FTPPassivePortRange.java | 134 + .../sftpgo/client/model/FTPServiceStatus.java | 193 + .../client/model/FilesystemActionTypes.java | 67 + .../sftpgo/client/model/FilesystemConfig.java | 328 + .../sftpgo/client/model/FolderQuotaScan.java | 134 + .../sftpgo/client/model/FolderRetention.java | 196 + .../sidecars/sftpgo/client/model/FsEvent.java | 727 ++ .../sftpgo/client/model/FsEventAction.java | 73 + .../sftpgo/client/model/FsEventStatus.java | 61 + .../sftpgo/client/model/FsProviders.java | 69 + .../sftpgo/client/model/GCSConfig.java | 356 + .../GenerateAdminTotpSecret200Response.java | 228 + .../model/GenerateAdminTotpSecretRequest.java | 104 + .../GenerateUserTotpSecret200Response.java | 197 + .../sidecars/sftpgo/client/model/Group.java | 381 + .../sftpgo/client/model/GroupMapping.java | 172 + .../client/model/GroupUserSettings.java | 489 ++ .../sftpgo/client/model/HTTPFsConfig.java | 294 + .../sftpgo/client/model/HTTPPart.java | 208 + .../sftpgo/client/model/HooksFilter.java | 165 + .../sftpgo/client/model/IPListEntry.java | 291 + .../sftpgo/client/model/IPListMode.java | 59 + .../sftpgo/client/model/IPListType.java | 61 + .../sftpgo/client/model/KeyValue.java | 134 + .../sftpgo/client/model/LogEvent.java | 353 + .../sftpgo/client/model/LogEventType.java | 65 + .../sftpgo/client/model/LoginMethods.java | 71 + .../sftpgo/client/model/MFAProtocols.java | 61 + .../sftpgo/client/model/MFAStatus.java | 146 + .../sftpgo/client/model/ModelApiResponse.java | 135 + .../sftpgo/client/model/OSFsConfig.java | 138 + .../client/model/PassiveIPOverride.java | 145 + .../sftpgo/client/model/PatternsFilter.java | 250 + .../sftpgo/client/model/Permission.java | 89 + .../sftpgo/client/model/ProviderEvent.java | 384 + .../client/model/ProviderEventAction.java | 61 + .../client/model/ProviderEventObjectType.java | 73 + .../sftpgo/client/model/PwdChange.java | 134 + .../sftpgo/client/model/QuotaScan.java | 134 + .../sftpgo/client/model/QuotaUsage.java | 134 + .../sftpgo/client/model/RecoveryCode.java | 135 + .../sftpgo/client/model/RetentionCheck.java | 248 + .../model/RetentionCheckNotification.java | 59 + .../sidecars/sftpgo/client/model/Role.java | 309 + .../sftpgo/client/model/S3Config.java | 600 ++ .../sftpgo/client/model/SFTPFsConfig.java | 431 + .../client/model/SSHAuthentications.java | 65 + .../sftpgo/client/model/SSHBinding.java | 165 + .../sftpgo/client/model/SSHHostKey.java | 176 + .../sftpgo/client/model/SSHServiceStatus.java | 442 + .../sftpgo/client/model/Schedule.java | 196 + .../sidecars/sftpgo/client/model/Secret.java | 274 + .../sftpgo/client/model/ServicesStatus.java | 327 + .../client/model/ServicesStatusDefender.java | 104 + .../model/ServicesStatusRateLimiters.java | 146 + .../client/model/SetpropsUserFileRequest.java | 104 + .../sidecars/sftpgo/client/model/Share.java | 526 ++ .../sftpgo/client/model/ShareScope.java | 59 + .../client/model/SupportedProtocols.java | 63 + .../sftpgo/client/model/TLSVersions.java | 59 + .../sftpgo/client/model/TOTPConfig.java | 166 + .../sftpgo/client/model/TOTPHMacAlgo.java | 61 + .../sftpgo/client/model/TimePeriod.java | 210 + .../sidecars/sftpgo/client/model/Token.java | 135 + .../sftpgo/client/model/Transfer.java | 231 + .../client/model/TransferQuotaUsage.java | 134 + .../sidecars/sftpgo/client/model/User.java | 1371 +++ .../sftpgo/client/model/UserFilters.java | 1046 +++ .../sftpgo/client/model/UserProfile.java | 207 + .../sftpgo/client/model/UserTOTPConfig.java | 209 + .../sftpgo/client/model/UserType.java | 61 + .../model/ValidateAdminTotpSecretRequest.java | 166 + .../sftpgo/client/model/VersionInfo.java | 207 + .../sftpgo/client/model/VirtualFolder.java | 457 + .../sftpgo/client/model/WebClientOptions.java | 75 + .../sftpgo/client/model/WebDAVBinding.java | 340 + .../client/model/WebDAVServiceStatus.java | 163 + .../sftpgo/config/S3ConnectionsConfig.java | 34 + .../sftpgo/config/WebClientConfig.java | 41 + .../listener/SftpGoCreateUserConsumer.java | 42 + .../listener/SftpGoDisableUserConsumer.java | 34 + .../listener/SftpGoEnableUserConsumer.java | 34 + ...tpGoPublishedAppInfoResourcesConsumer.java | 52 + .../listener/SftpGoSyncUsersConsumer.java | 39 + .../SftpGoUpdateUserContextRoleConsumer.java | 103 + .../sftpgo/service/SftpGoService.java | 252 + .../service/cloud/PodUtilsProvider.java | 50 + .../SftpGoAppInfoResourceProviderService.java | 87 + .../SftpGoUserResourceProviderService.java | 81 + .../src/main/openapi/README.md | 447 + .../src/main/openapi/openapi.yaml | 7455 +++++++++++++++++ .../src/main/resources/application.yaml | 133 + .../src/main/resources/banner.txt | 12 + hello-data-sidecars/pom.xml | 4 +- 176 files changed, 54037 insertions(+), 54 deletions(-) create mode 100644 docs/docs/images/20250121155015.png create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/Dockerfile create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/pom.xml create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/HDSidecarSftpGo.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/AdminsApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ApiKeysApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ConnectionsApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DataRetentionApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DefenderApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventManagerApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventsApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/FoldersApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/GroupsApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/HealthcheckApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/IpListsApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/MaintenanceApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/PublicSharesApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/QuotaApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/RolesApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/TokenApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UserApisApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UsersApi.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ApiClient.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/JavaTimeFormatter.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/RFC3339DateFormat.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerConfiguration.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerVariable.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/StringUtil.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/ApiKeyAuth.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/Authentication.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBasicAuth.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBearerAuth.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKey.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKeyScope.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AddApiKey201Response.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Admin.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminFilters.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMapping.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMappingOptions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPermissions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPreferences.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminProfile.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminResetPasswordRequest.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminTOTPConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AzureBlobFsConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BackupData.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BandwidthLimit.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventAction.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventActionOptions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventRule.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseTOTPConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseUserFilters.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseVirtualFolder.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionOptions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionPattern.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConnectionStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/CryptFsConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DataProviderStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DefenderEntry.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DirEntry.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DumpDataScopes.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Dumpdata200Response.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventAction.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionCommandConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionDataRetentionConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionEmailConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFilesystemConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFsCompress.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionHTTPConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionIDPAccountCheck.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionMinimal.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionOptions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionPasswordExpiration.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionTypes.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionUserInactivity.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventConditions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventProtocols.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRule.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRuleMinimal.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventTriggerTypes.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPDBinding.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPPassivePortRange.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPServiceStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemActionTypes.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderQuotaScan.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderRetention.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEvent.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventAction.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsProviders.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GCSConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecret200Response.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecretRequest.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateUserTotpSecret200Response.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Group.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupMapping.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupUserSettings.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPFsConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPPart.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HooksFilter.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListEntry.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListMode.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListType.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/KeyValue.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEvent.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEventType.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LoginMethods.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAProtocols.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ModelApiResponse.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/OSFsConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PassiveIPOverride.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PatternsFilter.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Permission.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEvent.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventAction.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventObjectType.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PwdChange.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaScan.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaUsage.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RecoveryCode.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheck.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheckNotification.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Role.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/S3Config.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SFTPFsConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHAuthentications.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHBinding.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHHostKey.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHServiceStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Schedule.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Secret.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusDefender.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusRateLimiters.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SetpropsUserFileRequest.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Share.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ShareScope.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SupportedProtocols.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TLSVersions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPHMacAlgo.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TimePeriod.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Token.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Transfer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TransferQuotaUsage.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/User.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserFilters.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserProfile.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserTOTPConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserType.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ValidateAdminTotpSecretRequest.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VersionInfo.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VirtualFolder.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebClientOptions.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVBinding.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVServiceStatus.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/S3ConnectionsConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/WebClientConfig.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoCreateUserConsumer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoDisableUserConsumer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoEnableUserConsumer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoPublishedAppInfoResourcesConsumer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoSyncUsersConsumer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoUpdateUserContextRoleConsumer.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/SftpGoService.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/cloud/PodUtilsProvider.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoAppInfoResourceProviderService.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoUserResourceProviderService.java create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/README.md create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/openapi.yaml create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/application.yaml create mode 100644 hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/banner.txt diff --git a/docs/docs/images/20250121155015.png b/docs/docs/images/20250121155015.png new file mode 100644 index 0000000000000000000000000000000000000000..96c56603990c7d63d2110777225b108be7251d34 GIT binary patch literal 59921 zcmeFZS6GwV)&@#bnu3ambfij0s`Lm7QUVCloAeSO(t7|w5RqO&2PvTjq)SIoDWR8y zj!GwV2uMHCz4qQ~?ZrAb=jL4ed7dO+n{CW7$9PAXU$};v;&l=l5*!?y>q<`_YvSNs z8O6cD^C!BBy&`pGTN?)lSIV8T?R=hhf(|UEAjbHo7J!XUwQ~`*#*&0h(QVoo ziu!97lkEnb+*nfUSm`NQ1A#bP*kd9b+%P*F0_+hk_Dh5P;^5%Nh2jum|8HTxkF)Xq zefP>}HvYel@%(>1_()4$NeTO}W#M9F<>YD$c6+~K=8UZhW%pdqO%JFlVF7mJGqVJn zTk&~0zWh}LN6JeAd+2E8X2#^@=-}ik;U&%d`w0o`@vqDL%uK%@aRW&+>j5>G%A=2X?XHe;_U{&MzRy zFDS^1eS+83+sVz$i`U7OV;hUD690~iht07vQZqvu|@>obIY&$TBzcQ~5GZs8H%@Zr~dUi|jD zWX=zR4~-2aWzFm8NncbAy!i#y6Nl$^c+A=N-|o-KD{Y-g4_p^hJ-(L08o%Hv6I$=O zRlnhD!+g5j>)PDTlA|0Fii1Za90M@0cfsEXpJ58bp8oI8Hxpd&p;Hw6-eos`UmKLV zLNuDT?7mof1Av1|aM{l^4Y|8rSEl2ZbMxhQvf4WePk*jlzK=^VYczec9nsV3nG)xW>M|X z`~7s~!1iwo;6Hr-QKhZMY(Z^(Y;Is`6zG{_L22x#`UZ0P%+YEmrdBiA&`S?9T4U6^ zwz0a~RZwC%w1%(wT=m%jS7FNQe;63kx17K!e0Qot)1t;GoZ+^y)(V}zzP?J2-?UysQ_nCpT5|m3 zkoruskFKl{mZ#K-SAD}lf$GIBRQjoz|1;wMkp*;7fU4`GTg}?4Uhu0|dForUm}+;? zh|3ALd29TmUES&6V|+|p+^vZwt7wObxceuE1^TiQ%@e09m9RmgQSy1N*C8QYIj?1V zJ|E7NR3FfLPV+?s7~F@Ndf4S#jllf*g{)O6`1xIzpL0wKsmoe9B2Xw)_$;&IRBdd) z%*$rg^Ig)32CH};lcuMcUOyh#%`~{zV`PsOSW`8BQ&-!!5Wo8<$ei-h% z?{18|o$9KzVU`|l^0~KE4y`C_NJO+ByZyqnyQ>#^+J0-un}+-3*h|SQ)*G^oPXq?@ z6O(Kwl}7!t_?udo$(LO(B71jMyZ4C#9P$V z_8FkZkKbHl81L)R+Hh`+XXlT}x>FwaDY!x9MPO@ZYF?hDj;}*QsbiYX7~f&S6%0jT zTAQRaulnYZWv;_`yoG{g+P7(x;ihCkuIj0Cw8JEn8^Zn+6+3Bcfo~~qUS^q$Gt(Ke z`s`kdi}@VUk>w69Mb3%dch~IJ@@Y>K#iJj~{<~7dDr}`i#Z#prNmt@|fW_ zvkp0rCf6ri7v8W$#oS~GMf9drmHL1ET3g%h=AW~7c6P=l+q$py{#mYqzW-8h3P`$P zFFLyoaAZEbtdk5mq4(@*+-kA8a^4WV*Dt9%>$7+L=*16TL6^}A?ac#8iqB|ue~~jl z8wyp>B0Au4sg$!#!ds4_W!u>qx zKt=7pjuS3y*2qzJdfIMJUJkPwD;p&uwP!r`yGxjFb{I5DcjOO(Nx3|t^4=j4l4w*+ zUKhFN3nT6?r=jQAGM-appB+@(lx;0(^0N|Ko#E3^qa9bCJyzsj9cF*p{>pFR2+`0z zLgjhKbn8~i(Fv}8lgx}mNm!G!J9)jEB}l(XR9kSE)bhOi#B%p^rqatQZea-;=PzHnm$Ur2(nQO|atB*u5q!;`oh#nm6_*RWM$H3m#?&^Q9Y|W4HF%^- z9dRH1h~UpRZG|A!>nX`)>X&6b5sciBc#nKMXpw{1H}_r#nEV^I>!P4sE&aix-&OWsm{VOVP-C z0CTGl-Q_CF2)0A@n4a%VSbP6K(+_ivn)-YV)0^+2DpiR;?0bqCxU-drCzL0}E(P%G zm3aTC4@)d0GW(OLtF8y^qb> zsN!YfOUfHGbxwD}{ABFnuH79pUFu8Y#tP(`Ql&~v*Tjivx;H3W1#8@ zuafmytmT!pBX*{Ne%^%BSLUugCgzEDJ6ycD7Gq%#T*)nOcLBG`p}sP6%uC%ZAcMp6Llw$!FDxk`jhTq$DH@omWUz2c-b* z9UXA#NKxG5I5rhaOsYtwS%-qSliTVW41;uoN}6bed9*#F*m;luU?NMEy(4{9}Jc@Pk%zx{QE=#OI$Xny{i+i=;?tE`{^0^nRC-6yjU7lp5U% z;<<8X3np5w#)y`tmsaG|gAYbSwx7f~DHJo#l_zqNQoK-TPP@6z9;q(0x7!=3R<-w* zZE)1SF0@W}viQWt7EqRNSZ(67+@Fz;)onR7V>Nx5LQ`BvIl0Xnl>#2wG7jScB?DXR z07faV7|ci=nDJ;nTK0)b(TWG%lp(m)_&}JA?Ms5`kx_NJ@<66E{OHrCM>={Y8s9P- zf0EIQj!ru1=vYte)HuXXpESq}9r%Fz=Ep+I>bNl);bf%>zKNb?r&7kDnF;sJWJ6Iq$yM8_S{gDU05 z`w6qvg2HWvug;p`xNGMSlVSF0^#=A3l{{i326TO+uWMh3P_f&X(J@A@s`;gs#aVv^ zaa@WPQ+e++uj{$8sMrHcqM1K4FtaSSNof;ZKY?3+b;*$&dA$zb-PmJB_JWfI=8 zDih-{exYCwLZiydF@^3!CH5JTo^e?4mdIO)_&hFD>o8#sJXoLT;Hs(g^R~;_ooznp z+G@RU@|0Zf3|g`-nOy4QJ$u>aEbqg+J}e+1%UiP_FW9Ia%4wF{hbovgF*qpmdVHBl zo2^eW4MBKuKO`q3yFu^nBt~DfxwXZeAz72iYe=y%G2AVM@))^3--F~fTnVCRf%SSm z{%A7?sFA4kQIc-%W!gc)UoB)6uy#>)QogN=hK5`@iMYC`=td0P7PzPsFec||Blv!p zIR|_Nyzb68a=60q%*AcMmYC#0m`$ZK{Q)B_1*>kx=p(+nLtlLu%xZ7a{ot>kxMF>~ ziL>7P_;t$iC-y)T_}aM0>tab~&t6ovZ&gu5nfvHe+AxQ~+b4)-Tf^#?vECKS`eIyT zZT>0L-5H6AR=iWSj*Xay=AZ9RG=j54HhwDl_%zIG?InhJAR+512YvE&VE&o@@>agO zJ9eBY#dw%0ATiY0COR?Te9uQ;8%Xc&J9YfgZiF3_aQaLU8kOg11RF8vdHu`Ja0xob zuw(~So!gG2xvxdjm)ck_bv;u&;GrrcUqMZ*p+9Ddbab2#4q;T1$|~&Jw`Sul>5cu2 zs#)FMB$~dtQh+gDB?9)nvN$~$vYQ-xm>7Hbh6pihg=imst4IVaI1JXS@ zP6H!6QsdLOBdGY3RQOX~M2TyjA5Ma-5J~*}*W03{)}E$3+zGBcD#-MCOK{~%_h`{b z&(iAW`sGZP0hyC@5q>5nz}M85OHA6|z2!V&#n|{5m5grQO)8Ix&wglu$$xui;`RV?ecyIHs^>3S&rg zetwR8>R+IfLvblxiS+Pj9)icKRg~YVusVY))7^f&z+%Dpq7i79T>%|$@KujJuc9N; z^O*8hW1ga-l*K4_OsXStue?Q{b^dEq%ur{N&cJJ@br$VXBj&U9G`|zMAa?X$u<|(D1 zi1feI(zl<^+lZmc zX|mpBv8U3?fJ6a*6KZl=ZsfZmV$JH6P!mZlWZkvlIjxUW=Wt^^wt|}8V}uAis~(LA zT?V%tB}wfMb}SyljT_azX1Hc@qFvzc7^DrN#Fy@Z(j=6z-C&5LT)JA=FA5(j!##^v zmtrTE{+WHGtQ2_kncFbachlQ@x2PavMpeI6*Tnltl$6UG;sySs*rlsw1Z!5pmm9Jg z@W7~*%)@y`LCcrq;qQoI`IZziC*Sr0xkaK!1&pT@gnaxDrsoz?ILZ=ZVgR7bg43P7 zxUrhh)u_(mPrg&4&jkJS7&|8zgf=J{ZZ0AlJ!eJB!lnbf14{b6Ei&^VK6~4r6L(Kh zXxcpi`Z<(Uy@)@8_>yd-^jZ;X}JM znHtyW<>ckz7O0n*NS7C4-L6Z27dnBYc#@v#_0;#O53{5Plea;oR z+nJSS1-R&s%tR#7uY3w8WXQZfRjb<)ZTSTfH6Y3Uxkvucbn_v?0@gg^&-w%w75z~p zNA{GZI%;uS7aSuZ@)MO7v9!$CU(Sx86- z9=q93C+mNy55;yBZ)5690_n(@#aU>Ep#N9?MBAvlgJ0&`_nUpSjIcF)77j$YOIOr4 zFCao^QsQ*=c!JLJJ>NT)#`kmIzaxF;9}EztK_dd6gB2#5bkS<1bTtQuy!xS)E@d%h z_{KLD7J1;-SCUcW6$8xX1g<@LNSLDsiq<>V}T>`Izd?;V~W|t|Vm*;sM4X-F4{?ynJ z#jWS&y)U3~OtxYJuUs2wW#teu0jv5+4n>B(XbxFw?hLCgIT zE*7N1Jw)!!JB8;DMFaLugCNa|Kl(Sm%r&}A%rrMDDQan*1to%5Tig4TFxL5Dt{s}4 z{(_O0YfWr@fmL|d845u$voK&OMvJBx8oEsH*R=48%#p3_WH8%1qa|C*SASuiTe6h) zUDClAlmFIi^O6nY`-UprRLI{~#UBm1-?H5XNMrTZF=mT9$aG5hwRt>q-YQaAT}6dr=Fas?ruttnEGYEGHc9jwE?_mS zIhgS9`}{o1EG!-IUSf^y*0)7oiZHUcn-8A-@c+=_Q^C1W`4jNgsAb=?n|tW-nMODC z#}9K(E-w4FTx(sTUvpVKYU$|^>UgO_82pA8d8<&@J&7jgkcc!f0JFlQsHmuKoWxep zQ-T&lH0-Mmz0AN)InWgA@mw{P@4o~n+7{t4P!yuC4DKu&?0&iU7OAw?cYj|_Yxnj2 z=KK~Z@vWu%fb3bia<1h|T;J8#g07aoH=!uGx_pHlz<(c>paN9mk-wyw-)?VPFI-n{ zjelDHznl=G?0{^Ov>S*^9Z0|H5Wpi?Yr6K2i{-{kxj?`SF>Ax66#MP*1!VVw{;7x9 zCO8O)Ml%38q?f~%U)5qeaP|K>@P8EeKMMT6QJ@VKF5~tHyUXP9lu)o-|iF!2WDK1dVWyLHVKRPT#OZ{6L<&w!yVE+4P^lzPpqW>RsxWnPfF(` z;Iu3r)(COjBv`8yJ(_PU=<9@F*5QWP>q z(V($vP?2i>33Co_J*C#;v<(S((5c5 z#!sELW}NFY@WuN_Ae-05h({g08L-4xA{}oPpjXfN(KMMUS%wh4ti$u9&wE|hSt{jS zee2JRplGSi<*~l1y2T!rpayP({U&sfNbY0>)F%& zp2fZ!R-{hq=UseTqz86ZY67(P=ubw4f!QYUWQZHsVPUI#$}O|jJ-)}KCYf1i!Pt3p zDP4t21L+~Uy`c3$qi9&Moo{AyOJh_jV8%Gkfe?$tjIw|5Yf1;c-J{Ez8ac4gJ_AV* zcVg_@Bhfn`rEtWyOe0{^~>gs;}OgJB}kKQmRTtA*B zL)Jt~J040-E8<}~5-qTtZTmdvZ7UBw`B&!@>5ZRy8XA_bS8;LAe=ILsKyXhUmi1pY zxq)FMw<#&ZttGv^k8}#lCZgzbBxTmVgBYG0$C!*%rmAHCn%U`-?gawkZ+^hvD<&H^ zfkhu3y+#%!fB$}O>|73RPuqK${h;dNi+D>i)A*geq2_HX9k&c>WZ3(-hOyb~%4LW& z+nd;S$pY#(bQ2u~biLQx z-Hw@4kzJXN_6w7ll#j!84UU(uUpwNDw^AF2bt$JMLed4A?V3M4oP_aazi((+w#~i~>YZy_)hI3zxxc%V?S#dz?t2!F1UI%{1T~Cy?0y^hG5Eil^B2^% zzfm}#`UcQ^)$7h>9Q&`SeL;GoaO#%SWhDI90~*1B;Oht)w`Xn+zTxUC?DyW^)YR1E zAw1Yj=tJuyuf|=KCiD1zF-x`a7;Y9GQVS~|U!&9C{3+qK%JPZb$h6gd;{6f3AwN$S zG$*HBelJ<>68-<%U;t!e1-G;Ycub;2GubK2vra~yReCXSVR?D7s|{w)+oNb1bI9v$6te&*9Gy9GAU47YCIX5CvJi1nQF9+`BD-kgEA zENA#el{Dta{^PV$+_v4nx%TP(cacgvASUxHOna@$_v9)k7hi&ZW1Y5v$3r1zmfSpS zRA;xpaZ5=}O|2f72g^6u+ic!~OjO%d)$|U`4XiQJ&}f$N|FfeZwE&PyxE6+>$r?01 z#eb!m-7@3Q?k~pYzj<`g6NFD#ELF-FV8k>rF`>=pnm$osp-6n~n(+4%c21sBqpfDg zDbZUL6f7WQsR-s<1f8xG%|G#AoBS1;<^>gFBlF2>=+6)*_lXb{bbsmtV+P2|CwmmN zs9WJ_rCSB2YP++(a)0@Wp!v`3%5!IDN2@i@xvng16uiF5raN_vdl4IG=P~Rj_$SH* zE|Una0*v)@E#_y6r;4-`S0`&!CZa>X^;cuPa@~ZCO&n-3hlF``sfpu>dJwc}?|}9e zC8d?)5A2*JvRq}jx113WgHAa=vuFV@$uk<@U^ z>^|H$0V5oj!zNrU+u5LrX}V+au3s~FgK%+o4?*Y8bb`;448dZ#qXBX8>N3yRfycuH z=-9aU3>HICaBOd{sy8N}ygLot%y#8UBBK3y4f)bPu0!EWKs@>A4A6578w#u*9j)wR zXXAhZQNj;w2boHoj!{}IrK51)y5UM;aPwKzI~s90i2gy<=`q?RMG~CZba74?_v1sW zGPe-^KTaA8R`_rmg|ew6>G*05lNckUc{%xNGXqX{3Ko~pdo^gJ{$3KFF?(<{9aq4~ zl-IB1oM|6KpUX((MI4114U1u|18*I}Kl7iI3f6Q7qAZTUt!cx29NnXKBW#?U-IMk& zUS#jDju;|K^+D2GV>A2g6GVLxZ z$TWYw3N?iki3DIiwaxgnGyY>M44i{2ETdXvtVm*585(7`Ovb%6U9ZLW(e{wNX;Mtg4JDvTJRu|Gv2}m?;s-YN z%h1Yic`fyof~)E^wM@Pd(a2-Wl7%#UqVp>{i;xX(^i((SC06~4YRnh z@gF5y+rss^*4CbxpU20_s;bqj?3-{GaiN)qW-~k53u42dVO&k?vva_Dz zhmNu+#WPMBFED;aKY}}D8la&Z5PDO6O)>H4;QxuwoqGC@0f}Os3N~g|AM?? zaD=^mq>P+#$9C2-FxD)$Q|YPRV_>I&lfI5ZDo@HqP3P-XpBQYeHa6J>-@^-=iuE*k z^V=s@Jl;o4{H+>snnG+s-0CE6-{$S>`l>v1?Y|kc#FEXpe022lsqNFi$BLoKfdRP} zBE?7FT-g7ZoNv{Dq@wgRV-4n`C(L1?wBpSY^l3$b=d>epimc-UDsrc59&up4r-{)} zSas!2v9@i3x%iMx0y8p<3^#3`;wluTwLWE_ODx+ws4jS?p+3+Xn-R`=iz7o6q}cFxZjfJW;Z9Q+}`J#`X4nY90I6N8i;pQWaG+dZo8^mIQ10W4Yi+Jqf#_vuk1Xkj0&4I$4vAxxP_^-0-@bNB)7XbJbP}wM znGoN>x^>}Lbsr|@_GLE@fL$@*$rg2q+K8l>>_CHZHhQdSWJhGVxX@i|tTZfgFDZ5n zI3MSn@GlAqdk5i9gscM3nMJ=5+ZHlVtQ+LWEVWJ%kI-(@h@gz^3T4nqAqwKnp(LZt zw2SNGoLDhDC`VA;8xf_-p$fi7l|JI|0Pi>xd05-hY4`6n1MnxcO`%eNq3T@rCRam7KE~#yw8}FW+JWkLONA{MZfAq+| z(Mr(qoxxNreT*nyF1qK6jMx!6{E05CvVzD*lf*F+5a91Y&)E!)j<4m@|yX3cRj>~J(*2ZAWk#p5_tHvnz9 zSG=Nq_ZPo^`&aw6qImDr!J^R0N9vywQ9uufb1(y~Bxn||?+k-Qa!sbK>Gc1on9{Jq zbcUeY`rkwOo77FM!$QlwmX`l-bp(RrBqPKUV)btHJ4 za}H?Ctgl}$XfwMNmypg^H|^zwAeb-xvwY5uYg->nap?$aWRsk8{-6`eqnE|DWjto$ z_91HK)oC+Z8_F!SIZ%DeY(kpnb_xp4K9d7;uLk6(6UPee_ zpW%TXhpf~38)dVG+_zCWt>2F;T;_r)tS-)1aHLmNR zIb)!tijq#M-9NS=M%R(GX9>a9)}Ir?vgI{wK>8!RQzS?@~B>s@QboE|r^ zirc&lakE_nMLs_i?HFSTZieGPK5))GGb}uxdFw_jihCN~ERU$S^X^ekf+;gnAjy@9 zxavw}GFMhkIAM7}ZO7+_H&*q`_T9A4WJEek7+IftHW9v??`;)a_?UTbSf=>YcD=Y3 zb!+L$v3IvpvwX4i7-=*Km8q8Wadd{artQ_p@FV^Xzb*W~S)1ppBzWzLj>LEyX6c4f(ai)c`AfwwU6z`6%xK3~3^h*1=NA zoFJE@nrvyRfN;~WU&aF)V6B4+SIj_}Bgb56R}48cF9l_uO*h7=F{_`z^(4wvpvZ-^ z*R3GX5Z|45+%P7KLq?|MosQ?Swz(nELn7OlGAon2DVu@AcpL%7E&URp>#^#x?zV8e zAl!48MJtPi)n#@i9gnh7gDPMs{Y)bgLnmn)o z;#@)r56A6Qa+%{#59xr}v)^{tZ~RBNWpk3Q7qfjBy}8bKmae&aTSV`?b45q+yz7lJ zg3d-t`Ye!`V{b76E!p!dgZ#?!6L#6-R{mRy4fDAr*9+E@t-bC^+NtNKx# z$bj+P<>%SwS>3*isTPLXzD+)vK5AR3g5m^g`MNxO?YgI2Ub;<5^I;)~pZ6A*HwW&= zQ7yA0Mug(*d2n4a!nN)zkv)6q~QEiDlent1xTP zzPc9sXcqavb~Vj!Z+^VYFQ87uJ^*lnqvb1uGRXUWYGIvl5hh!p6a`^=1QNhKyt+n6 zZWt`n-g31ube#y7z#thAd!%92*?)%AXMB(yaipVh)OtgwbEr}G6~Wcxh$z9i29cpf zfdB9UV_zLJ$>M5fd2Dhr5mw4V#b(b(4u1Oa|LqZ62>Ogi2h zFPwsZ52H#yR3^qX)5JCuE}ghl>3CwYI@H`u2}8$aGtpxpZ%gMsj`+RtSpntHifzPU zGkFps(>x-gEM@oh-{+XM%;=;I?Tpx*GKZgNvQ8&th(q>o3fe!G1?`ZzvW$7oX5CxP z@+|GmxCmRH^ao`6?c0MUez27+qD)arKW1+$J$;ji&3TC%N5&pl!#k;~Ac^@1e*gL7>2Vh{V#h;zA*$Xlrno;Kq{qPdN@SVuG=fS*sex~0dX!ykH#)eo`4mOj+-n~ zTKQD4>BkFtS`v#%4<6jIm;1>NQHnpjli$^e@`$;w)o3h#yi@KJPoP!2_$6WS3pFzE3`$oE+D=x~~oAENbx?>@|aDx*2heb73nx83C401s93>$ks-0N7*i?fVX*M)jDs1bHDY#va14V_$eK&qp8Yixv z`t015zGpTa+;a2fMn&u}->~i-$KKewJFp)9B?z%Fih$-Y_Yo>8arQUHP{{tUt>Lv{ zbph;EqV^T`HOWL{4#OD643jQuA3>7$(k!hKAzxI{Rg5Be1tDQj-i$8xE?Q!4EK z6JCxCfi9Yx7yGVRhz5)#oMjrj2SZ<`n~T!*m{U=yM8^zyUF+hfYgLUDe=ER^mZtdR z=&0*WaL~`DBkqO1x&q}uYBO1LFUE-$|17Efm9V&2@0Ea46(~Hh22>XjH964Ll_WNo zVl8)OtkyI57pE#0$uziq*U9meyPwauOpFf>XRF?gKk0v)sGgM9vpyEq{kBX%1B7? zT+AnFj)16J=3Q)qj`$ zwKePUvS}|=T_%m&2VVo;0cqdChu{1@c^J`6T6$DB>sD587h8|pM;yGkQy`NFZoSao zY})X%qoC!yXmCouCfHf}{ro}hF@iC`DXvw=vEtQB-++#=g9?Qrv@5Uk-fEt=puMH+ z(Me)~zHw;knf=WEhV`i5oJ>ZkH_h6dU+$*vg00r8CE3Gf?h=#()X8{CA93^-2yI01 zutm4<)In}N(zk>mriwpzKdq|95i@)ffL+YY0vgOPF^?{udDFKJ@NFcP#8n|HB&DlT*Ib=00%_lcr2tMt5w^eEVg5>1AQx zx9?~n=IDWnxu&Nct6{=EEF(41ZixZ(bIMMq)u&CZ#+?Nn5Ut4B&S&w8U39IHI69F&hi%L>1+aLCo2JlW$hK%4GE{(5R{B;!yRA35_-%fflD~r0w&L*~ z>^J6|dU9=VNIR`}xdf~hZoU*t9_GRBCP4o1*clpgFY#zWK5hLx9k|~+64t%NEt;Bj zoqZ*fTSYZI@uG20PAF$uR|h_855I^lDsif#)2i~%;@rvs%7b}Pf?J)Gl{V^?+QUx} zsBxCr4fpEmcQYQFQZEueQcD#!N~;*8(QMYu3AU`)tGS_lR`^YKoQH1RqPx$@$y+{a zB7XbN#=*AXmQW@`qD3i?1pTIK}4m%FiXayH^bu-{9bosd{qm=rnya zX_aqfu#??{l;wjXQ5M)h7*TgxGHPXa~-`$aU?^(zr{Jy^SHErc$^|=}BnqnDc z8G5(1*LJJ3AKsGpuB?E?D=Y;$FB?U7uDP#0l|711!QkVcWLZ@BO8 z@K?=kS}(NF!_ZRFGM!jcgLCGcW`M`i`yrHM+%8*P_UDkpBkKiMyO-rGDC5%~6`N&B zV%Pl(X2(B~1Oy1o8F(Q>MkSPu5wI28i(`A5kSU=2%d@257IrRC`n-IWQ4u$kfN>g` z#)CTv|%+GbR15hy+<%Er0 z&?Q=?W8NS;SV&|hZJ!7(o;#{(U2oNsRu9~l>a&#XmUx&|S zJRC_yWApi0u=>&RT3p?W(~6`eXRd}7r^8ykt-YwnIUW}O#ZONRL=_aHC2N_q_Keb!`U=M@_ageb)^;z>2V;>@@bz@M_7SHFnx?C7 zT05k`VFB34_FQ^FtALeawcUp@AR<}yeEIz&ZKNv4`5-zw>CuuQvG`IjN#p8D0PkK7 zBY}AB^sBc6Dyq$=yQpU;pc`dVqZ^X7>!-Is0%=JB;bL=6gK_)~(J4!3?-_SjPG_C- z853;ns2z`S-&!CI0@w;|-wFh72VmCV9g;fGB%lxvWn#cUUFbY_Uvg zbvG;0Wh5NF@Y&=Oa^-Yv=}dTS)e%WZaBwVz=Nz{7RNsNn86dwhNb%uInjPF0qaqI`x}l7W_a3;ROAr?EUhZwo}%1D^5mO4&g>sY zJyfG_aIg4TA45t?Bcj%$M6L80L~HsvcvUFjRkQsG>f-650{6NS{FP!=DWdG}7x$Hs zm*?AX)waOMYLonjK1lO?sBR5CjRJz-HFQrq>@#S|&hl;Llua6F!rc@pJk|LHazBD4 z-Y2F%VCtoDb_8Eo?l}g%ps)pXZH&7S94*W#w|*(j54xH*v?`(8XpRtjUpHIr7Sd5i zT^&8Ut)*DIrOFwj*jZEC@@eR3GcpdcEf0O*PwtHrG;Mc$3N@cQfxJ)4pLj2cxMauw~d3T7*+cM`4Yd1awqHrQ9ZYpF{;r z^qfOwq*&@R3fSi7H}JxHcUliba7J&Dv#7ZjGyvLDL8NR7W5zIs#5QRtIY|lwQ(1|g zcgHff3qf7y8JwnW%beIvk`=LnJ${lua!ckB{*v!|=uu`%w6d@+uf2wofz=1Yh|vOB z^cxNRBLJ26S=>WVi4R!`;~JMmAEBW!u>1W3LY2=B@UXyEvVtL29jg$Z_>Zb|tk|Wf zp$|a6GrfqevdpO$x3RX4;xVp89uH+2AfE&u6i+U2l0H#P$dYt=t{qX5;dug|UzFAo zT`DQ3N^zvp6I0ko9#n9u-=QNWySpxlkUkkKqK{JJJ+>9 zt+Km66_MB!aXY&-QF!r8LG!n_h_7!ThkJYc%PJlonU9kzg-{o+rJrly{>Hwve@O}e zcn9Hba7VXztUoi{G@Lq)nyM^tPgvih`jYa}yHOfJLwUYaL%&d~e%O@{-uTdN-)y#W zp$d2J1e`o}?NDsKw`v>q4ZFYW#?kn@J1DELDL1zhL*43l#nvf~<(A66gp=(gi#`ui zflhtxCrOX2AD_5VeeKp7IY9i>tuuUo-fUs9n53=@mMQ9dpF2L+Qkfxja0a2s0oUO9 z($|!o43Xm-$W3KEV>J+K>iASCO*xUvv+$ixQmBiB-qcNj6FI^HK(OM5X- z$9kc)4g(LmVr_Xm*B1%E(2_-MKwMd#Z=gE-Zd6T8uk4v-vG(w2mE{-1#3&+34wBM< z-nZeBEvV_I`$Z{AyIrIBI)~A{*A>*asJJM~-_@D0Gz{=VZMq)Js9ZRfX7G92)cN@U zCB2W@YjtMauFty%(C4CUUW`vgXu@gFXKfWWWUUnj(S%~ADL0P}-e5X`89vg7hvn~t zmURpW&&#?`76|t~5nvHT`SzRpd(?Elj9J^e*p%|!tjWd()UB{atLN#pS?JtztRoph zQ#Ru5{TllkgQd02wdnxN*O}o0!z0?wQSV$z(U{Cw$4DGcy4RcI*nL!bYV@vodHGh| zr4tCm9lK=dPt%sw#jQ+9?#1SE((&;^r5aNeIzC^@8f1Afn%a!K__-_t#`L`9Cu-^g zwFkz|0aA)sKRnG3>Djx>Uu6Dpptn^Kcvz2`y1Dk9G+KV`85X=-mR=LuJ~uo4>=<>c zr?C>aQNq%SvCe#8z5miexOpNk$-ijhYwSS^*@8;Q^*3Fy6*R?t)$n0sAtQI899BQM_oa_q?=ewI%! zI5Qohr3l*+LiJ4`zm8s@0L{g)x!S?lwJ~0l`#vUb>)TuGHrC0^#-$pO&U6P8#4)6J ze1DJbtW8<=dEtQ0uJzXOv|r+s8n7=W5XUs$HKAn_V*-+Jl=VzUULW7%R@1F_4oivL zo9h0Kll*({W?>rOBXKYGRUHl#!ZzJY@bF42l^ja1&aVo}en#9ww8_UOPzYWb?m^w$ zg~Nu1Vr*w^RKf!el%M>_Tg8Hlj_@e5@`sJXuJlh#j3eGjH4U*eY^By3&YUMl|2LY0 zgQra@Du1k7`E`9sZWwx}2 zpXV;YoZ&74^QGY<2G(Dnb#q%w8>1#*=#@7fHmTfZ4Nm2-4@RMRCCSVzdtQ zo$B(%u+fZY%3pd6)Xmm@6YX~}K#Y;NCDfUJx_%gwMVhF@_KNc}sUsCu@P-ROH*}u|d&I z4NKZzU81=4aAPz#-?;JaL^FrJ+Fj`n#Ps4}Z~sg<4A%P@hJj_e*H_s1(@{-1$l%e$ zGzzhLKCzxiq6@Eg$J+3NR6#V@mrQ{c%!a0G#{jk|FS** zJeq%>V)vO5tns}VqWq70{x20^W5bIiUT)d5>@D%vsGZ+_{_5^fulq&_yOD~WS7SIY zIx`r1I7#3Yjbi`o@<&R*%dkMGq-eXSL3$u}dD@GB=qMt?=^D@)$Mm$RI>U+6>Le&8 z-R*#K82#qE%kD?+e67QC;91S*9hN`<>Fw>ko!D2ea_)F7r3>QqnF8jfjv4;D0UyKr zZNOA~E$ySe(_A8|FP0uZEgzR-?BTC?>q14457Y!7VZ6g9jgaN9i}~gK#U`_cgc3Y8 zu#O62pbx{o#KryQ;QxlA2~O$-ksn*4LpQ`Ie?@^QLKTD)M}9m^3k0|ZNP9oeX1H;e z)tSEGZFG4S>&BG!=AxNwbW|iX``e%kVj7d@A4cGPx_Z%r8d>UEzoN1j0B+&WRexCI zu$Lj>8QVSApFp7|k?+7j@r%`fctf%8EBQH%D_wT&*S=zHD_ir+;^QGd!wCeHn_E)S z#ttx;oN`*5shUoOo^F4+^bIvxf?~=+RBTITs_R}dU}iuTkTX>cO2`3E+v{ zNYhbypE6s!!>@mV5=2WZEH5gRAa`!vU6>X7f7tu#uqNBLe+9unF%S`u5(R0cCOt(7 zDFJC1N;lGMw5U9Yw170yJ-P=fDluT>CN)$TH9{Dp<9CDle4j_~`~LYm-s5=x@nG}b z73Y0kXME1MpiRn&xZ%^1F<7sSmR|d;<}4;9!FOIo)J4f6%a^Q2>bMK?CGx#x?XMZd!^XgaMNFg>4>;C7+E*zp)=C6jzzEB{2L^-IOeB$3-WaO z)ZyWi%Wodl)I;=bBMWV1v*$SJwvfjyUKhgC#&enE2u>->x}p7OqD!F zUs+gOjE;!-R)P-;kG@i0Uw@9eNAsMUZFs~tX=JM?!>11|SqZ!>Z{9erJzXd5w$9^R&Oc{6a~3b!bSxKfWsK+vNqq3J@;|`DQP9?Q;n-Jn*i6b5++aCM?ooW_&Yifmg%Vr*g_f2aea_3hm&`p%XA9y%QG<5<94Db_Tg|6)a-^S*$LYC+k|)hN~8gm9~s1 z+-_1vmt;uoTyY!rPCGv~p@%BJ(l+Zh%&J@a7P2N}Belar}x_(oo1J@_&l2lnCGF87#dI;A8Jkt{k_x zHlX%IbtR`bBl^mhvsVpClz`?g@wT@g5f*Z(cEPSwY53|qF993{*DG(raOhYG7d(7U z0v6k~pb^S~7+cI6+j7H(e*! zs7cduf#ZmDXiz9^pIPOq>uiQXrJW=46sFl4UiUEA!e{v-=8CAOj9tz4yk?jbv6jPe zFmWgRmVaoOrr6wSWd8N7D4OJ`8)*S843$I7tTGJjS&28$SnkkYqIRG7B?5b5?R9Z> zcQva~$a)B)-pgW`Zs+Fm*#p@mNGM4 zEon~S=d1CWU0wKrkc&4z+oXkV;+eEs?U6pk;}SbdqmDC^RJbJpRP>0?hQ@o=d-GLw zUW1y}2*c3Bm&wl?4EMYmqtIoc4KZn}9<0ht84>gGBi!D@M z=}KAm^O%dENrJwobMgM9GdlJ>-Y#aw;3X5=00pzJ}}<>YWgL?k@8;ELY_=%0V4 zP8NkVt3i}mkGz{^JafhZ&ITj`0-cdMW_l_c%4b4$YEiFXExhOb5fF|M9mC+g1_O+1A$$)wv|yNBeZl8aT{$LU<&2+F@}?No+Ct z*Ofy==GGz9d}dXwyAsyt{REVOH9pdgQX^;7C6il~gRZpP!%OyK3`S^gQsx9^T%5 zJ)o^i&^C*OmD6GIg&Vb3t}+z4`t%85`d}CHw%2>6OHGk%c(#n?6EOeoM6n7zmBF&$ z$ck}Ud!t+_@9piy_FfUk@y|}jdTp-*WkbK&4L?5m!OmGM#YcQ9=i@OqN;Y)1sarjI zq+bOoF}*p7cEF8m=r;`Arb$u+xpWP>$%RcA!VHupan2%N)78iP0+L^;Hibk3X}-~U zZy-HpWfSN(0;M>`G49!no@brYh_#m)Un%pP%T+i54w zv8iDmXi0EiT|q(?>#^aoHXVe@*U0i*t9G6mFksVn%@}eXG%y?UOqx8UHsU#(5hwgF zX!al0CGa*t$K0RE-l=v4-3QH-ePc5k6}`7oFMCf$H^N4nn0NklN>z4t^D77kFFseO zL&*8`v6Ch1&+p#R^IDnh*F-lNP<{P+7N`@_(k#I}uAo1EiMuAz%YzCT73N^3hs9#M zYh3aHkyJV0Vr)Fv>_@th$a{CR&3nopEPX6JgAHQ|3ISa&{Fyt-%e%#p`qQ)2%_Et#{AIDL{bko&6y6M%G=^LV9_c~8aZU|7ra2FkVQ5a(WOxTz(r!2eeODI zmw&qwi1Z`SQ12NTG$JbLaQep>lK5$MS ztEDU{rzpE-(*Joh9u1&YBLf2Mpx-B%e!kAPSAk$aOx5Jeefs0){yNnFmqTwlYNGBB zhw$(b{d3Is-2#I;_EY5Np#Qgwe^U4VsPX@U8sA-VK#6-SOsSAkqSW0S``o)C+N|(owIPbjbGJVA-@gVF)x#k}iFYNtqk_qtO++8Th9MNwSs@1)JSoM% ziKE{*QRD-N8#IaT_%ltn!dISz*~^{U zT~GiC0&&<dwbmWYXoqcX$q)35KBePM@y5srh?PXP2`4kvl@ zI8uLYh#WfBxR`Af-}ZP$#Y>;XurM#?sJEaR`2|?&I02|>-bY#HY7%D$#X`RFU3g^p z+_Bf#$%&!bOoQvgIxRzeE{^XDUSF#zw_l`CNWam`?AKbL#*iJB`IvBOeSI;+ zcb$I_;M8Gz>K|F)RmEHN`TA2}|@IJw?j_@llR3@WaGnv6nG}b5$zne8^S6YtK7*@#g)G)wzCtt6q!h z$tO+)8ZD#*H5PLDmdR##PVi+&2nB`S(qvkT13Oal=#cy0rFAe?VVqqDi~F&9>#Ct9yFqAJV87u2AC#k*&8JKH#f zHH9(U7-*v~aN=pItcs;rtsV-fLZbZYxP_!oLuWJ=f3AG8?dg&zl+eahFL8%*uzzUe zeLB>7daMEjLguy?__;CIZylpzMiFZB7cdQ_T7j3OGUV9enXAcr&3W^RNv2U9R+66> z%Z&YwC>3q5a(vVb+X{XLh&ELZzklVO?(H+ojwCSnUX}&^39-Dyg|Pm#a5k|L`$~t& z=ltw+?e7 z$+XhB?9ZGU)bXa1%?>55xNlGUtwJ5m9czajyWNx{;h4f3#%X*G9T8tyW$uNKe#$O) z0m@a4o#s2zLPW51Vq5JP2(^!Lhy~anz_)s(a4>BeC>J=!d?xhmS|(-%IuF0!%!Uu7d?r{@Eu*A^ChyqjmM_aplu+IzT@kt?Xo|5+t&P7edKv=|760S5< zO^P3Xmg;}kZFt4v!NO_mM)IVRywEZDI|4Kr6@H37&ZE<3?c;5c>B-S!*|LEPfL{7W z{n<_5JAIPUe+#VyuBCq)@}RTvIK!al%c(@~LHc;pqUz(8iL?q^?^ckeE2>cb)CTxq zIb)?>_~!Z)aj}U8)Vfeh9Yjf7TmiL?Ezh5(Nt8W^`WnovB-6KgNIj96E+xZ%6_?Dv zVZWyg)J5o(3R-3kWJm5l z+|x(8#Zv4(33YxoAc?~9n5Z+?DGpF2{?;u}4x zYE&nKnr0&|HGStc_e^`Rgi`jfOJ>j8DT&2%Zjfba24c+6R2*H>Pdi4UJl zSE~*h8tU;Fw%JOZS9tKoP7;8SB5~ggH+9j4Iz04fcqEmIsE}IYCe+EKMJsXS5b>>l zmi(<-Z^XBo{n3lz&)Ppwg-Tp$sGF%QL3tl-_So?l6bS-Qr^!(g1F}~~%Z}f~6HYM< z9VyGJS-&Y1|F5vzk0meZGV_p3*HGj1gypJoRO8-1$~pd^HRBI>emhbwByuc~ zHdMhSC3UzCYjR0&_PX@~ARJoZg;kunxq3S=r3;D&PR0-ORnfGwvzRDKu4b9~d}}*4fSh_BOl{DZ^=t!QB55g+2Ze?Ad`%FH5>qYkA z!$&Ft!FSi9AqAB!4m(dPdX}BMdK-$?o+w8uV=w{fWr9QyLSMa)$WnoRsj$776{UKM zXz(1@TpSsc4~FU$p)~ti@dVQD&uT6XNqY6A=7A?Ul;h{+28BgfP_pN5bi!^k=lpKc z`f;DX#s`l`xCF1#Z(ks-9JEy$L=n4^(CzaUHC%CJ6xr7P8>cRD_Jl}EFH!`t&Ke4? zkgm-%f)pR-i-0f0z60vtO`3et{$tST^D!t3*%vda|-F~P;ndwl^&Quem{f0t+*hE^sPyq zEaDyDO5E)WXHo(#6lvA0WMY(v1X;$H8T{dAkL~f~Mc%u!#FM?)bS_Z-u>JAI*%!Tj zzu5zaND$P_DOkN*(Ysc<=-KaaX*0g!Po@*kxQHlh^@bnNi_XUSu=kyYf|WyfAS{_r z(<~r6FndB@joK!n=8SP}Q)#11n=`}sU5`vE#ZcLo{QGtlc4F7Lxo^e*L~kd^1g{P8 z#UxF8Z9hA-Z)wL&$_`1Tq9%uBNB;=Bs9gnvB{aJ8fv!OZ@gzWiG_qsa=1X&F3;R~` zOC;r-0~{4jOSJ#~75oreVO=CgdIexBUG9IFUNu_)+onZq zScw15Fu&FX&OLH0JL_H?@poDIYn{9F0GJQ!CCK>4-D&_URlnK}JD3>2JLcE*^@YjI zOVS-6X@2gObN2;Bm`VIv*gmq*@&H6nb7KnLWtszLl8XXX`ar&v@!ddWT)L zp`ZR3dQZOxtTZ=W=ky;5CPU#aP($3KMl-YD!=hVH-h~MY3*S>$SI^>ctJeRv;QnEL zB~HpP%QW_&CL>{VyE}C-;{jN)i7YqII^zw?`N}8cL(*@;h*?PL^J5Q;`_?I1 z#(RKj^nF`F#hg+QM2%`+s*r z{hUd1*hz`-F(xk~KmT$r156=)!qDAt+`FEeGnqY+!Un5mX~6otF>!<{o1hDm#MH~! z)=JIN(bG3-ZY;rs&Rdn0)^25Eu)4CQ8o}i=B{=+8i#ayDrsiRK;VJrx)>2dh*J;Vc zn*6OAMWd*|^C3>}vGq0UXyS+JYajP`K<&!gi_;uW%!B}Hf_CGzf%gLQxsrqtYa^&J z!yRu!O3BA12~NwZszIA`(;KFpZ_lmuxJbQdo!B)`_n174mxS(h9bqoUWcvwqINK@4 z2b?qpt30$KjzteNHIWU5>-Sv;9MWfmp*HC!sS+uMyym&kH0OO9aJPYrY$od-pC0%A z{*~nT158VJ!2DS!%MH4|`IQz!`+D#q!6~)1ebYUB$aElk>bW&4>dhcAG>&OLl9~&H zB>H&khlm=fh>Vs=k0DkjkUk?xthMtM{)!i+Zd+MR<4$9wjGmk2M|MY$~>!iG+`Pt-io<#{gLn$#6>m;0-adrSa5VLgb0r!X}1MrYplu zEw5U{oXu~v{@u)H@WGct4@kw6DZ1BvDQm47^tcQy$q0ITsP6W13`NF=Be&oijUwn# zVcTn5q37IjQpwG*9)Y?v-x>q$0BO&8|Fzjx%T6)csU`K(;g(0|+0xo#Zp1}%8(5R| z%=!WeR6J?WJ-+mt0XQqkYvUEquKjzC_wfknPO;?U3)JHu^J^xYm&)Y znQ>S_kGUJ~IBPvW!q(>XoW|agx<&=lBTcv8Q1x3C_Om=y8cG9IHxug zB#}!nohorDaj}j%e}266rIu9q*T$o*pwJ<8$?Y+PSdb62mJ>kNWMc&#UPhsa@?uG^ zX(=ugmKBaJX&q{OP8lYhHOsrTUJhyU5_AeL_j#X5X!&3ugFN4Z7Xvl%g-WeO=j)WV zPj#zw?enr{Pi1r1h&k?HaZXi0mF8rmow7 z;IkofMlJOo~mR^t|zH0c58l@G8dTP0Ib_ zC-99e&x7@pz+QO|;**=E1F|*pKrQA@(Q?WmDy>LT&C{$~{e?(e$tR%cib`mZcQc)> zWM`XUkv7%KLt9@;7eZmd7`S2hB;WD+;*}0Z zY-mXN6Qpo3`Rlwq>)EVXMs^iCu4I&+*(s^C25{%nh}-y!!P$sJH##1G35ph%8icHo zW8?y!3W%w`LWwqWpY^CZapTO*ag2HM_eZ1|H!ejFZm&Hlf4S}W75OnQBfI^vFkLnV z6SS;`VX>s6)18k>x9u~G6h&Hqw;Dq)#CP_!2Z!jNBB~Kc-5l^Q#tfiD=mo#@~HCBM`=ARx(iL6|#ZKY%q zdcB<$pHwuCAH_9@CZ@mwblZMJ&j3+W@6_$*i1HH1rwQS$*oN?)hEvRW~kKgQu^_>kOk9p_uFl*{sO%kd-*iz^a ze71JgoLvXGJ&T^W<5AaiZ)3JJh)B0SVZayn2$C7gXR>Uir6`s-wDC4?oDTYQbG^GK z-?q=UZnmL^y*?YZO7e)x}D~svc(d^B=lEuYt+(U+hfLO zX4$nA-i`?_TdC5`OXKV5jZvmwUy`mQn*?j^G^~v4G$<$7&IoB#=+n;`)u(rQENylT zbvm`$jpoz8pDUjT8IHbotvMXAGSIb-Gk(@@UMjWGdLoXA-}Xf;N(0i6 z$c~=%M10@olPCK9#?$W5t#%b6#~$#?tOQu$SyLfzbO22c7Ck;$#4WYfb;EHunK80< z-sA2E2e`%-`0=P=k|5#*UBScE=Cl4+`1rC62tu#t6nO~(T4Gbz`CPjfKF_90C6`B% z4?DGej!Vp_c<0QMCtYuGIos~Wccve-^tuOzOOh1y9`+~uzLZ<1V4I7+df|K zQ0}{>++5x2&61w>*LX6`aIAiEnSpGDR0AHXm2Y_2DvM%P{Kos2s_;a%nI(k4>Cz|t zbPs&GoIiDToUTs&JE+0 z)slU9jah0q!Q~i@(tuy1^4i)g+Fa#U-+2a*vQo@M zL23XRV0yl|xarvSj9n(T%RyoGba{B&MJiX6^8~k8cHwC1fU%9}gut&Z^8HtfY}Q1r z0X9)9g^r73xlT@XVo;I*jEzQ1W4p~N%sN|atWiE}qG=|%qbR;qY zhCWWNZ8hK8duKautd0QI!DO(qY;5u1&PoFc*CV1ZW=`X&uq=qF673DHmzl4dpcZ+r zKT#+=h;Z)5EEGO*+#}4OoUiY?@Dua$T{qxJS%9Ltx~GIq%{j}#!OXnHme+7li0J%~ zF>YE)@_Y`&e~5ynAR@-R?UfcJkt5)e_}%ArpttK#>-75|cEQK+cWZ7V$@WCY?$c(X zj1w&*l11@Csz9gcJ&$8O)tB7P$KzwHV{$de*aRUamj02qB^ite;gQ;W2P*hFl}l2t zD(KV}%ps%^|LEq-4LGrS`8wKH6vLj|6^HfABSJuNc^EtOte26%t)CB)+^2a2u6$8P zx8qKKwok2=+5D_~A8y`fI3cy#Y^|x{fM^KW<}5aBxSiLw&@^Wp%u|SohRx<6I>Z## zxt>lW`KSn9gIJMZiX+fDh(;HSi?gTT`0lNomBZbFDL%#2W8RbDm;x4yGNr5p&oGys zZf)Yn_$-hPVq%+id_0XQ9=m#r%K{E!9yXpnlJ{ab7z5N9UWUK6^_pqf(Un*V1$>k| zR{1)7%3hCa@HCnJ$E#cCsHWt-26b2gd?*Ec7m9!VS;Dej;O4OFfOlc&It?XgMYMZr zeLW1Y#fc_S2wk>^lG)F0zk&2U;+rAD3X;Wu4d*)7vpZ}I)0wULS{}Jg_txnOa^yE*#sxup zA(wcvR%Biq0#g_66fn36lSi>GSAP&Gpmg;foGN^IEZgns2cRjQTsGK{A{*ZhU;1|Q zEXT;nH>t)x5qk{r+drvfYSj1LWZ}`~dz=|~zVlEO3bWBwUPk$3DsV`k_kasWoecrh zVWnMr_vW<8XrOr<1pZ{2P7xz2_w(5QjmGS{tb>{J4*_et=IxF^C=5LSh*I3}>GXVU??kYeJ;1g5KDbf|!Z4^Xjjt~56 zmLE?qDf+S)!p1+T{rd4fT*gZgSUc0;R~z164)yQDfKdR(w9*!w@f)T7^Ktz(U=K-F zH1_NNeCa=|$A17leo26lJ0DB0a6mly=Spt?xQdreKxy?Kmns1`qF4b?^Z{|0A8VO3 z2Hc{J&y?m)2jMS!&%oHgV1&6H_W^J52b|E^w7c74hK})lg#Sf5fT+GO)R6XxpCaWy zg!uVaO6cxxjl~k$_a(Ia`pIN0K(eIj;`4u`I@9iMn_O?k|KSp2KvW6VH0DW|G3w=;sJiDAgme}Y2*xiOQ(k$M z?~}Cz8b1=71-JCFU18(1KUP8*)y$w2b`z3ZPJE>3e#XhXf#c^j0f z=f?ZuU3x3>8zB|-*s(rgI40Q`9UfyHa<~Axe1jS7@CF2R8FyF1jNeq(GGCn54UwoG z{~Q@_oK!iEi>n)|T69ztY0!w_h0Dj_uffszrS(c8666C-b^1_Bmt*TC^Ti2t%{Sm=UIm|_>ouKQ{qc2H>W0!t(V6vB;8ID^ zI`rD@k<)RD?H-NxSXLNiF=58(mi?kpqMp%s?23DH9p=&ug!)%603qtvD+p8_hBQQ6 zB4l#mPUtPz%dXzxI?hrX<9Jh|dv?=Zb1zlsc-53p(>?PfMg`((zYD~VW1=GDE9@mY zy~(USPq2yjcu>4a1flc;v>sK-Du50OGB!D3|n!>R)>>5zWgB``c@KjGt_PQhS2)WE>G?k z#QH!Y4Bw_PIF|rN8yKwg4^GxynBhi2mBwG_XO%Z-hPWt=JD0&H5}*Ybjam4cnmWjf zje%?Rc>0Zj#_HtRy3d$v5)F(F5UJ1bcy~B;O%3l~UZ*-+su4633)=II?x^BoELDe- zksB(p7`wBOgf~LaBu>0}uZ+@~4ZYE^;^2l7F-Qc>jJgeuYRgUpCtaE#RvEEx2$<&+ zKZ=fgs)>F)r?s)pj<#-s=2wOSgK!mN(>e%&TeL0Ee1}TU!XTHS9$QK^&x-^|K>FwP{cj)vGH#AJ?_VnV2R+2xMMC#k+2uN7R(Ntu;wf-0hw4v6jcaj3W_7p$Z+z}R=toUsSnkf(41QXv&wNLfnnQCnHwtLR zsxq#ico;#5&uNd{_j4>Q2XGo$-ROg54*4lkWfv9-xeZW$9JV=C6>yscuM)#`tvSe} z{|=4#d^quj|5OKY=(=&~`SG~7)oYhiY`gQjNIgpk_Z!@g=U3vs?ypxh2|EP3+Mbel zR~<-o6dkxTw2FPATcO}eXW5(oz0#dp&uMM^wAT<%+(6y6!2N6 zOZJNDE5<~r{lifFWv9pq9EN3Q^;5nP0cd1EBHE_l2Fr9SBkBgAqo%(aniag13fpO$ z;e;XXuo=B7~N=n$Jon2JO4E5B%x)r1@xna(fK9 zz>tk>PHM?Lw0$qCztJ?{2CEn+dSa1wF#|R0D17no5jBn!5VO*QdnN{fR_bokI%T}q zVx%fnqwP+(nip3g>$lMxj*|}N$mhZFV*2Bm4I^CUNgK%K&6*mR$VQzZlJTgQUWgRY zv)_84Wf2~O{i_WVn44==J(C-6vcrlBW7=KtLB<>eVKD;bshTXyd4Ad@W%+v?V9)j* zc}Y)#yvV~5iLn>f+n15i@CtObT_c;w%+pc;NT4v;q)dxMQ*!S1JN~EOVvZugQENEB z3+3a|Q%m^g7W*M#zOah{jQbWRp$9)Am4*& zaYs3aD0Xx6ZV)cNN2TofH-I?T?jZPh4jKY?8Bkiq0hAEwICu_k1zBqqY6P7zgZ3`e?1?eb0_MzM1@S2%dsQ zHYrqqfM5)*TmR${F3un}=O3HQZwI^c^!UFH$00u(s_QqL7ohPzN!(j%jDH83t))xiR1t~(8a%gaCG=`ySBHNSFI4S!&uARCShuDVi zT-EFAdZxqyG=jmVG1U^I;b zbw19+DWKYHk8rkDF6HvTO6A4M6ZaakJZpTEm;EF4tgIO#Xd3DVE_izT&C`4o z9_VoY2y%P+MP-CY9^Pa{ifuat>r_a`S{vLPTuGZ4Jy@5aPrk%ATcjv0EoX(FPOr)? zYUB?New34)AF;g^XJ6O-=$6^+a36V$~w$i!Qd(99&$gJUKWoZ-m<|bD&vb|h1 zAu8HgD(ReI5w^Mls}d8V70Y+L&d5#9IUeh|+u%eQKQOad(PL2lVNm1nk3Pjq`fuk~ z*tk;)T{1*xMa5+oJ$Z9%Ew(PFRoZs0vrz_3=zU*B_v&0Xu>QVQHx3_tSQEYAK6Ipq z`pIuOUY+Jg>L8)O%_aFL8~apYL3ychl?R0E-2|&9`R+A1zdeCc-NLC zR`M&(<+{meg#(}*ekA~1$(+400GMdB?Dy}7Ve(RH$a~5|Y@-S#?NVlLh~8){wUE$d zIv_j0`3``H#8zQ;g{(<}FZl-o!Rc<(Ew_-azOLs$X-6K?2Klh20yXc_QX6B-7jp?a zQie#o;FbhOPA%$&q7O>(b- z*LQM6C3*XL@=h1TfPloH z|I`b4u*4J}hvvVH^#7cgbQ!S!0EF++h>4}Zm_mt3&Y$)GX3hhMXWlnwvKxQ@n`Hm` zD`Gcc@Tb%8pDF(FSJ-X}U8$8@$&G_u6=0Puy9t9oy@mrPYTiwu(cg$org)V;}(Pm$U>92JG`O83@OCcJzk2`-&S+bi#r#Y)E{CA$%@2g?f z0d^aCRRQs9(0y*Q&Mv|7T-oV=WrXZ|GK?G8?SFCEfHcuvf@#!71|Q%+{h)|kG_YHf z7B#*oQ476Hwf6A|57axmCkxE|yQr zvtt=AC^F&34$qNKPkoP-i2))e_aa;JvyTbF-WBLl=*BT$cQ++z=Lt`Ft@tH+ORDQq;tajrweG0+caQtCtsLytt@TEu(H2Y&yN* zoIt~mBe89LcAJgw48rC?5~f${HD8A~yoGDVAqjelW?Wvnxvr3u2X1Yz0C|alGMFAbhs1 zP5{Ej3(=Bi3xP{D<+Ji(E|KaIW{ko4qqprBr`s0N3)>ws3p>X8$}f31wimO5n#Aqf zkwVaF2ORFTqjw&!0VI+aqY5d|G53mhgq^XX4!nT&#m#HkrOi49HgjQ|ypgck z^;RU&b7%2`m z^OpEl=Urq7T7YmlyBM6=pi7B#^5E+jEye~cBpDkc*b^o`%q58#BX&k5Fdt!jqA2NS ziAnGQCgX(p(YYk28d3YtP4g8^#UUN^5+WUVhmXq3<{jGjAeZ`Jpz+NRe3__{j|m}Y z+cN=!Xc-}76DO!P1R@C9qjqchH2A8l!GYzQxlk{Mc$eBzp6VA0>q3T8CWFz%K;Cdz zGzpNC0PEx3AWhNi{t<>WKN{syQ!i=q1kwI(6e8sN>>#PttqgAX(A=`1n|Q3uVLc8RNsJr9plk+cYg`;{f{#L*L%K`J4J4>L^AC;u_siY;&LjY=t{%CY=6&{t|yF>VcdVZ2DDYurMKY#wpE|1|YhPfU!QThbWVGDkt^(l;xgWTNZ4}1kqB@--4 zoPG!!wCyBjrD}N&5;GS?fCP7|Qre_Hsp$q4N*3UHfyIq*O zC%oUVh5?X0;;04pF1)xTVIec?ZtcdHU0N3) zQY-=FqrAKG%!}H7y2q!V-9{(#YTXZ`St$wRb;q*ejmdiw@zsw$nQ^oU`8g5pf(O%e z(vGg0OuX@4IHzroYy|q2{C23CnSql;TUKhp33wQpU^o9M+e$UkY2BuZW4SS8bhs#} zUxkv@isw(rGofCqcvYfnrB-<4RP&1x^8Wj@5u{BM3L%wVod|a)hQ6pE>waXX5b#N->;Pmgd@xzVv#kEj0b0Q!P6Py7NZ z3Ha3zwY#QK`6JoMr2$AvV;R>6`6ygd$jv1Y@?D_vj9iFsNNiGeI^cGuKva9S>8Cp? zvLt)22*k)9{W_vERQHr}&9Upvmg)O54NH9Aoi&w0#}T{mWeX02JPMa$X$&|OsMDn6 z)1ZajnN)`YcN7+^xwsG=u^+WsYMDCtjRyk??1$lXGq*(+sv235_EKN;5H&M}48t|jw(%#lD>3**Nc zLCLR3mxrYbtH$|CY}TfmVer*0o)SxfCX~45VfwBu2KU4XK;q$B@!Z-=8bFo8?=r#^*wjclyb*vFe zKmuqdHHV(MIv36Mq+&nxy*3ATTTD>LMtxOVqNaJry13f&-vB3|Sm-WTn);3Mb68+G zL*T^@VNFEr>!vWipI$k0*gKLPoikxzFYOafu zVAHuxzOmj?zVJuVN0CYDu2F`DUZv+RjLD8IP1wd|G8DO8Q6U|VWS_gH5MA(MOu}(R zDcmw~)v?8q%U#OxLua<8boSfQdfj8VUf}SAP1YM z0Ybi#7i)QRbRPe+2;`qala~Ga)X-f=45>;GHr=`ZMV}+eAElj~2#T^T&Ma4_<$@fG39-%FZAGMJA{F2EiSpI35(5b@4YInq}eH`6MVQtX$;ga&96CJg~yw=eD zV5$1Q!P2(-Ss;A@gY~Fr?fB7zj^0@XncAs0NhdX?_Zq3n<-SEPp5Wl+{!2H2P)*+8 zGDApBo#gMBFm8HT7HzmeT+fD;(QE*c;x2CLvm=dSgUonra=nD}M6f1mC7WbFXh%v` zrmkZt?~smjy>1|o&=XFgcnk>19@#rMwCvX%CLBt>BQwyecCMo?2_UhlRXe)#$-wCs zL(;8yZomH+J~7(n32$PB*DpY>s5FIaJRHv|8C|^*Uiax!k^WMiH7-rZY3xm{-OD%{ zjt~1TF{Zuz&}i}-L3qbX49m9hH>}EH$nOB}G6MukN+`wTcivD*V(R8}D?M(gwB8sN z!WTVZ=qYgzx0-f3O3$v=a2q;5>iDJJqg5S+3Il{K^6lZRe8->QYQyk$*vpH;ci84@ zB8OZj8qsHNNNp{+vAS$6R{BI}K|Ex=J(oF3yrpB;tSR5xgG^Fp%%b=8>j2n(Yn>YT zNhyBRs^TZ|>cI2r<1;`>E_9ggHsJHK0cz#vhj9a3S;(EO(Zg#P1^ecw4ueQOUQyZY z)rmpY_)P+#!QSA~5Ui;9CTt!p~(DHer5pSG$`vg z^*$`g@90y)dtxQ9zwldxx008ULcbiKIw*dmJp^EFx|MCSW+&FOeZD^a%$eImB(iYu z@RZOf^&8*4`_@X~vS#*ZT-2-cY^k|bcz2joK3=OmUX?>naMBUj&I(^gJ@)d?+1oPZDZys1Tq@ULaaOTP=2XJL>N3I&b0R#dx%YbyP2D1I9dU%aN318Q7 zPNG+==h1FcvrdJ>p|ojw_7<^!?P|qfrWuu1PWF@X`iMlJ@MA$T8MEnfNfE=(7#jbu z=62X`%UOTvi@}Gh0)3EUXO()NJF0izkyqO-fjlGqc3x#@B^s!ylTkM|`+@PckIa1H z?(|nIu>V%n>!UvGpILH1ro@?D2f{r^hYzeC zaRCz6j}N>J_6rIs_QMp(H_tc=QeGdnFi9LpX!LT)!jocrK|^2(g*t5YH7)z11-}f5 z+%~6w1%^%CFJW_ZozHC2Z9kZI0*@=WFE3lpS30N zC1J&NE6%{Ar}c&R*`2Z#3tXMB^Lf@k<(8vdHi3GFvP%jI`B+~IfB*Q& zNwm)muiB9u+sw8#qr(I=eRzAf|5DB<$K27yloO$wu0Lvt^~garX#ct8#HG|1+rOV6 zpXbX6mrYBeYi!B43&pn+DGJOwLbOY7Psr6#iYX8OFSig6V!v!5vO_&eDgOP0knEe=h2~Gh~x9n^EuyUR`lzNrw6&FFIMoZoifJrmRxPJc`3#sTLL%?sZb*rpWbJUeom>|)qn!9g?9w^# znc*817=O%);#2bQO-$3h*E!{B7>?`niKCOBkAahUD%&F%}Jqwxe;>Y?c{=`JVou7EUq@XLGtxP4M6l6o6y za43d*qMVOJU2N~}N7q*b#B$4!iX8kS2dLZb3ZrtWVX9bzU1U$8!_KGuy%RhOm9e6U z_#7+W<=GBJN6WrzAWMiF*)g@B)Fnx30m@H<`;^xY?;};cO|4V(RL*zuOv^8j_V*TV z&am>Fd($D=Wx4F32X?jcSI9}jKhsI<&u;UMGj-}S$LFN+ZJoCT>Q;d=SKAEfF4f?2u6n4dSMdR%!r&j6p7rEm5Q-)d3Fy{2Y<@u;5cDz2YcmDo2 zdBLQ>CyVTQv}w$k{354H=zIT_>P&h6l1_2S<@NyO8>6I@UG3|m_M;>gtqeXbir>>_ z0hQOcW?jMY<`pF!rBLObiKk`tdCH!{loVT}v_T{ix-qASYKZf+Y`(3c>4dW_n>J3F zfL6I=Or#wZCA5@vy)5bMP-zpBA$TWVO)Fl6}V$bz%ZW&qb= zsyI+#=L|$8*~rgrT*})RTk_)3f928#&f29Hqd1an+&n*4neMf@_T8TR3lxVw@D?QL z;ZbKI!s?P1M0^I>LqrH~E~P2&q`EQ|W}}ZmYW83Mays(cb@6X7P!qsuL0f-8`U?c` zADou$zk>)Gj%xk>@72dQg8v(1!Kd&4z1Fsz3o)#^RBy%|H)~@?krRy7oYc+$t-GCx zxmO#b_e0%9i&Ti$?~X!18ozKv=WD9_Ms&mLXHixgueSSN(~s|wLysO)#xEx5M9zV* zYS#?8T*Om8H*|0FD3HJyYopCww!6pPmAtB1tLU5Zc-TC_iN!lH0(ZLU z_@1;XD?gh9uCU0(7@qdsD?K)H-_*i~R> zU^>06#)|sFn@XN(-?dY&0?YD<=BjQIC)+Xv>AMKa^R7yg5JUbVSdY5NN-;Dj<2~mI z$f%ahD=Be-qPuvDRK8gtvx(yV4i{i14;Yijhl6#0PZk3kcp7-4XoEgKVYrpnZtD?& zZ+`5llZgT__Os^YH!)YYJrm+_#h;b<2Sp}1$)vl2Sg88`Nt+FBDEjKnx&~KqHCK2I zQF#vVbMwvtX!f=Csdr~T`EtpFo}90@^1202KK%+r->sZ({BrZu-4DCrr|Nnx>Fo^X zdYPoLn@ZY;;*Cp#Y?B}JDOmX&mM+b@4wFC}gRBip*xv<8sp46oTX7eV7y9D!gtSeKobl(!kEeteD|z?#oT`q4}z%3H6VD>T(4& z|44QRWm^dO(X%S~vTuq=k3mZRDoqPkPuaO)e^#B9dQG&QIO1F5ISo4os@u2^^v97{ zUr^DAP#w1s6&H=kWm2DQO!ci76)}1jUE{W{4jJj6nKmTRPAz*@$d9h6%O$uZz*bU@ zH}k{tW|D5FfY%q-H%m?@+41y>VR}P%X`BAUWTAAuP`ojV|HpR(yGCxEYymZcdhg*e zkEr}^eE{Sp&tW04$%yuNV85SYryrNf@Ij^dkR?kA3$+$aCMj;q5dV4JY5P>fqH!t-;v>;~=VEaFsCuC21DrBD@~o zin2DK3?79wJ(KllbKz)NgnLFC-`m~+cL(Z+i)=X(u?(WT$>^NI?!wFsPf(q3ZiW{+ zK9_|e7UZ76>ulB0Gjxn>Cqs2UO%hUz{Z|TwO<{v@`rZFkg|D%v44>6jn|FMYFk+I0WLTX!B1% zWj@zth3zJ+J_+h)T6h&w0{8+oi|giCNz#@2kWUlRH^{GejYbO5V15=VdQ?Sbv!{i+ zKtcn0EB4rCp95z*z#Swj;V^~XHajeBmqo}S4BF>GuOM4R`6`-4ZYvHP@uBt5l z)ews}fI74DKljbfV4>?wwHrkwa;P$NZ`LgppMsQF$hnCp>ZMkg*`c*+fL1IA+TTk0 z;DYNb^kTPvzy~ebz5`HTO!}j+U4_SP%n^Pv*yrMGUrThCJ?wIK+D_ef%1J#2l<4N1 z$*t5F!g;3y7(j8reIU&USh&}TkKrmJZIA62D_#p?n;-iI%`DlsX<*lEL#Ntw4LtRP zZa((5KPf69W&7MM{6@8vtC+g0{mgUmb$!J`MupzJ+&rQcy3jVoMz?uvdE*;*B~Z8hftl44y^+7 z=nf(k{8ajfTY4Dz7T$VAK+XM?h%-0TYW-@Pa}jW3^l-a8BH_i0K&Sdqs~-JWVg2X# zlap2K>*r*>W8#ZmHoO<@AO7g|qH5l5QAHT2XV4snY@B@{oG^M2dF z=$m-{rkEQ?DMUYpvqAZrsVm`cF3oAU3uGQwe7dXoB3orEQI^u zgMygXY(4fcIfGU?xA@uxIF4-$IEcEy3?C^9rfDQHF1un0k~Az_d7msgj7z!q@gn0@ z8OqES=U^!-fL%R?FPVLG6@clP_)$!QrCeY5R(NN-g0$^+X~C1L0oCzV+Q@U&-Xb{2 z$(U&f@s8;qF@IjH<__1sckzlVa0&P!kB2c5Ek!Xp?Wb2swLwmW(g7=JDug-D6?!0| zi-7I}lgzuOYAblL^f~--^DGa_FcMZRer`$_{eKiwMatY^+i-rE~4@r zrhD-@jZ@(5)etjY-hynW%TJ3m6FI%t2EFs<`2s%#5u@j>iLUeeT}VklT0i8ODzSid z$eMIK^zmOlinBwFNb&km-VnDg2AI|>ZahZu#s8)Z}MSzac*M42qJ#t|dBj%rzoK_3%TpX zXhw}w&Zlh^r57`unwAbY9Uval1_Z&fLpQy2=32zoyg~bT+y^gO(2`=sQl(Afox1S% z2$cYE%IRxwHU?lmh7)(Yb2@aRGqSmmwY5q*N~KofDMxM}^;MG-b6J`S-EIZXJhZ3^ z9YNEMgn5Q@P-@7~<>@X1qf&}!NlYDTKhZ+dUQK6r?bBDXoPQz=6AUnC@cllmJ%r`e zo>x0{;CJ~6$9Z*ETcT-5Z1q$px{D<=hhLZBIOsZL3VJsjYe1JTirdBvtIysT%Vb1d(uHH8)_Ph2qS4lx(03uYKcja!UUc*NKFMX4<$PEvOD`V$O5T%tV~9X(={_tXZ1g{iibdTx4sU zE7oSvRtBai3Y9*1jAlS;u}Lb^HoUkVP3TZ!K0 zvx)RkY`~*_dpIG~;ohOwNSD$&;*=1%UhIo4eoD|>7H=cP&Qd|=n_0WbIJ!9a&}>nF+vCUTTD$i2 zADT_~kVa(4sf{o`wtL|xJaKh2I>C66Zy;XI-1{n&s@R5%PlQn3cIua$=Jsd0Vf>9F#O^7Hpd|qvf~lfyKJgVjpuva0P|!_L}04zV=dvP?hg!YPCWI{oqPUh zau&=PJ~@%sZ?&z5BvfGi{l~s|ADN3buO9U6pjNb=nQa<9(n?K9_W?Bgt#A5^xzl^t zG$WkD?Gwv^H@(~bwiNRU$SqLHQL%0%l_b6-)>&`34)GVm1Sp1cKFIX(t$gl=K_dh66AORM zyn1F98(WXktWV0GUox?yM+c}(0+$X7{XFnZ?;NooD3{3_a*+B_4S!KH1hKGCp>G@$ ze?3G+ZGd=|Ywnw0$rVr*2H@>q6|`^W1VB8ZCSCaauO&bQctibv8#uR)+2EEf!n-eB zID7SftPuV)@L$brMeWSmtedu*bLQ6NkbAqibNrX5k=u52p=Wj+RV(Ba)XZL3Sm^2P z?fukAz4)VXAN~{Yt9R8scLG!F8Rr9mwKN4!w(hpKRdFGHmwtE|T?f1?4iDQCwI#%d z>p?uxlhElx5bc4@jY&K9oDl0JNfd4Uj>WvthRM{N?A>muDGPo#Oj0CsSFpPLN{$x> zq4Sas2$$Enm)ueeBSmkO?E;j0^7&Q3F#s3*L{DoFAp&VoD0B^#xBYupa*H!WRC+oW zBg_=DhT|zU5hw0Y?IA zr#tnspwRmz4deNEdM-9MfVmclwrPBUCTfy$isbMo)D-MHhrI@R<#Xo2SPcuRkQk^w z^S1zzboZdaTQAGIYw>G2is%d+qKrl-f;e(2>)c7`*46_gTr-*|-Q7_+oX)qtdca|% z+(gGMaDLjMJ?Y)uS*Pj30V3s%n)d4Oy80k}eh7&fr6(W<^X=d|vZKLU`|+RFW!zuv zav+(y3f&q}>53|PJZi;UdV8zGIju!`(G%Llsu6Hn0*R&?UpC1#rb8M3WIm}%W9x2cD@8JBWlq!_O* z#G-*1O6J&ZlX}s4M#cR0cjxV`JX#01kp-xAm%+fYz1@$K%W(c`by64?f=jnO$FN98 zii$`&Y}C#nUDmWHKpl3YA`XZT201Re{a86*P7gLYE1g%{_~MGUTp5R zL#D}V!{~zr&%*XoGt$XcDN4Rz_Y*3s8x-YR5S|BHf_TEDi05mOyp;jo_595Ugq$Eg za=F{Sy?wQfY2Vu8Fi>qy8=Da`=}AoFr_bH@!sGe05o&%|vJnO~QKQA6`K^)Yk=aaD zC0UJq_2{^+B8pWBe99a9X4GC3#w^V0mJH>M>QtpY2Y$-0?K`^M|5O_>G+>UGT*2)Z z>sqW|Wyl<}#9-!~z|r90=0|IeYhkPKAkcJ28}^Tf>tKs<9iYmbo3LKHXrMxOW^|cd zR;zID3R6%~qSEFd!iYr`Uizy<>v(N5?!|}N-aI1zc$>^6R*lmtCb^ZZyQu7lv{*UX zxEfA&Rbp+i^>qPd#P-@ji0YrISIjflrkvx4JnnD$g8Kre;iDT~J;&CO)IPBINFYfC zBR;aa8oK;pR$hM%;oL+GBV&ga8BS}LDq{TFOzZ0^!74t#sZLuuB+gfA*Scc85gm|# z30@+%{AluT!;9$-cfCzWW%@-Nny2Mkt4i9aau`x7BsEv#_W>0ty?|qRFs2%xj!4=H z{a|C~!wJ)i5T%uF;79!}C|Xx6Q%?(VMqz~c!IrjbS-i|k5~8>f9B914uC|0kcV*OO zWAJ63d~>4{FSW8ececXN7VPFEnK#~Df1BsN6OC3mVYA5j|4 zMMP3R*TOm(cBL-Phw&bpp*v!pd4_DsZI`vT zPusn2ROrqm=jq4>e}B3hX+JGlJK8~YRQKtIp03ExqW$D z=b@Rq3N5Y+c{wWpS6O!O4b;5-AlQFAdX_}%{IMm z-T`i|%g5og4chXu3mbU?6oK&}b&!{*n4WH2r{KLgM|0ZheXkFS>%8$?GC(a_%fiX# z+}X{DPi~5M3sQ+B}+||voe^}Z_`LEnIP zgWSLr#$%9FXYI^0ua@RjeN%{+HndBr!k`(kh6yaE*)pNWc|CE}4$X6IVF*Z|w&IFs zEZIrW3}V5celjAy@T`wRUL90bgWIjNg=YOmyIn(mfkMif!rj+~wnna)U@4CvIk`+F zA^O|~DyJam6IHqCt(&XmhMk$4hSE0yjm*_d2{t%!E4?u?sjd`jRM z>4)sG_X&f5K_Nxmv{BWxzS`wO6H8MDg=W zN}6cQ0a?O}Hg-qh@l?V_eVy=fWc;US@XhYI{;idxjNH0{qi|nfeNHv4zulFf19ZaW z_1Dhyi&|VzZ+|umeIFJt1PXpMJCmeWS)nf!{8L-~7@a~jAoiP9hCeoPLu_K4u*6*cUYVN17;VEuwAL|Upjo8GZ)IKwpcQ1`htlX_G%N9L< z@m@y0t%-N)9h@P8FJ8elF|Qw5UoMTGVRo84bBo>PM6k=(yDkKs+z*E&R0!Q^0@l^U zxtiir>R6MMGuN8x!pTf?cUlvyxN77524(n^Z0pms*)p6Cc;o4)&RVPFXn;o)a7UUr zU(cYa|4;@?fNYp~d*h(}xq?GnZAW9b}22+i{S0t7Oob z*Q8MXbpyukyIs8N9phg0)?@b+C7Jy$7(ctf;mRGawfz53TE(?vDW-ck&qRWDYU>30 zUx_m-;%i)g`by0$8kc*b7BjCmu^xLzK4?@s^8!rQHh^;~_u9kd*d}Kak zEsBxHJY>5&Yq1YD;B1ly8fpd(YwwV;w&^&f&g0)8_})COh0aS9Iby7B`b=IaiBan; z>ygbT$|rNA`Z*K7phSR3TzHGdUSW%8n#V{HO6IQRsEmv_P*0ih(B8@W(`tyO=0~F0 z`PS?c1Yr~Cj)c@n2b<#!j5WJ#sr(+_$)1QqBOEvUN5b}t^*b3q(kfn&uOu^yX;b3< zs+4g*Hd;T#p1RTY=eSu(_)@4I@h)UyEF*e*?o4H#rGup&99GV$Fl76f8?inm#262G zcDWC1+j|fqcSwkDApnSsyO#4&u|;)o<@FbT;KmOM;e^GV=A4R`Vkl;B0!|i(%RMR` zPI^ZaT(1+ec5i&+58Px@TDM@2SdAS=i+{CJ7FNA|z}6HBD%6b({Gd%`<*1K3ufhWp zEkPrK*KooSKnR7mYATn{4OqaaA>14= z*VV`c%{dK8^$72j%kATOxg7~xtD`Vn7u-Y@5iG>8t2OICTcqmW2TIE67>#*4><=d5A8A=48 zMV(5EbtS&$owY2n<7H_1?? z74Gh){4Tw`+Q(ixyckgL8H#hntVc_$%);dY@!t0JlOWj1@HZxo9NAZgApWV* zorF(yqy< zfeBZHkt1;i#T(uX=%R{`b}bfGOLm1qv>a2kN@b*%rkdN$%a+k+QeDtNi!|8Edj;P0 z^2Hp?Z)c=9`kJ|Svj^Si8eR7JE2H&!j@-&n2b7}xf%6Xu@*R1%3q|-co3)08%l(fg zM7XdA`QIPfggtC_uo~qmOaEEWy`N+36imQ=jvEz5KVE*mE(6H-Ft)rr=B@f5%)To_ z3ARaP@@Fd3W2yqZg^j*{ehND|>ISU$2YyK;kf|Qr;E}(jD!7%~5Iy!}B1G3UFn)1ml88 zy&~vk^I!RP?BXHp{4go_MF+MXr{wx<1`m@zvNpR=pH%N)w_FhnyI}j-2HKh zj0ITsZ2r}?+KP>uPdH@2TnqUn2G#tSuea6>=vMi4_3hjLAbwWN&cD~`cU`xl-}`RL zj2V$YypGbPeNGzc80x}9&P}{ZoqbmzIasAEG^04pmH85aOPf2JQF0Q7Q1R_BZSno! zrT6e3qCm_gD3GN3+_DjXyI5zpdR__p{GWR+W#-l@&6f{F(C|@5Jb(ty-$ZZ#Y9tfV z^u{Drj*a)gFEFi5biR)pxJi&6aO2PKe)n}p`j!=doy2b+*c0+CFJImbS>Zga^sM?? z@6A=bs_(NEL6?Pe6g?3A6CSzw?U0&X&X|>?nhHE*qGJJzUGgUT0|ij^wbPpa06Skl zqTaD>W#DFD$53HTd%|$`;@kdFesG~0&1hi-WK{_^tTChVG z+WjZGTX-TxD(wrXhwJ_f>YdgFl5(}7Z*)WD^z_d!d&+(%EE({Jm`ern%6WW^lo?Zp zjNpp~%X3uS;D*!tW@cx#Ra8_Q7KW=|+Em<4z5eOX*mK`AJ$T9H#rtSt&D}ojShtiI zi8>d@nu%z0hu3M_WD)0-gJnE&v{Jamx}7>Lz3*C!MIfr4&lXs1iskGs-E?xh0Lsd1 z;KjW#wbItru>O*8ECBV=5oUA1yankcJ%16k#@E^;c^?3QsSyq*T)bP$qo;*Ta(3tV zw(`pUmr|p1(5UOHQG9vm;5re`62H*zVZ}OI-qXVcEL9?g zfqp*WGuq39F1PBX-}ikt)XkqYyk$E+eV_z!LgUn}TjD157V4PNaA{zP>o{zL$5}$f7m#Zdyv)yrQ;4pCW1mu2N7Jxnrq6?C%cp7s!_K%YostZeI9 zKj4wEC8Xlu300mj7u~11_BSk^+nh~Nh2_N0y7-&!P5F_l=NAP`a-7S-n5 zeX^oy$--q@kCRY7FDqM$gkhjzf}5>PQ_1l>#;|91ccHnbavqxK+p*;*m2BmHz#gTk zD{@^4*+@CQazOmh`qWU!>Xqu7zEeh>fC4gA*v4PFn^(UJTW$inW^|=1$#-PLP8mZ4 zP|$#3hpa#T_NQN>hWoYZ{kw_QP^jjOd@xrLH~*~rMX@q-=#brgvj^40!D zBviAEkbF-s z6B=?nK{`rIhs3qsBv%|sC--l4@D=c8>tTPI4YUFh7v0DIc+dy1_ZBAV zKdVK*xEKN4HqQY zcsxoqj-&UfxaALA0j52;lX3_Jh`B!q*mQ684Ki@pOV#+8~{S|QxcI+a`VjV!Pz7z?%jDvzLg<~-Z@){-4b+;>50CV{uO zsE_(J=+`aNK;WUD6SFc}nO8P)4(mY(?9jqnSt)=({_+Gk)}?Fae0xBu>N=6!&DW)n z&0%liGe8joKhr?pS4Y0rD{p3(KFUIE%&Wc+n9QLE9G!OC-n4ZYuVuOn>^uVWr}|#M z!43Oa+a4{RA`R~k-}CWa@Yl%t|UK+{^@h~E7cty=f=EJ zpS@aBfpce}YD+}`w%*6uw(A-90n*}m;|5Gr=}#_M#v~J4r3cUYeU=(O$Zd%FW8w@8 zs|(05@b+(Vr@>bEm3_iL&9TG6tkej?jy#T7`51@&hdWuD*oihv#s_MGcIsBTsx;L;n>h;gp z`*p1O@+xq9aMGw>_rFk|1ww*?c_<2sF5%J~=Sy*qd0nG%q4KN;p{ za(j$`fn9@6==}@zX9s|2rBlb{N2~sem%};0z+O^br~V7|t0DrK;Pk|QQORjtAjSwK ohRgp8_5UdRmpZ$j-@s&%6lDlIT*HNJ0sdUl(7#Z8&gRbl0_n0*Bme*a literal 0 HcmV?d00001 diff --git a/docs/docs/manuals/user-manual.md b/docs/docs/manuals/user-manual.md index 9566c772..1e8541c0 100644 --- a/docs/docs/manuals/user-manual.md +++ b/docs/docs/manuals/user-manual.md @@ -2,45 +2,54 @@ ## Goal -This use manual should enable you to use the HelloDATA platform and illustrate the features of the product and how to use them. +This use manual should enable you to use the HelloDATA platform and illustrate the features of the product and how to +use them. -→ More about the Platform and its architecture you can find on [Architecture & Concepts](../architecture/architecture.md). +→ More about the Platform and its architecture you can find +on[Architecture & Concepts](../architecture/architecture.md). ## Navigation ### Portal + The entry page of HelloDATA is the [Web Portal](../architecture/data-stack.md#control-pane-portal). 1. Navigation to jump to the different capabilities of HelloDATA 2. Extended status information about 1. data pipelines, containers, performance and security 2. documentation and subscriptions -3. User and profile information of logged-in user.  -4. Overview of your dashboards +3. User and profile information of logged-in user.4. Overview of your dashboards ![](../images/1068204566.png) #### Business & Data Domain -As explained in [Domain View](../architecture/architecture.md#domain-view), a key feature is to create business domains with n-data domains. If you have access to more than one data domain, you can switch between them by clicking the `drop-down` at the top and switch between them. + +As explained in [Domain View](../architecture/architecture.md#domain-view), a key feature is to create business domains +with n-data domains. If you have access to more than one data domain, you can switch between them by clicking the +`drop-down` at the top and switch between them. ![](../images/Pasted%20image%2020231130145958.png) ### Dashboards -The most important navigation button is the dashboard links. If you hover over it, you'll see three options to choose from.  +The most important navigation button is the dashboard links. If you hover over it, you'll see three options to choose +from. -You can either click the dashboard list in the hover menu (2) to see the list of dashboards with thumbnails, or directly choose your dashboard (3). +You can either click the dashboard list in the hover menu (2) to see the list of dashboards with thumbnails, or directly +choose your dashboard (3). ![](../images/1068204575.png) ### Data-Lineage -To see the data lineage (dependencies of your data tables), you have the second menu option. Again, you chose the list or directly on "data lineage" (2). +To see the data lineage (dependencies of your data tables), you have the second menu option. Again, you chose the list +or directly on "data lineage" (2). Button 2 will bring you to the project site, where you choose your project and load the lineage. ![](../images/1068204578.png) -Once loaded, you see all sources (1) and dbt Projects (2). On the detail page, you can see all the beautiful and helpful documentation such as: +Once loaded, you see all sources (1) and dbt Projects (2). On the detail page, you can see all the beautiful and helpful +documentation such as: - table name (3) - columns and data types (4) @@ -61,29 +70,33 @@ This view let's you access the universaal data mart (udm) layer: ![](../images/Pasted%20image%2020231130155512.png) -These are cleaned and modeled data mart tables. Data marts are the tables that have been joined and cleaned from the source tables. This is effectively the latest layer of HelloDATA BE, which the Dashboards are accessing. Dashboards should not access any layer before (landing zone, data storage, or data processing). +These are cleaned and modeled data mart tables. Data marts are the tables that have been joined and cleaned from the +source tables. This is effectively the latest layer of HelloDATA BE, which the Dashboards are accessing. Dashboards +should not access any layer before (landing zone, data storage, or data processing). We use CloudBeaver for this, same as the DWH Viewer later. ![](../images/Pasted%20image%2020231130155752.png) - ### Data Engineering #### DWH Viewer -This is essentially a database access layer where you see all your tables, and you can write SQL queries based on your access roles with a provided tool ([CloudBeaver](https://github.com/dbeaver/cloudbeaver)). +This is essentially a database access layer where you see all your tables, and you can write SQL queries based on your +access roles with a provided tool ([CloudBeaver](https://github.com/dbeaver/cloudbeaver)). ##### Create new SQL Query ![](../images/Pasted%20image%2020231130154714.png)o ##### Choose Connection and stored queries -You can chose pre-defined connections and query your data warehouse. Also you can store queries that other user can see and use as well. Run your queries with (1). -![](../images/Pasted%20image%2020231130154943.png) +You can chose pre-defined connections and query your data warehouse. Also you can store queries that other user can see +and use as well. Run your queries with (1). +![](../images/Pasted%20image%2020231130154943.png) ##### Settings and Powerful features + You can set many settings, such as user status, and many more. ![](../images/Pasted%20image%2020231130154849.png) @@ -91,11 +104,16 @@ Please find all setting and features in the [CloudBeaver Documentation](https:// #### Orchestration -The orchestrator is your task manager. You tell [Airflow](https://wiki.bedag.ch/pages/viewpage.action?pageId=1040683176#HDTechArchitecture&Concepts-TaskOrchestration-Airflow), our orchestrator, in which order the task will run. This is usually done ahead of time, and in the portal, you can see the latest runs and their status (successful, failed, etc.).  +The orchestrator is your task manager. You +tell[Airflow](https://wiki.bedag.ch/pages/viewpage.action?pageId=1040683176#HDTechArchitecture&Concepts-TaskOrchestration-Airflow), +our orchestrator, in which order the task will run. This is usually done ahead of time, and in the portal, you can see +the latest runs and their status (successful, failed, etc.). -- You can navigate to DAGs (2) and see all the details (3) with the DAG name, owner, runs, schedules, next run and recent. +- You can navigate to DAGs (2) and see all the details (3) with the DAG name, owner, runs, schedules, next run and + recent. - You can also dive deeper into Datasets, Security, Admin or similar (4) -- Airflow offers lots of different visualization modes, e.g. the Graph view (6), that allows you to see each step of this task. +- Airflow offers lots of different visualization modes, e.g. the Graph view (6), that allows you to see each step of + this task. - As you can see, you can choose calendar, task duration, Gantt, etc. ![](../images/1068204596.png) @@ -103,16 +121,16 @@ The orchestrator is your task manager. You tell [Airflow](https://wiki.bedag.ch #### Jupyter Notebooks (Jupyter Hub) -If you have one of the roles of `HELLODATA_ADMIN`, `BUSINESS_DOMAIN_ADMIN`, or `DATA_DOMAIN_ADMIN`, you can access Jupyter Hub and its notebooks with: +If you have one of the roles of `HELLODATA_ADMIN`, `BUSINESS_DOMAIN_ADMIN`, or `DATA_DOMAIN_ADMIN`, you can access +Jupyter Hub and its notebooks with: ![](../images/Pasted%20image%2020240828153754.png) - -That opens up Jupyter Hub where you choose the base image you want to start with. E.g. you choose Data Science to do ML workloads, or R if you solely want to work with R. This could look like this: +That opens up Jupyter Hub where you choose the base image you want to start with. E.g. you choose Data Science to do ML +workloads, or R if you solely want to work with R. This could look like this: ![](../images/Pasted%20image%2020240828153902.png) - After you can start creating notebooks with `File -> New -> Notebook`: ![](../images/Pasted%20image%2020240828155058.png) @@ -125,9 +143,12 @@ After you can start running commands like you do in Jupyter Notebooks. See the [official documentation](https://docs.jupyter.org/) for help or functions. ##### Connect to HD Postgres DB + By default, a connection to your own Postgres DB can be made. -The default session time is 24h as of now and can be changed with ENV `HELLODATA_JUPYTERHUB_TEMP_USER_PASSWORD_VALID_IN_DAYS`. +The default session time is 24h as of now and can be changed with ENV +`HELLODATA_JUPYTERHUB_TEMP_USER_PASSWORD_VALID_IN_DAYS`. + ###### How to connect to the database This is how to get a db-connection: @@ -138,9 +159,11 @@ connection = connect() # use function, it fetches the temp user creds and establ ``` `connection` can be used to read from postgres. + ###### Example -This is a more extensive example of querying the Postgres database. Imagine `SELECT version();` as your custom query or logic you want to do. +This is a more extensive example of querying the Postgres database. Imagine `SELECT version();` as your custom query or +logic you want to do. ```python import sys @@ -182,6 +205,7 @@ Here you manage the portal configurations such as user, roles, announcements, FA #### Benutzerverwaltung / User Management ##### Adding user + First type your email and hit enter. Then choose the drop down and click on it. ![](../images/Pasted%20image%2020231130151446.png) @@ -193,6 +217,7 @@ You should see something like this: ![](../images/Pasted%20image%2020231130151610.png) ##### Changing Permissions + 1. Search the user you want to give or change permission 2. Scroll to the right 3. Click the green edit icon @@ -208,20 +233,22 @@ And or give access to specific data domains: ![](../images/Pasted%20image%2020231130151816.png) See more in [role-authorization-concept](role-authorization-concept.md). + #### Portal Rollenverwaltung / Portal Role Management + In this portal role management, you can see all the roles that exist. !!! warning Creating new roles are not supported, despite the fact "Rolle erstellen" button exists. All roles are defined and hard coded. - ![](../images/Pasted%20image%2020231130152628.png) - ##### Creating a new role + See how to create a new role below: ![](../images/Pasted%20image%2020231130152819.png) + #### Ankündigung / Announcement You can simply create an announcement that goes to all users by `Ankündigung erstellen`: @@ -236,9 +263,10 @@ You'll see a success if everything went well: And this is how it looks to the users — It will appear until the user clicks the cross to close it. ![](../images/Pasted%20image%2020231130153220.png) - #### FAQ -The FAQ works the same as the announcements above. They are shown on the starting dashboard, but you can set the granularity of a data domain: + +The FAQ works the same as the announcements above. They are shown on the starting dashboard, but you can set the +granularity of a data domain: ![](../images/Pasted%20image%2020231130153427.png) @@ -247,66 +275,70 @@ And this is how it looks: #### Dokumentationsmanagement / Documentation Management -Lastly, you can document the system with documentation management. Here you have one document that you can document everything in detail, and everyone can write to it. It will appear on the dashboard as well: +Lastly, you can document the system with documentation management. Here you have one document that you can document +everything in detail, and everyone can write to it. It will appear on the dashboard as well: ![](../images/Pasted%20image%2020231130153801.png) - ### Monitoring -We provide two different ways of monitoring:  +We provide two different ways of monitoring: -- Status:  -- Workspaces +- Status:- Workspaces ![](../images/1068204614.png) #### Status -It will show you details information on instances of HelloDATA, how is the situation for the Portal, is the monitoring running, etc. + +It will show you details information on instances of HelloDATA, how is the situation for the Portal, is the monitoring +running, etc. ![](../images/1068204616.png) #### Data Domains -In Monitoring your data domains you see each system and the link to the native application. You can easily and quickly observer permission, roles and users by different subsystems (1). Click the one you want, and you can choose different levels (2) for each, and see its permissions (3). +In Monitoring your data domains you see each system and the link to the native application. You can easily and quickly +observer permission, roles and users by different subsystems (1). Click the one you want, and you can choose different +levels (2) for each, and see its permissions (3). ![](../images/1068204622.png) ![](../images/1068204620.png) -By clicking on the blue underlined `DBT Docs`, you will be navigated to the native dbt docs. Same is true if you click on a Airflow or Superset instance. +By clicking on the blue underlined `DBT Docs`, you will be navigated to the native dbt docs. Same is true if you click +on a Airflow or Superset instance. + ### DevTools -DevTools are additional tools HelloDATA provides out of the box to e.g. send Mail (Mailbox) or browse files (FileBrowser). +DevTools are additional tools HelloDATA provides out of the box to e.g. send Mail (Mailbox) or browse files ( +FileBrowser). ![](../images/1068204623.png) #### Mailbox -You can check in Mailbox (we use [MailHog](https://github.com/mailhog/MailHog)) what emails have been sending or what accounts are updated.| +You can check in Mailbox (we use[MailHog](https://github.com/mailhog/MailHog)) what emails have been sending or what +accounts are updated.| ![](../images/1068204627.png) #### FileBrowser -Here you can browse all the documentation or code from the git repos as file browser. We use [FileBrowser](https://github.com/filebrowser/filebrowser) here. Please use with care, as some of the folder are system relevant. - -!!! note "Log in" - - Make sure you have the login credentials to log in. Your administrator should be able to provide these to you. - +Here you can browse all the documentation or code from the git repos as file browser. We +use [SFTPGo](https://github.com/drakkan/sftpgo) here. Please use with care, as some of the folder are system relevant. -![](../images/1068204628.png) +![](../images/20250121155015.png) ## More: Know-How - - More help for Superset - - [Superset Documentation](https://superset.apache.org/docs/intro/) + - [Superset Documentation](https://superset.apache.org/docs/intro/) - More help for dbt: - - [dbt Documentation](https://docs.getdbt.com/docs/collaborate/documentation) - - [dbt Developer Hub](https://docs.getdbt.com/) - - More about Airflow - - [Airflow Documentation](https://airflow.apache.org/docs/) - - -Find further important references, know-how, and best practices on [HelloDATA Know-How](https://confluence.bedag.ch/x/4wHXE). + - [dbt Documentation](https://docs.getdbt.com/docs/collaborate/documentation) + - [dbt Developer Hub](https://docs.getdbt.com/) +- More about Airflow + - [Airflow Documentation](https://airflow.apache.org/docs/) +- More about SFTPGo + - [SFTPGo Documentation](https://docs.sftpgo.com/) + +Find further important references, know-how, and best practices +on[HelloDATA Know-How](https://confluence.bedag.ch/x/4wHXE). diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/Dockerfile b/hello-data-sidecars/hello-data-sidecar-sftpgo/Dockerfile new file mode 100644 index 00000000..648740f2 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/Dockerfile @@ -0,0 +1,37 @@ +# +# Copyright © 2024, Kanton Bern +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +FROM eclipse-temurin:17.0.9_9-jre +LABEL MAINTAINER="HelloData Team" + +# add 'app' user with uid 3012 and corresponding group +RUN useradd -d /app -m -s /bin/bash -u 3012 app -U +USER app +WORKDIR app + +COPY target/*.jar /app/app.jar +CMD ["java", "-jar", "/app/app.jar"] diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/pom.xml b/hello-data-sidecars/hello-data-sidecar-sftpgo/pom.xml new file mode 100644 index 00000000..78dd724d --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/pom.xml @@ -0,0 +1,221 @@ + + + 4.0.0 + + + ch.bedag.dap.hellodata + hello-data-spring-boot-starter-parent + develop-SNAPSHOT + ../../hello-data-commons/hello-data-spring-boot-starter-parent/pom.xml + + + hello-data-sidecar-sftpgo + develop-SNAPSHOT + jar + + hello-data-sidecar-sftpgo + + + UTF-8 + 17 + ${java.version} + ${java.version} + ch.bedag.dap.hellodata.sidecars.sftpgo.HDSidecarSftpGo + + + + + ch.bedag.dap.hellodata + hello-data-sidecar-common + ${project.version} + + + ch.bedag.dap.hellodata + hello-data-nats-spring + ${project.version} + + + ch.bedag.dap.hellodata + hello-data-metainfo-model + ${project.version} + + + ch.bedag.dap.hellodata + hello-data-portal-common + ${project.version} + + + + commons-io + commons-io + + + com.google.code.gson + gson + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + jakarta.validation + jakarta.validation-api + + + org.hibernate.validator + hibernate-validator + + + de.codecentric + spring-boot-admin-starter-client + + + + org.springframework.boot + spring-boot-starter-webflux + + + + io.projectreactor.netty + reactor-netty-http + + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + jakarta.annotation + jakarta.annotation-api + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${main.class} + JAR + + + org.projectlombok + lombok + + + + + + + repackage + + + + + + + + + + docker + + false + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + docker-tag-name + post-integration-test + + regex-property + + + docker.tag.name + ${project.version} + + [^A-Za-z0-9_.-] + + + false + + + + + use-latest + post-integration-test + + regex-property + + + docker.tag.name + ${project.version} + develop-SNAPSHOT + latest + false + + + + + + io.fabric8 + docker-maven-plugin + 0.43.4 + + + build-docker-image + post-integration-test + + build + + + + push-docker-image + ${push-docker-image-phase} + + push + + + + + always + true + true + + + ${docker.namespace}/hello-data-sidecar-sftpgo:${docker.tag.name} + + Dockerfile + ${project.basedir} + + + + + + + + + + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/HDSidecarSftpGo.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/HDSidecarSftpGo.java new file mode 100644 index 00000000..7b24900a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/HDSidecarSftpGo.java @@ -0,0 +1,43 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo; + +import ch.bedag.dap.hellodata.commons.nats.annotation.EnableJetStream; +import ch.bedag.dap.hellodata.commons.sidecars.context.HelloDataContextConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.config.S3ConnectionsConfig; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; +import org.springframework.scheduling.annotation.EnableScheduling; + +@EnableJetStream +@EnableScheduling +@SpringBootApplication +@EnableDiscoveryClient +@ConfigurationPropertiesScan +@ComponentScan("ch.bedag.dap.hellodata") +@EnableConfigurationProperties({HelloDataContextConfig.class, S3ConnectionsConfig.class}) +public class HDSidecarSftpGo { + + public static void main(String[] args) { + SpringApplication.run(HDSidecarSftpGo.class, args); + } + + @Bean + public Jackson2ObjectMapperBuilder objectMapperBuilder() { + return new Jackson2ObjectMapperBuilder() { + @Override + public void configure(ObjectMapper objectMapper) { + super.configure(objectMapper); + objectMapper.registerModule(new JavaTimeModule()); + } + }; + } + + +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/AdminsApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/AdminsApi.java new file mode 100644 index 00000000..15a50644 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/AdminsApi.java @@ -0,0 +1,1651 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Admin; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminProfile; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminResetPasswordRequest; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminTOTPConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.GenerateAdminTotpSecret200Response; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.GenerateAdminTotpSecretRequest; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.PwdChange; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.RecoveryCode; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TOTPConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ValidateAdminTotpSecretRequest; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminsApi { + private ApiClient apiClient; + + public AdminsApi() { + this(new ApiClient()); + } + + @Autowired + public AdminsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add admin + * Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param admin The admin parameter + * @return Admin + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addAdminRequestCreation(Admin admin) throws WebClientResponseException { + Object postBody = admin; + // verify the required parameter 'admin' is set + if (admin == null) { + throw new WebClientResponseException("Missing the required parameter 'admin' when calling addAdmin", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add admin + * Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param admin The admin parameter + * @return Admin + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addAdmin(Admin admin) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addAdminRequestCreation(admin).bodyToMono(localVarReturnType); + } + + /** + * Add admin + * Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param admin The admin parameter + * @return ResponseEntity<Admin> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addAdminWithHttpInfo(Admin admin) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addAdminRequestCreation(admin).toEntity(localVarReturnType); + } + + /** + * Add admin + * Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param admin The admin parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addAdminWithResponseSpec(Admin admin) throws WebClientResponseException { + return addAdminRequestCreation(admin); + } + /** + * Send a password reset code by email + * You must set up an SMTP server and the account must have a valid email address, in which case SFTPGo will send a code via email to reset the password. If the specified admin does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing admins + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec adminForgotPasswordRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling adminForgotPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins/{username}/forgot-password", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Send a password reset code by email + * You must set up an SMTP server and the account must have a valid email address, in which case SFTPGo will send a code via email to reset the password. If the specified admin does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing admins + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono adminForgotPassword(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return adminForgotPasswordRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Send a password reset code by email + * You must set up an SMTP server and the account must have a valid email address, in which case SFTPGo will send a code via email to reset the password. If the specified admin does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing admins + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> adminForgotPasswordWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return adminForgotPasswordRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Send a password reset code by email + * You must set up an SMTP server and the account must have a valid email address, in which case SFTPGo will send a code via email to reset the password. If the specified admin does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing admins + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec adminForgotPasswordWithResponseSpec(String username) throws WebClientResponseException { + return adminForgotPasswordRequestCreation(username); + } + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec adminResetPasswordRequestCreation(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + Object postBody = adminResetPasswordRequest; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling adminResetPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'adminResetPasswordRequest' is set + if (adminResetPasswordRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'adminResetPasswordRequest' when calling adminResetPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins/{username}/reset-password", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono adminResetPassword(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return adminResetPasswordRequestCreation(username, adminResetPasswordRequest).bodyToMono(localVarReturnType); + } + + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> adminResetPasswordWithHttpInfo(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return adminResetPasswordRequestCreation(username, adminResetPasswordRequest).toEntity(localVarReturnType); + } + + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec adminResetPasswordWithResponseSpec(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + return adminResetPasswordRequestCreation(username, adminResetPasswordRequest); + } + /** + * Change admin password + * Changes the password for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param pwdChange The pwdChange parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec changeAdminPasswordRequestCreation(PwdChange pwdChange) throws WebClientResponseException { + Object postBody = pwdChange; + // verify the required parameter 'pwdChange' is set + if (pwdChange == null) { + throw new WebClientResponseException("Missing the required parameter 'pwdChange' when calling changeAdminPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/changepwd", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Change admin password + * Changes the password for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param pwdChange The pwdChange parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono changeAdminPassword(PwdChange pwdChange) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return changeAdminPasswordRequestCreation(pwdChange).bodyToMono(localVarReturnType); + } + + /** + * Change admin password + * Changes the password for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param pwdChange The pwdChange parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> changeAdminPasswordWithHttpInfo(PwdChange pwdChange) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return changeAdminPasswordRequestCreation(pwdChange).toEntity(localVarReturnType); + } + + /** + * Change admin password + * Changes the password for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param pwdChange The pwdChange parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec changeAdminPasswordWithResponseSpec(PwdChange pwdChange) throws WebClientResponseException { + return changeAdminPasswordRequestCreation(pwdChange); + } + /** + * Delete admin + * Deletes an existing admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteAdminRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling deleteAdmin", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete admin + * Deletes an existing admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteAdmin(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteAdminRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Delete admin + * Deletes an existing admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteAdminWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteAdminRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Delete admin + * Deletes an existing admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteAdminWithResponseSpec(String username) throws WebClientResponseException { + return deleteAdminRequestCreation(username); + } + /** + * Disable second factor authentication + * Disables second factor authentication for the given admin. This API must be used if the admin loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec disableAdmin2faRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling disableAdmin2fa", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins/{username}/2fa/disable", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Disable second factor authentication + * Disables second factor authentication for the given admin. This API must be used if the admin loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono disableAdmin2fa(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return disableAdmin2faRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Disable second factor authentication + * Disables second factor authentication for the given admin. This API must be used if the admin loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> disableAdmin2faWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return disableAdmin2faRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Disable second factor authentication + * Disables second factor authentication for the given admin. This API must be used if the admin loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec disableAdmin2faWithResponseSpec(String username) throws WebClientResponseException { + return disableAdmin2faRequestCreation(username); + } + /** + * Generate recovery codes + * Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec generateAdminRecoveryCodesRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {}; + return apiClient.invokeAPI("/admin/2fa/recoverycodes", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> generateAdminRecoveryCodes() throws WebClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {}; + return generateAdminRecoveryCodesRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<String>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> generateAdminRecoveryCodesWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {}; + return generateAdminRecoveryCodesRequestCreation().toEntity(localVarReturnType); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec generateAdminRecoveryCodesWithResponseSpec() throws WebClientResponseException { + return generateAdminRecoveryCodesRequestCreation(); + } + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return GenerateAdminTotpSecret200Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec generateAdminTotpSecretRequestCreation(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + Object postBody = generateAdminTotpSecretRequest; + // verify the required parameter 'generateAdminTotpSecretRequest' is set + if (generateAdminTotpSecretRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'generateAdminTotpSecretRequest' when calling generateAdminTotpSecret", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/totp/generate", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return GenerateAdminTotpSecret200Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono generateAdminTotpSecret(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return generateAdminTotpSecretRequestCreation(generateAdminTotpSecretRequest).bodyToMono(localVarReturnType); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return ResponseEntity<GenerateAdminTotpSecret200Response> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> generateAdminTotpSecretWithHttpInfo(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return generateAdminTotpSecretRequestCreation(generateAdminTotpSecretRequest).toEntity(localVarReturnType); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec generateAdminTotpSecretWithResponseSpec(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + return generateAdminTotpSecretRequestCreation(generateAdminTotpSecretRequest); + } + /** + * Find admins by username + * Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return Admin + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getAdminByUsernameRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling getAdminByUsername", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find admins by username + * Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return Admin + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getAdminByUsername(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminByUsernameRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Find admins by username + * Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseEntity<Admin> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getAdminByUsernameWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminByUsernameRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Find admins by username + * Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getAdminByUsernameWithResponseSpec(String username) throws WebClientResponseException { + return getAdminByUsernameRequestCreation(username); + } + /** + * Get admin profile + * Returns the profile for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return AdminProfile + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getAdminProfileRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/profile", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get admin profile + * Returns the profile for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return AdminProfile + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getAdminProfile() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminProfileRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Get admin profile + * Returns the profile for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<AdminProfile> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getAdminProfileWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminProfileRequestCreation().toEntity(localVarReturnType); + } + + /** + * Get admin profile + * Returns the profile for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getAdminProfileWithResponseSpec() throws WebClientResponseException { + return getAdminProfileRequestCreation(); + } + /** + * Get recovery codes + * Returns the recovery codes for the logged in admin. Recovery codes can be used if the admin loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<RecoveryCode> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getAdminRecoveryCodesRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/2fa/recoverycodes", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in admin. Recovery codes can be used if the admin loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<RecoveryCode> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getAdminRecoveryCodes() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminRecoveryCodesRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in admin. Recovery codes can be used if the admin loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<RecoveryCode>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getAdminRecoveryCodesWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminRecoveryCodesRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in admin. Recovery codes can be used if the admin loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getAdminRecoveryCodesWithResponseSpec() throws WebClientResponseException { + return getAdminRecoveryCodesRequestCreation(); + } + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<TOTPConfig> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getAdminTotpConfigsRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/totp/configs", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<TOTPConfig> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getAdminTotpConfigs() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminTotpConfigsRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<TOTPConfig>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getAdminTotpConfigsWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminTotpConfigsRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in admin + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getAdminTotpConfigsWithResponseSpec() throws WebClientResponseException { + return getAdminTotpConfigsRequestCreation(); + } + /** + * Get admins + * Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering admins by username. Default ASC + * @return List<Admin> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getAdminsRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get admins + * Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering admins by username. Default ASC + * @return List<Admin> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getAdmins(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminsRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get admins + * Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering admins by username. Default ASC + * @return ResponseEntity<List<Admin>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getAdminsWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getAdminsRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get admins + * Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering admins by username. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getAdminsWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getAdminsRequestCreation(offset, limit, order); + } + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminTOTPConfig The adminTOTPConfig parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec saveAdminTotpConfigRequestCreation(AdminTOTPConfig adminTOTPConfig) throws WebClientResponseException { + Object postBody = adminTOTPConfig; + // verify the required parameter 'adminTOTPConfig' is set + if (adminTOTPConfig == null) { + throw new WebClientResponseException("Missing the required parameter 'adminTOTPConfig' when calling saveAdminTotpConfig", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/totp/save", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminTOTPConfig The adminTOTPConfig parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono saveAdminTotpConfig(AdminTOTPConfig adminTOTPConfig) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return saveAdminTotpConfigRequestCreation(adminTOTPConfig).bodyToMono(localVarReturnType); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminTOTPConfig The adminTOTPConfig parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> saveAdminTotpConfigWithHttpInfo(AdminTOTPConfig adminTOTPConfig) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return saveAdminTotpConfigRequestCreation(adminTOTPConfig).toEntity(localVarReturnType); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminTOTPConfig The adminTOTPConfig parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec saveAdminTotpConfigWithResponseSpec(AdminTOTPConfig adminTOTPConfig) throws WebClientResponseException { + return saveAdminTotpConfigRequestCreation(adminTOTPConfig); + } + /** + * Update admin + * Updates an existing admin. Recovery codes and TOTP configuration cannot be set/updated using this API: each admin must use the specific APIs. You are not allowed to update the admin impersonated using an API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param admin The admin parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateAdminRequestCreation(String username, Admin admin) throws WebClientResponseException { + Object postBody = admin; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling updateAdmin", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'admin' is set + if (admin == null) { + throw new WebClientResponseException("Missing the required parameter 'admin' when calling updateAdmin", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admins/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update admin + * Updates an existing admin. Recovery codes and TOTP configuration cannot be set/updated using this API: each admin must use the specific APIs. You are not allowed to update the admin impersonated using an API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param admin The admin parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateAdmin(String username, Admin admin) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateAdminRequestCreation(username, admin).bodyToMono(localVarReturnType); + } + + /** + * Update admin + * Updates an existing admin. Recovery codes and TOTP configuration cannot be set/updated using this API: each admin must use the specific APIs. You are not allowed to update the admin impersonated using an API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param admin The admin parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateAdminWithHttpInfo(String username, Admin admin) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateAdminRequestCreation(username, admin).toEntity(localVarReturnType); + } + + /** + * Update admin + * Updates an existing admin. Recovery codes and TOTP configuration cannot be set/updated using this API: each admin must use the specific APIs. You are not allowed to update the admin impersonated using an API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the admin username + * @param admin The admin parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateAdminWithResponseSpec(String username, Admin admin) throws WebClientResponseException { + return updateAdminRequestCreation(username, admin); + } + /** + * Update admin profile + * Allows to update the profile for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminProfile The adminProfile parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateAdminProfileRequestCreation(AdminProfile adminProfile) throws WebClientResponseException { + Object postBody = adminProfile; + // verify the required parameter 'adminProfile' is set + if (adminProfile == null) { + throw new WebClientResponseException("Missing the required parameter 'adminProfile' when calling updateAdminProfile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/profile", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update admin profile + * Allows to update the profile for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminProfile The adminProfile parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateAdminProfile(AdminProfile adminProfile) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateAdminProfileRequestCreation(adminProfile).bodyToMono(localVarReturnType); + } + + /** + * Update admin profile + * Allows to update the profile for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminProfile The adminProfile parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateAdminProfileWithHttpInfo(AdminProfile adminProfile) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateAdminProfileRequestCreation(adminProfile).toEntity(localVarReturnType); + } + + /** + * Update admin profile + * Allows to update the profile for the logged in admin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param adminProfile The adminProfile parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateAdminProfileWithResponseSpec(AdminProfile adminProfile) throws WebClientResponseException { + return updateAdminProfileRequestCreation(adminProfile); + } + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec validateAdminTotpSecretRequestCreation(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + Object postBody = validateAdminTotpSecretRequest; + // verify the required parameter 'validateAdminTotpSecretRequest' is set + if (validateAdminTotpSecretRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'validateAdminTotpSecretRequest' when calling validateAdminTotpSecret", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/admin/totp/validate", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono validateAdminTotpSecret(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return validateAdminTotpSecretRequestCreation(validateAdminTotpSecretRequest).bodyToMono(localVarReturnType); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> validateAdminTotpSecretWithHttpInfo(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return validateAdminTotpSecretRequestCreation(validateAdminTotpSecretRequest).toEntity(localVarReturnType); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec validateAdminTotpSecretWithResponseSpec(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + return validateAdminTotpSecretRequestCreation(validateAdminTotpSecretRequest); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ApiKeysApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ApiKeysApi.java new file mode 100644 index 00000000..36b623ec --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ApiKeysApi.java @@ -0,0 +1,549 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.APIKey; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AddApiKey201Response; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ApiKeysApi { + private ApiClient apiClient; + + public ApiKeysApi() { + this(new ApiClient()); + } + + @Autowired + public ApiKeysApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add API key + * Adds a new API key + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param apIKey The apIKey parameter + * @return AddApiKey201Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addApiKeyRequestCreation(APIKey apIKey) throws WebClientResponseException { + Object postBody = apIKey; + // verify the required parameter 'apIKey' is set + if (apIKey == null) { + throw new WebClientResponseException("Missing the required parameter 'apIKey' when calling addApiKey", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/apikeys", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add API key + * Adds a new API key + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param apIKey The apIKey parameter + * @return AddApiKey201Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addApiKey(APIKey apIKey) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addApiKeyRequestCreation(apIKey).bodyToMono(localVarReturnType); + } + + /** + * Add API key + * Adds a new API key + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param apIKey The apIKey parameter + * @return ResponseEntity<AddApiKey201Response> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addApiKeyWithHttpInfo(APIKey apIKey) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addApiKeyRequestCreation(apIKey).toEntity(localVarReturnType); + } + + /** + * Add API key + * Adds a new API key + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param apIKey The apIKey parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addApiKeyWithResponseSpec(APIKey apIKey) throws WebClientResponseException { + return addApiKeyRequestCreation(apIKey); + } + /** + * Delete API key + * Deletes an existing API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteApiKeyRequestCreation(String id) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling deleteApiKey", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/apikeys/{id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete API key + * Deletes an existing API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteApiKey(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteApiKeyRequestCreation(id).bodyToMono(localVarReturnType); + } + + /** + * Delete API key + * Deletes an existing API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteApiKeyWithHttpInfo(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteApiKeyRequestCreation(id).toEntity(localVarReturnType); + } + + /** + * Delete API key + * Deletes an existing API key + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteApiKeyWithResponseSpec(String id) throws WebClientResponseException { + return deleteApiKeyRequestCreation(id); + } + /** + * Find API key by id + * Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return APIKey + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getApiKeyByIdRequestCreation(String id) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling getApiKeyById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/apikeys/{id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find API key by id + * Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return APIKey + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getApiKeyById(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getApiKeyByIdRequestCreation(id).bodyToMono(localVarReturnType); + } + + /** + * Find API key by id + * Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return ResponseEntity<APIKey> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getApiKeyByIdWithHttpInfo(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getApiKeyByIdRequestCreation(id).toEntity(localVarReturnType); + } + + /** + * Find API key by id + * Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getApiKeyByIdWithResponseSpec(String id) throws WebClientResponseException { + return getApiKeyByIdRequestCreation(id); + } + /** + * Get API keys + * Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering API keys by id. Default ASC + * @return List<APIKey> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getApiKeysRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/apikeys", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get API keys + * Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering API keys by id. Default ASC + * @return List<APIKey> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getApiKeys(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getApiKeysRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get API keys + * Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering API keys by id. Default ASC + * @return ResponseEntity<List<APIKey>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getApiKeysWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getApiKeysRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get API keys + * Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering API keys by id. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getApiKeysWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getApiKeysRequestCreation(offset, limit, order); + } + /** + * Update API key + * Updates an existing API key. You cannot update the key itself, the creation date and the last use + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @param apIKey The apIKey parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateApiKeyRequestCreation(String id, APIKey apIKey) throws WebClientResponseException { + Object postBody = apIKey; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling updateApiKey", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'apIKey' is set + if (apIKey == null) { + throw new WebClientResponseException("Missing the required parameter 'apIKey' when calling updateApiKey", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/apikeys/{id}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update API key + * Updates an existing API key. You cannot update the key itself, the creation date and the last use + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @param apIKey The apIKey parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateApiKey(String id, APIKey apIKey) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateApiKeyRequestCreation(id, apIKey).bodyToMono(localVarReturnType); + } + + /** + * Update API key + * Updates an existing API key. You cannot update the key itself, the creation date and the last use + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @param apIKey The apIKey parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateApiKeyWithHttpInfo(String id, APIKey apIKey) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateApiKeyRequestCreation(id, apIKey).toEntity(localVarReturnType); + } + + /** + * Update API key + * Updates an existing API key. You cannot update the key itself, the creation date and the last use + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id the key id + * @param apIKey The apIKey parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateApiKeyWithResponseSpec(String id, APIKey apIKey) throws WebClientResponseException { + return updateApiKeyRequestCreation(id, apIKey); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ConnectionsApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ConnectionsApi.java new file mode 100644 index 00000000..1e793bf4 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/ConnectionsApi.java @@ -0,0 +1,224 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ConnectionStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ConnectionsApi { + private ApiClient apiClient; + + public ConnectionsApi() { + this(new ApiClient()); + } + + @Autowired + public ConnectionsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Close connection + * Terminates an active connection + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param connectionID ID of the connection to close + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec closeConnectionRequestCreation(String connectionID) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'connectionID' is set + if (connectionID == null) { + throw new WebClientResponseException("Missing the required parameter 'connectionID' when calling closeConnection", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("connectionID", connectionID); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/connections/{connectionID}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Close connection + * Terminates an active connection + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param connectionID ID of the connection to close + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono closeConnection(String connectionID) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return closeConnectionRequestCreation(connectionID).bodyToMono(localVarReturnType); + } + + /** + * Close connection + * Terminates an active connection + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param connectionID ID of the connection to close + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> closeConnectionWithHttpInfo(String connectionID) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return closeConnectionRequestCreation(connectionID).toEntity(localVarReturnType); + } + + /** + * Close connection + * Terminates an active connection + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param connectionID ID of the connection to close + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec closeConnectionWithResponseSpec(String connectionID) throws WebClientResponseException { + return closeConnectionRequestCreation(connectionID); + } + /** + * Get connections details + * Returns the active users and info about their current uploads/downloads + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<ConnectionStatus> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getConnectionsRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/connections", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get connections details + * Returns the active users and info about their current uploads/downloads + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<ConnectionStatus> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getConnections() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getConnectionsRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get connections details + * Returns the active users and info about their current uploads/downloads + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<ConnectionStatus>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getConnectionsWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getConnectionsRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get connections details + * Returns the active users and info about their current uploads/downloads + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getConnectionsWithResponseSpec() throws WebClientResponseException { + return getConnectionsRequestCreation(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DataRetentionApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DataRetentionApi.java new file mode 100644 index 00000000..28cba272 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DataRetentionApi.java @@ -0,0 +1,250 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FolderRetention; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.RetentionCheck; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.RetentionCheckNotification; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class DataRetentionApi { + private ApiClient apiClient; + + public DataRetentionApi() { + this(new ApiClient()); + } + + @Autowired + public DataRetentionApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get retention checks + * Returns the active retention checks + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<RetentionCheck> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUsersRetentionChecksRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/retention/users/checks", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get retention checks + * Returns the active retention checks + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<RetentionCheck> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUsersRetentionChecks() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUsersRetentionChecksRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get retention checks + * Returns the active retention checks + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<RetentionCheck>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUsersRetentionChecksWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUsersRetentionChecksRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get retention checks + * Returns the active retention checks + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUsersRetentionChecksWithResponseSpec() throws WebClientResponseException { + return getUsersRetentionChecksRequestCreation(); + } + /** + * Start a retention check + * Starts a new retention check for the given user. If a retention check for this user is already active a 409 status code is returned + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param folderRetention Defines virtual paths to check and their retention time in hours + * @param notifications specify how to notify results + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec startUserRetentionCheckRequestCreation(String username, List folderRetention, List notifications) throws WebClientResponseException { + Object postBody = folderRetention; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling startUserRetentionCheck", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'folderRetention' is set + if (folderRetention == null) { + throw new WebClientResponseException("Missing the required parameter 'folderRetention' when calling startUserRetentionCheck", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "notifications", notifications)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/retention/users/{username}/check", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Start a retention check + * Starts a new retention check for the given user. If a retention check for this user is already active a 409 status code is returned + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param folderRetention Defines virtual paths to check and their retention time in hours + * @param notifications specify how to notify results + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono startUserRetentionCheck(String username, List folderRetention, List notifications) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return startUserRetentionCheckRequestCreation(username, folderRetention, notifications).bodyToMono(localVarReturnType); + } + + /** + * Start a retention check + * Starts a new retention check for the given user. If a retention check for this user is already active a 409 status code is returned + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param folderRetention Defines virtual paths to check and their retention time in hours + * @param notifications specify how to notify results + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> startUserRetentionCheckWithHttpInfo(String username, List folderRetention, List notifications) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return startUserRetentionCheckRequestCreation(username, folderRetention, notifications).toEntity(localVarReturnType); + } + + /** + * Start a retention check + * Starts a new retention check for the given user. If a retention check for this user is already active a 409 status code is returned + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param folderRetention Defines virtual paths to check and their retention time in hours + * @param notifications specify how to notify results + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec startUserRetentionCheckWithResponseSpec(String username, List folderRetention, List notifications) throws WebClientResponseException { + return startUserRetentionCheckRequestCreation(username, folderRetention, notifications); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DefenderApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DefenderApi.java new file mode 100644 index 00000000..d5ea4829 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/DefenderApi.java @@ -0,0 +1,322 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.DefenderEntry; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class DefenderApi { + private ApiClient apiClient; + + public DefenderApi() { + this(new ApiClient()); + } + + @Autowired + public DefenderApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Removes a host from the defender lists + * Unbans the specified host or clears its violations + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteDefenderHostByIdRequestCreation(String id) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling deleteDefenderHostById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/defender/hosts/{id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Removes a host from the defender lists + * Unbans the specified host or clears its violations + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteDefenderHostById(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteDefenderHostByIdRequestCreation(id).bodyToMono(localVarReturnType); + } + + /** + * Removes a host from the defender lists + * Unbans the specified host or clears its violations + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteDefenderHostByIdWithHttpInfo(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteDefenderHostByIdRequestCreation(id).toEntity(localVarReturnType); + } + + /** + * Removes a host from the defender lists + * Unbans the specified host or clears its violations + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteDefenderHostByIdWithResponseSpec(String id) throws WebClientResponseException { + return deleteDefenderHostByIdRequestCreation(id); + } + /** + * Get host by id + * Returns the host with the given id, if it exists + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return DefenderEntry + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getDefenderHostByIdRequestCreation(String id) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling getDefenderHostById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/defender/hosts/{id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get host by id + * Returns the host with the given id, if it exists + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return DefenderEntry + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getDefenderHostById(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getDefenderHostByIdRequestCreation(id).bodyToMono(localVarReturnType); + } + + /** + * Get host by id + * Returns the host with the given id, if it exists + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return ResponseEntity<DefenderEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getDefenderHostByIdWithHttpInfo(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getDefenderHostByIdRequestCreation(id).toEntity(localVarReturnType); + } + + /** + * Get host by id + * Returns the host with the given id, if it exists + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param id host id + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getDefenderHostByIdWithResponseSpec(String id) throws WebClientResponseException { + return getDefenderHostByIdRequestCreation(id); + } + /** + * Get hosts + * Returns hosts that are banned or for which some violations have been detected + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<DefenderEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getDefenderHostsRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/defender/hosts", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get hosts + * Returns hosts that are banned or for which some violations have been detected + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<DefenderEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getDefenderHosts() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getDefenderHostsRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get hosts + * Returns hosts that are banned or for which some violations have been detected + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<DefenderEntry>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getDefenderHostsWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getDefenderHostsRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get hosts + * Returns hosts that are banned or for which some violations have been detected + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getDefenderHostsWithResponseSpec() throws WebClientResponseException { + return getDefenderHostsRequestCreation(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventManagerApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventManagerApi.java new file mode 100644 index 00000000..6bd56462 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventManagerApi.java @@ -0,0 +1,1170 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseEventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventRule; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventRuleMinimal; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventManagerApi { + private ApiClient apiClient; + + public EventManagerApi() { + this(new ApiClient()); + } + + @Autowired + public EventManagerApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add event action + * Adds a new event actions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseEventAction The baseEventAction parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseEventAction + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addEventActionRequestCreation(BaseEventAction baseEventAction, Integer confidentialData) throws WebClientResponseException { + Object postBody = baseEventAction; + // verify the required parameter 'baseEventAction' is set + if (baseEventAction == null) { + throw new WebClientResponseException("Missing the required parameter 'baseEventAction' when calling addEventAction", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventactions", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add event action + * Adds a new event actions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseEventAction The baseEventAction parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseEventAction + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addEventAction(BaseEventAction baseEventAction, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addEventActionRequestCreation(baseEventAction, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Add event action + * Adds a new event actions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseEventAction The baseEventAction parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<BaseEventAction> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addEventActionWithHttpInfo(BaseEventAction baseEventAction, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addEventActionRequestCreation(baseEventAction, confidentialData).toEntity(localVarReturnType); + } + + /** + * Add event action + * Adds a new event actions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseEventAction The baseEventAction parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addEventActionWithResponseSpec(BaseEventAction baseEventAction, Integer confidentialData) throws WebClientResponseException { + return addEventActionRequestCreation(baseEventAction, confidentialData); + } + /** + * Add event rule + * Adds a new event rule + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param eventRuleMinimal The eventRuleMinimal parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return EventRule + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addEventRuleRequestCreation(EventRuleMinimal eventRuleMinimal, Integer confidentialData) throws WebClientResponseException { + Object postBody = eventRuleMinimal; + // verify the required parameter 'eventRuleMinimal' is set + if (eventRuleMinimal == null) { + throw new WebClientResponseException("Missing the required parameter 'eventRuleMinimal' when calling addEventRule", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventrules", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add event rule + * Adds a new event rule + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param eventRuleMinimal The eventRuleMinimal parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return EventRule + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addEventRule(EventRuleMinimal eventRuleMinimal, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addEventRuleRequestCreation(eventRuleMinimal, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Add event rule + * Adds a new event rule + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param eventRuleMinimal The eventRuleMinimal parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<EventRule> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addEventRuleWithHttpInfo(EventRuleMinimal eventRuleMinimal, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addEventRuleRequestCreation(eventRuleMinimal, confidentialData).toEntity(localVarReturnType); + } + + /** + * Add event rule + * Adds a new event rule + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param eventRuleMinimal The eventRuleMinimal parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addEventRuleWithResponseSpec(EventRuleMinimal eventRuleMinimal, Integer confidentialData) throws WebClientResponseException { + return addEventRuleRequestCreation(eventRuleMinimal, confidentialData); + } + /** + * Delete event action + * Deletes an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteEventActionRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling deleteEventAction", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventactions/{name}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete event action + * Deletes an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteEventAction(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteEventActionRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Delete event action + * Deletes an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteEventActionWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteEventActionRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Delete event action + * Deletes an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteEventActionWithResponseSpec(String name) throws WebClientResponseException { + return deleteEventActionRequestCreation(name); + } + /** + * Delete event rule + * Deletes an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteEventRuleRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling deleteEventRule", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventrules/{name}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete event rule + * Deletes an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteEventRule(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteEventRuleRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Delete event rule + * Deletes an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteEventRuleWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteEventRuleRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Delete event rule + * Deletes an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteEventRuleWithResponseSpec(String name) throws WebClientResponseException { + return deleteEventRuleRequestCreation(name); + } + /** + * Find event actions by name + * Returns the event action with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseEventAction + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getEventActionByNameRequestCreation(String name, Integer confidentialData) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling getEventActionByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventactions/{name}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find event actions by name + * Returns the event action with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseEventAction + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getEventActionByName(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventActionByNameRequestCreation(name, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Find event actions by name + * Returns the event action with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<BaseEventAction> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getEventActionByNameWithHttpInfo(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventActionByNameRequestCreation(name, confidentialData).toEntity(localVarReturnType); + } + + /** + * Find event actions by name + * Returns the event action with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getEventActionByNameWithResponseSpec(String name, Integer confidentialData) throws WebClientResponseException { + return getEventActionByNameRequestCreation(name, confidentialData); + } + /** + * Get event actions + * Returns an array with one or more event actions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering actions by name. Default ASC + * @return List<BaseEventAction> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getEventActonsRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventactions", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get event actions + * Returns an array with one or more event actions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering actions by name. Default ASC + * @return List<BaseEventAction> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getEventActons(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventActonsRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get event actions + * Returns an array with one or more event actions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering actions by name. Default ASC + * @return ResponseEntity<List<BaseEventAction>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getEventActonsWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventActonsRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get event actions + * Returns an array with one or more event actions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering actions by name. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getEventActonsWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getEventActonsRequestCreation(offset, limit, order); + } + /** + * Find event rules by name + * Returns the event rule with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return EventRule + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getEventRileByNameRequestCreation(String name, Integer confidentialData) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling getEventRileByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventrules/{name}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find event rules by name + * Returns the event rule with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return EventRule + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getEventRileByName(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventRileByNameRequestCreation(name, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Find event rules by name + * Returns the event rule with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<EventRule> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getEventRileByNameWithHttpInfo(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventRileByNameRequestCreation(name, confidentialData).toEntity(localVarReturnType); + } + + /** + * Find event rules by name + * Returns the event rule with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getEventRileByNameWithResponseSpec(String name, Integer confidentialData) throws WebClientResponseException { + return getEventRileByNameRequestCreation(name, confidentialData); + } + /** + * Get event rules + * Returns an array with one or more event rules + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering rules by name. Default ASC + * @return List<EventRule> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getEventRulesRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventrules", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get event rules + * Returns an array with one or more event rules + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering rules by name. Default ASC + * @return List<EventRule> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getEventRules(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventRulesRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get event rules + * Returns an array with one or more event rules + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering rules by name. Default ASC + * @return ResponseEntity<List<EventRule>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getEventRulesWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getEventRulesRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get event rules + * Returns an array with one or more event rules + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering rules by name. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getEventRulesWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getEventRulesRequestCreation(offset, limit, order); + } + /** + * Run an on-demand event rule + * The rule's actions will run in background. SFTPGo will not monitor any concurrency and such. If you want to be notified at the end of the execution please add an appropriate action + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name on-demand rule name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec runEventRuleRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling runEventRule", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventrules/run/{name}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Run an on-demand event rule + * The rule's actions will run in background. SFTPGo will not monitor any concurrency and such. If you want to be notified at the end of the execution please add an appropriate action + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name on-demand rule name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono runEventRule(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return runEventRuleRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Run an on-demand event rule + * The rule's actions will run in background. SFTPGo will not monitor any concurrency and such. If you want to be notified at the end of the execution please add an appropriate action + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name on-demand rule name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> runEventRuleWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return runEventRuleRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Run an on-demand event rule + * The rule's actions will run in background. SFTPGo will not monitor any concurrency and such. If you want to be notified at the end of the execution please add an appropriate action + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name on-demand rule name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec runEventRuleWithResponseSpec(String name) throws WebClientResponseException { + return runEventRuleRequestCreation(name); + } + /** + * Update event action + * Updates an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param baseEventAction The baseEventAction parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateEventActionRequestCreation(String name, BaseEventAction baseEventAction) throws WebClientResponseException { + Object postBody = baseEventAction; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling updateEventAction", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'baseEventAction' is set + if (baseEventAction == null) { + throw new WebClientResponseException("Missing the required parameter 'baseEventAction' when calling updateEventAction", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventactions/{name}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update event action + * Updates an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param baseEventAction The baseEventAction parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateEventAction(String name, BaseEventAction baseEventAction) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateEventActionRequestCreation(name, baseEventAction).bodyToMono(localVarReturnType); + } + + /** + * Update event action + * Updates an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param baseEventAction The baseEventAction parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateEventActionWithHttpInfo(String name, BaseEventAction baseEventAction) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateEventActionRequestCreation(name, baseEventAction).toEntity(localVarReturnType); + } + + /** + * Update event action + * Updates an existing event action + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name action name + * @param baseEventAction The baseEventAction parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateEventActionWithResponseSpec(String name, BaseEventAction baseEventAction) throws WebClientResponseException { + return updateEventActionRequestCreation(name, baseEventAction); + } + /** + * Update event rule + * Updates an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param eventRuleMinimal The eventRuleMinimal parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateEventRuleRequestCreation(String name, EventRuleMinimal eventRuleMinimal) throws WebClientResponseException { + Object postBody = eventRuleMinimal; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling updateEventRule", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'eventRuleMinimal' is set + if (eventRuleMinimal == null) { + throw new WebClientResponseException("Missing the required parameter 'eventRuleMinimal' when calling updateEventRule", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/eventrules/{name}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update event rule + * Updates an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param eventRuleMinimal The eventRuleMinimal parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateEventRule(String name, EventRuleMinimal eventRuleMinimal) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateEventRuleRequestCreation(name, eventRuleMinimal).bodyToMono(localVarReturnType); + } + + /** + * Update event rule + * Updates an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param eventRuleMinimal The eventRuleMinimal parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateEventRuleWithHttpInfo(String name, EventRuleMinimal eventRuleMinimal) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateEventRuleRequestCreation(name, eventRuleMinimal).toEntity(localVarReturnType); + } + + /** + * Update event rule + * Updates an existing event rule + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name rule name + * @param eventRuleMinimal The eventRuleMinimal parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateEventRuleWithResponseSpec(String name, EventRuleMinimal eventRuleMinimal) throws WebClientResponseException { + return updateEventRuleRequestCreation(name, eventRuleMinimal); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventsApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventsApi.java new file mode 100644 index 00000000..ec626489 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/EventsApi.java @@ -0,0 +1,529 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsEvent; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsEventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsEventStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsProviders; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.LogEvent; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.LogEventType; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ProviderEvent; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ProviderEventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ProviderEventObjectType; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventsApi { + private ApiClient apiClient; + + public EventsApi() { + this(new ApiClient()); + } + + @Autowired + public EventsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get filesystem events + * Returns an array with one or more filesystem events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param sshCmd the event SSH command must be the same as the one specified. Empty or missing means omit this filter + * @param fsProvider the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter + * @param bucket the bucket must be the same as the one specified. Empty or missing means omit this filter + * @param endpoint the endpoint must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param statuses the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return List<FsEvent> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getFsEventsRequestCreation(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String sshCmd, FsProviders fsProvider, String bucket, String endpoint, List protocols, List statuses, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "start_timestamp", startTimestamp)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "end_timestamp", endTimestamp)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "actions", actions)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "ip", ip)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "ssh_cmd", sshCmd)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "fs_provider", fsProvider)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "bucket", bucket)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "endpoint", endpoint)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "protocols", protocols)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "statuses", statuses)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "instance_ids", instanceIds)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "from_id", fromId)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "role", role)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "csv_export", csvExport)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/events/fs", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get filesystem events + * Returns an array with one or more filesystem events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param sshCmd the event SSH command must be the same as the one specified. Empty or missing means omit this filter + * @param fsProvider the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter + * @param bucket the bucket must be the same as the one specified. Empty or missing means omit this filter + * @param endpoint the endpoint must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param statuses the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return List<FsEvent> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getFsEvents(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String sshCmd, FsProviders fsProvider, String bucket, String endpoint, List protocols, List statuses, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFsEventsRequestCreation(startTimestamp, endTimestamp, actions, username, ip, sshCmd, fsProvider, bucket, endpoint, protocols, statuses, instanceIds, fromId, role, csvExport, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get filesystem events + * Returns an array with one or more filesystem events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param sshCmd the event SSH command must be the same as the one specified. Empty or missing means omit this filter + * @param fsProvider the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter + * @param bucket the bucket must be the same as the one specified. Empty or missing means omit this filter + * @param endpoint the endpoint must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param statuses the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return ResponseEntity<List<FsEvent>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getFsEventsWithHttpInfo(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String sshCmd, FsProviders fsProvider, String bucket, String endpoint, List protocols, List statuses, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFsEventsRequestCreation(startTimestamp, endTimestamp, actions, username, ip, sshCmd, fsProvider, bucket, endpoint, protocols, statuses, instanceIds, fromId, role, csvExport, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get filesystem events + * Returns an array with one or more filesystem events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param sshCmd the event SSH command must be the same as the one specified. Empty or missing means omit this filter + * @param fsProvider the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter + * @param bucket the bucket must be the same as the one specified. Empty or missing means omit this filter + * @param endpoint the endpoint must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param statuses the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getFsEventsWithResponseSpec(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String sshCmd, FsProviders fsProvider, String bucket, String endpoint, List protocols, List statuses, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + return getFsEventsRequestCreation(startTimestamp, endTimestamp, actions, username, ip, sshCmd, fsProvider, bucket, endpoint, protocols, statuses, instanceIds, fromId, role, csvExport, limit, order); + } + /** + * Get log events + * Returns an array with one or more log events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param events the log events must be included among those specified. Empty or missing means omit this filter. Events must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return List<LogEvent> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getLogEventsRequestCreation(Long startTimestamp, Long endTimestamp, List events, String username, String ip, List protocols, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "start_timestamp", startTimestamp)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "end_timestamp", endTimestamp)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "events", events)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "ip", ip)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "protocols", protocols)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "instance_ids", instanceIds)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "from_id", fromId)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "role", role)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "csv_export", csvExport)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/events/log", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get log events + * Returns an array with one or more log events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param events the log events must be included among those specified. Empty or missing means omit this filter. Events must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return List<LogEvent> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getLogEvents(Long startTimestamp, Long endTimestamp, List events, String username, String ip, List protocols, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getLogEventsRequestCreation(startTimestamp, endTimestamp, events, username, ip, protocols, instanceIds, fromId, role, csvExport, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get log events + * Returns an array with one or more log events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param events the log events must be included among those specified. Empty or missing means omit this filter. Events must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return ResponseEntity<List<LogEvent>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getLogEventsWithHttpInfo(Long startTimestamp, Long endTimestamp, List events, String username, String ip, List protocols, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getLogEventsRequestCreation(startTimestamp, endTimestamp, events, username, ip, protocols, instanceIds, fromId, role, csvExport, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get log events + * Returns an array with one or more log events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param events the log events must be included among those specified. Empty or missing means omit this filter. Events must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param protocols the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role User role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getLogEventsWithResponseSpec(Long startTimestamp, Long endTimestamp, List events, String username, String ip, List protocols, List instanceIds, String fromId, String role, Boolean csvExport, Integer limit, String order) throws WebClientResponseException { + return getLogEventsRequestCreation(startTimestamp, endTimestamp, events, username, ip, protocols, instanceIds, fromId, role, csvExport, limit, order); + } + /** + * Get provider events + * Returns an array with one or more provider events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param objectName the event object name must be the same as the one specified. Empty or missing means omit this filter + * @param objectTypes the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role Admin role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param omitObjectData If enabled, returned events will not contain the `object_data` field + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return List<ProviderEvent> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getProviderEventsRequestCreation(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String objectName, List objectTypes, List instanceIds, String fromId, String role, Boolean csvExport, Boolean omitObjectData, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "start_timestamp", startTimestamp)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "end_timestamp", endTimestamp)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "actions", actions)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "ip", ip)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "object_name", objectName)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "object_types", objectTypes)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "instance_ids", instanceIds)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "from_id", fromId)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "role", role)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "csv_export", csvExport)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "omit_object_data", omitObjectData)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json", "text/csv" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/events/provider", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get provider events + * Returns an array with one or more provider events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param objectName the event object name must be the same as the one specified. Empty or missing means omit this filter + * @param objectTypes the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role Admin role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param omitObjectData If enabled, returned events will not contain the `object_data` field + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return List<ProviderEvent> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getProviderEvents(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String objectName, List objectTypes, List instanceIds, String fromId, String role, Boolean csvExport, Boolean omitObjectData, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getProviderEventsRequestCreation(startTimestamp, endTimestamp, actions, username, ip, objectName, objectTypes, instanceIds, fromId, role, csvExport, omitObjectData, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get provider events + * Returns an array with one or more provider events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param objectName the event object name must be the same as the one specified. Empty or missing means omit this filter + * @param objectTypes the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role Admin role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param omitObjectData If enabled, returned events will not contain the `object_data` field + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return ResponseEntity<List<ProviderEvent>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getProviderEventsWithHttpInfo(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String objectName, List objectTypes, List instanceIds, String fromId, String role, Boolean csvExport, Boolean omitObjectData, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getProviderEventsRequestCreation(startTimestamp, endTimestamp, actions, username, ip, objectName, objectTypes, instanceIds, fromId, role, csvExport, omitObjectData, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get provider events + * Returns an array with one or more provider events applying the specified filters. This API is only available if you configure an \"eventsearcher\" plugin + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param startTimestamp the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter + * @param endTimestamp the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter + * @param actions the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated + * @param username the event username must be the same as the one specified. Empty or missing means omit this filter + * @param ip the event IP must be the same as the one specified. Empty or missing means omit this filter + * @param objectName the event object name must be the same as the one specified. Empty or missing means omit this filter + * @param objectTypes the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param instanceIds the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated + * @param fromId the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter. + * @param role Admin role. Empty or missing means omit this filter. Ignored if the admin has a role + * @param csvExport If enabled, events are exported as a CSV file + * @param omitObjectData If enabled, returned events will not contain the `object_data` field + * @param limit The maximum number of items to return. Max value is 1000, default is 100 + * @param order Ordering events by timestamp. Default DESC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getProviderEventsWithResponseSpec(Long startTimestamp, Long endTimestamp, List actions, String username, String ip, String objectName, List objectTypes, List instanceIds, String fromId, String role, Boolean csvExport, Boolean omitObjectData, Integer limit, String order) throws WebClientResponseException { + return getProviderEventsRequestCreation(startTimestamp, endTimestamp, actions, username, ip, objectName, objectTypes, instanceIds, fromId, role, csvExport, omitObjectData, limit, order); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/FoldersApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/FoldersApi.java new file mode 100644 index 00000000..5cba63ac --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/FoldersApi.java @@ -0,0 +1,560 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseVirtualFolder; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FoldersApi { + private ApiClient apiClient; + + public FoldersApi() { + this(new ApiClient()); + } + + @Autowired + public FoldersApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add folder + * Adds a new folder. A quota scan is required to update the used files/size + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseVirtualFolder The baseVirtualFolder parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseVirtualFolder + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addFolderRequestCreation(BaseVirtualFolder baseVirtualFolder, Integer confidentialData) throws WebClientResponseException { + Object postBody = baseVirtualFolder; + // verify the required parameter 'baseVirtualFolder' is set + if (baseVirtualFolder == null) { + throw new WebClientResponseException("Missing the required parameter 'baseVirtualFolder' when calling addFolder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/folders", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add folder + * Adds a new folder. A quota scan is required to update the used files/size + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseVirtualFolder The baseVirtualFolder parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseVirtualFolder + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addFolder(BaseVirtualFolder baseVirtualFolder, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addFolderRequestCreation(baseVirtualFolder, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Add folder + * Adds a new folder. A quota scan is required to update the used files/size + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseVirtualFolder The baseVirtualFolder parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<BaseVirtualFolder> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addFolderWithHttpInfo(BaseVirtualFolder baseVirtualFolder, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addFolderRequestCreation(baseVirtualFolder, confidentialData).toEntity(localVarReturnType); + } + + /** + * Add folder + * Adds a new folder. A quota scan is required to update the used files/size + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param baseVirtualFolder The baseVirtualFolder parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addFolderWithResponseSpec(BaseVirtualFolder baseVirtualFolder, Integer confidentialData) throws WebClientResponseException { + return addFolderRequestCreation(baseVirtualFolder, confidentialData); + } + /** + * Delete folder + * Deletes an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteFolderRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling deleteFolder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/folders/{name}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete folder + * Deletes an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteFolder(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteFolderRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Delete folder + * Deletes an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteFolderWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteFolderRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Delete folder + * Deletes an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteFolderWithResponseSpec(String name) throws WebClientResponseException { + return deleteFolderRequestCreation(name); + } + /** + * Find folders by name + * Returns the folder with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseVirtualFolder + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getFolderByNameRequestCreation(String name, Integer confidentialData) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling getFolderByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/folders/{name}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find folders by name + * Returns the folder with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return BaseVirtualFolder + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getFolderByName(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFolderByNameRequestCreation(name, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Find folders by name + * Returns the folder with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<BaseVirtualFolder> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getFolderByNameWithHttpInfo(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFolderByNameRequestCreation(name, confidentialData).toEntity(localVarReturnType); + } + + /** + * Find folders by name + * Returns the folder with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getFolderByNameWithResponseSpec(String name, Integer confidentialData) throws WebClientResponseException { + return getFolderByNameRequestCreation(name, confidentialData); + } + /** + * Get folders + * Returns an array with one or more folders + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering folders by name. Default ASC + * @return List<BaseVirtualFolder> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getFoldersRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/folders", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get folders + * Returns an array with one or more folders + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering folders by name. Default ASC + * @return List<BaseVirtualFolder> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getFolders(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFoldersRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get folders + * Returns an array with one or more folders + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering folders by name. Default ASC + * @return ResponseEntity<List<BaseVirtualFolder>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getFoldersWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFoldersRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get folders + * Returns an array with one or more folders + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering folders by name. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getFoldersWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getFoldersRequestCreation(offset, limit, order); + } + /** + * Update folder + * Updates an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param baseVirtualFolder The baseVirtualFolder parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateFolderRequestCreation(String name, BaseVirtualFolder baseVirtualFolder) throws WebClientResponseException { + Object postBody = baseVirtualFolder; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling updateFolder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'baseVirtualFolder' is set + if (baseVirtualFolder == null) { + throw new WebClientResponseException("Missing the required parameter 'baseVirtualFolder' when calling updateFolder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/folders/{name}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update folder + * Updates an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param baseVirtualFolder The baseVirtualFolder parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateFolder(String name, BaseVirtualFolder baseVirtualFolder) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateFolderRequestCreation(name, baseVirtualFolder).bodyToMono(localVarReturnType); + } + + /** + * Update folder + * Updates an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param baseVirtualFolder The baseVirtualFolder parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateFolderWithHttpInfo(String name, BaseVirtualFolder baseVirtualFolder) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateFolderRequestCreation(name, baseVirtualFolder).toEntity(localVarReturnType); + } + + /** + * Update folder + * Updates an existing folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param baseVirtualFolder The baseVirtualFolder parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateFolderWithResponseSpec(String name, BaseVirtualFolder baseVirtualFolder) throws WebClientResponseException { + return updateFolderRequestCreation(name, baseVirtualFolder); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/GroupsApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/GroupsApi.java new file mode 100644 index 00000000..8b22ca3b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/GroupsApi.java @@ -0,0 +1,560 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Group; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GroupsApi { + private ApiClient apiClient; + + public GroupsApi() { + this(new ApiClient()); + } + + @Autowired + public GroupsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add group + * Adds a new group + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param group The group parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return Group + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addGroupRequestCreation(Group group, Integer confidentialData) throws WebClientResponseException { + Object postBody = group; + // verify the required parameter 'group' is set + if (group == null) { + throw new WebClientResponseException("Missing the required parameter 'group' when calling addGroup", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/groups", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add group + * Adds a new group + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param group The group parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return Group + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addGroup(Group group, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addGroupRequestCreation(group, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Add group + * Adds a new group + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param group The group parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<Group> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addGroupWithHttpInfo(Group group, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addGroupRequestCreation(group, confidentialData).toEntity(localVarReturnType); + } + + /** + * Add group + * Adds a new group + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param group The group parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addGroupWithResponseSpec(Group group, Integer confidentialData) throws WebClientResponseException { + return addGroupRequestCreation(group, confidentialData); + } + /** + * Delete group + * Deletes an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteGroupRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling deleteGroup", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/groups/{name}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete group + * Deletes an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteGroup(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteGroupRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Delete group + * Deletes an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteGroupWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteGroupRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Delete group + * Deletes an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteGroupWithResponseSpec(String name) throws WebClientResponseException { + return deleteGroupRequestCreation(name); + } + /** + * Find groups by name + * Returns the group with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return Group + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getGroupByNameRequestCreation(String name, Integer confidentialData) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling getGroupByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/groups/{name}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find groups by name + * Returns the group with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return Group + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getGroupByName(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getGroupByNameRequestCreation(name, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Find groups by name + * Returns the group with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<Group> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getGroupByNameWithHttpInfo(String name, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getGroupByNameRequestCreation(name, confidentialData).toEntity(localVarReturnType); + } + + /** + * Find groups by name + * Returns the group with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getGroupByNameWithResponseSpec(String name, Integer confidentialData) throws WebClientResponseException { + return getGroupByNameRequestCreation(name, confidentialData); + } + /** + * Get groups + * Returns an array with one or more groups + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return List<Group> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getGroupsRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/groups", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get groups + * Returns an array with one or more groups + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return List<Group> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getGroups(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getGroupsRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get groups + * Returns an array with one or more groups + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return ResponseEntity<List<Group>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getGroupsWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getGroupsRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get groups + * Returns an array with one or more groups + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getGroupsWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getGroupsRequestCreation(offset, limit, order); + } + /** + * Update group + * Updates an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param group The group parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateGroupRequestCreation(String name, Group group) throws WebClientResponseException { + Object postBody = group; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling updateGroup", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'group' is set + if (group == null) { + throw new WebClientResponseException("Missing the required parameter 'group' when calling updateGroup", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/groups/{name}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update group + * Updates an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param group The group parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateGroup(String name, Group group) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateGroupRequestCreation(name, group).bodyToMono(localVarReturnType); + } + + /** + * Update group + * Updates an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param group The group parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateGroupWithHttpInfo(String name, Group group) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateGroupRequestCreation(name, group).toEntity(localVarReturnType); + } + + /** + * Update group + * Updates an existing group + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name group name + * @param group The group parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateGroupWithResponseSpec(String name, Group group) throws WebClientResponseException { + return updateGroupRequestCreation(name, group); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/HealthcheckApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/HealthcheckApi.java new file mode 100644 index 00000000..1fba534b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/HealthcheckApi.java @@ -0,0 +1,112 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class HealthcheckApi { + private ApiClient apiClient; + + public HealthcheckApi() { + this(new ApiClient()); + } + + @Autowired + public HealthcheckApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * health check + * This endpoint can be used to check if the application is running and responding to requests + *

200 - successful operation + * @return String + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec healthzRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "text/plain; charset=utf-8" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/healthz", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * health check + * This endpoint can be used to check if the application is running and responding to requests + *

200 - successful operation + * @return String + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono healthz() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return healthzRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * health check + * This endpoint can be used to check if the application is running and responding to requests + *

200 - successful operation + * @return ResponseEntity<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> healthzWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return healthzRequestCreation().toEntity(localVarReturnType); + } + + /** + * health check + * This endpoint can be used to check if the application is running and responding to requests + *

200 - successful operation + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec healthzWithResponseSpec() throws WebClientResponseException { + return healthzRequestCreation(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/IpListsApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/IpListsApi.java new file mode 100644 index 00000000..dcce4d1a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/IpListsApi.java @@ -0,0 +1,601 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.IPListEntry; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.IPListType; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class IpListsApi { + private ApiClient apiClient; + + public IpListsApi() { + this(new ApiClient()); + } + + @Autowired + public IpListsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add a new IP list entry + * Add an IP address or a CIDR network to a supported list + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipListEntry The ipListEntry parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addIpListEntryRequestCreation(IPListType type, IPListEntry ipListEntry) throws WebClientResponseException { + Object postBody = ipListEntry; + // verify the required parameter 'type' is set + if (type == null) { + throw new WebClientResponseException("Missing the required parameter 'type' when calling addIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ipListEntry' is set + if (ipListEntry == null) { + throw new WebClientResponseException("Missing the required parameter 'ipListEntry' when calling addIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("type", type); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/iplists/{type}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add a new IP list entry + * Add an IP address or a CIDR network to a supported list + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipListEntry The ipListEntry parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addIpListEntry(IPListType type, IPListEntry ipListEntry) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addIpListEntryRequestCreation(type, ipListEntry).bodyToMono(localVarReturnType); + } + + /** + * Add a new IP list entry + * Add an IP address or a CIDR network to a supported list + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipListEntry The ipListEntry parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addIpListEntryWithHttpInfo(IPListType type, IPListEntry ipListEntry) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addIpListEntryRequestCreation(type, ipListEntry).toEntity(localVarReturnType); + } + + /** + * Add a new IP list entry + * Add an IP address or a CIDR network to a supported list + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipListEntry The ipListEntry parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addIpListEntryWithResponseSpec(IPListType type, IPListEntry ipListEntry) throws WebClientResponseException { + return addIpListEntryRequestCreation(type, ipListEntry); + } + /** + * Delete IP list entry + * Deletes an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteIpListEntryRequestCreation(IPListType type, String ipornet) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'type' is set + if (type == null) { + throw new WebClientResponseException("Missing the required parameter 'type' when calling deleteIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ipornet' is set + if (ipornet == null) { + throw new WebClientResponseException("Missing the required parameter 'ipornet' when calling deleteIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("type", type); + pathParams.put("ipornet", ipornet); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/iplists/{type}/{ipornet}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete IP list entry + * Deletes an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteIpListEntry(IPListType type, String ipornet) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteIpListEntryRequestCreation(type, ipornet).bodyToMono(localVarReturnType); + } + + /** + * Delete IP list entry + * Deletes an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteIpListEntryWithHttpInfo(IPListType type, String ipornet) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteIpListEntryRequestCreation(type, ipornet).toEntity(localVarReturnType); + } + + /** + * Delete IP list entry + * Deletes an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteIpListEntryWithResponseSpec(IPListType type, String ipornet) throws WebClientResponseException { + return deleteIpListEntryRequestCreation(type, ipornet); + } + /** + * Find entry by ipornet + * Returns the entry with the given ipornet if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return IPListEntry + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getIpListByIpornetRequestCreation(IPListType type, String ipornet) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'type' is set + if (type == null) { + throw new WebClientResponseException("Missing the required parameter 'type' when calling getIpListByIpornet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ipornet' is set + if (ipornet == null) { + throw new WebClientResponseException("Missing the required parameter 'ipornet' when calling getIpListByIpornet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("type", type); + pathParams.put("ipornet", ipornet); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/iplists/{type}/{ipornet}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find entry by ipornet + * Returns the entry with the given ipornet if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return IPListEntry + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getIpListByIpornet(IPListType type, String ipornet) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getIpListByIpornetRequestCreation(type, ipornet).bodyToMono(localVarReturnType); + } + + /** + * Find entry by ipornet + * Returns the entry with the given ipornet if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return ResponseEntity<IPListEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getIpListByIpornetWithHttpInfo(IPListType type, String ipornet) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getIpListByIpornetRequestCreation(type, ipornet).toEntity(localVarReturnType); + } + + /** + * Find entry by ipornet + * Returns the entry with the given ipornet if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getIpListByIpornetWithResponseSpec(IPListType type, String ipornet) throws WebClientResponseException { + return getIpListByIpornetRequestCreation(type, ipornet); + } + /** + * Get IP list entries + * Returns an array with one or more IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param filter restrict results to ipornet matching or starting with this filter + * @param from ipornet to start from + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering entries by ipornet field. Default ASC + * @return List<IPListEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getIpListEntriesRequestCreation(IPListType type, String filter, String from, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'type' is set + if (type == null) { + throw new WebClientResponseException("Missing the required parameter 'type' when calling getIpListEntries", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("type", type); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "filter", filter)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "from", from)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/iplists/{type}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get IP list entries + * Returns an array with one or more IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param filter restrict results to ipornet matching or starting with this filter + * @param from ipornet to start from + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering entries by ipornet field. Default ASC + * @return List<IPListEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getIpListEntries(IPListType type, String filter, String from, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getIpListEntriesRequestCreation(type, filter, from, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get IP list entries + * Returns an array with one or more IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param filter restrict results to ipornet matching or starting with this filter + * @param from ipornet to start from + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering entries by ipornet field. Default ASC + * @return ResponseEntity<List<IPListEntry>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getIpListEntriesWithHttpInfo(IPListType type, String filter, String from, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getIpListEntriesRequestCreation(type, filter, from, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get IP list entries + * Returns an array with one or more IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param filter restrict results to ipornet matching or starting with this filter + * @param from ipornet to start from + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering entries by ipornet field. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getIpListEntriesWithResponseSpec(IPListType type, String filter, String from, Integer limit, String order) throws WebClientResponseException { + return getIpListEntriesRequestCreation(type, filter, from, limit, order); + } + /** + * Update IP list entry + * Updates an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @param ipListEntry The ipListEntry parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateIpListEntryRequestCreation(IPListType type, String ipornet, IPListEntry ipListEntry) throws WebClientResponseException { + Object postBody = ipListEntry; + // verify the required parameter 'type' is set + if (type == null) { + throw new WebClientResponseException("Missing the required parameter 'type' when calling updateIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ipornet' is set + if (ipornet == null) { + throw new WebClientResponseException("Missing the required parameter 'ipornet' when calling updateIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ipListEntry' is set + if (ipListEntry == null) { + throw new WebClientResponseException("Missing the required parameter 'ipListEntry' when calling updateIpListEntry", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("type", type); + pathParams.put("ipornet", ipornet); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/iplists/{type}/{ipornet}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update IP list entry + * Updates an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @param ipListEntry The ipListEntry parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateIpListEntry(IPListType type, String ipornet, IPListEntry ipListEntry) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateIpListEntryRequestCreation(type, ipornet, ipListEntry).bodyToMono(localVarReturnType); + } + + /** + * Update IP list entry + * Updates an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @param ipListEntry The ipListEntry parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateIpListEntryWithHttpInfo(IPListType type, String ipornet, IPListEntry ipListEntry) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateIpListEntryRequestCreation(type, ipornet, ipListEntry).toEntity(localVarReturnType); + } + + /** + * Update IP list entry + * Updates an existing IP list entry + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param type IP list type + * @param ipornet The ipornet parameter + * @param ipListEntry The ipListEntry parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateIpListEntryWithResponseSpec(IPListType type, String ipornet, IPListEntry ipListEntry) throws WebClientResponseException { + return updateIpListEntryRequestCreation(type, ipornet, ipListEntry); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/MaintenanceApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/MaintenanceApi.java new file mode 100644 index 00000000..e18ef32a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/MaintenanceApi.java @@ -0,0 +1,532 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BackupData; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.DumpDataScopes; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Dumpdata200Response; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ServicesStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.VersionInfo; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class MaintenanceApi { + private ApiClient apiClient; + + public MaintenanceApi() { + this(new ApiClient()); + } + + @Autowired + public MaintenanceApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Dump data + * Backups data as data provider independent JSON. The backup can be saved in a local file on the server, to avoid exposing sensitive data over the network, or returned as response body. The output of dumpdata can be used as input for loaddata + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param outputFile Path for the file to write the JSON serialized data to. This path is relative to the configured \"backups_path\". If this file already exists it will be overwritten. To return the backup as response body set `output_data` to true instead. + * @param outputData output data: * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required * `1` the backup will be returned as response body + * @param indent indent: * `0` no indentation. This is the default * `1` format the output JSON + * @param scopes You can limit the dump contents to the specified scopes. Empty or missing means any supported scope. Scopes must be specified comma separated + * @return Dumpdata200Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec dumpdataRequestCreation(String outputFile, Integer outputData, Integer indent, List scopes) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "output-file", outputFile)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "output-data", outputData)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "indent", indent)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "scopes", scopes)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/dumpdata", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Dump data + * Backups data as data provider independent JSON. The backup can be saved in a local file on the server, to avoid exposing sensitive data over the network, or returned as response body. The output of dumpdata can be used as input for loaddata + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param outputFile Path for the file to write the JSON serialized data to. This path is relative to the configured \"backups_path\". If this file already exists it will be overwritten. To return the backup as response body set `output_data` to true instead. + * @param outputData output data: * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required * `1` the backup will be returned as response body + * @param indent indent: * `0` no indentation. This is the default * `1` format the output JSON + * @param scopes You can limit the dump contents to the specified scopes. Empty or missing means any supported scope. Scopes must be specified comma separated + * @return Dumpdata200Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono dumpdata(String outputFile, Integer outputData, Integer indent, List scopes) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return dumpdataRequestCreation(outputFile, outputData, indent, scopes).bodyToMono(localVarReturnType); + } + + /** + * Dump data + * Backups data as data provider independent JSON. The backup can be saved in a local file on the server, to avoid exposing sensitive data over the network, or returned as response body. The output of dumpdata can be used as input for loaddata + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param outputFile Path for the file to write the JSON serialized data to. This path is relative to the configured \"backups_path\". If this file already exists it will be overwritten. To return the backup as response body set `output_data` to true instead. + * @param outputData output data: * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required * `1` the backup will be returned as response body + * @param indent indent: * `0` no indentation. This is the default * `1` format the output JSON + * @param scopes You can limit the dump contents to the specified scopes. Empty or missing means any supported scope. Scopes must be specified comma separated + * @return ResponseEntity<Dumpdata200Response> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> dumpdataWithHttpInfo(String outputFile, Integer outputData, Integer indent, List scopes) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return dumpdataRequestCreation(outputFile, outputData, indent, scopes).toEntity(localVarReturnType); + } + + /** + * Dump data + * Backups data as data provider independent JSON. The backup can be saved in a local file on the server, to avoid exposing sensitive data over the network, or returned as response body. The output of dumpdata can be used as input for loaddata + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param outputFile Path for the file to write the JSON serialized data to. This path is relative to the configured \"backups_path\". If this file already exists it will be overwritten. To return the backup as response body set `output_data` to true instead. + * @param outputData output data: * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required * `1` the backup will be returned as response body + * @param indent indent: * `0` no indentation. This is the default * `1` format the output JSON + * @param scopes You can limit the dump contents to the specified scopes. Empty or missing means any supported scope. Scopes must be specified comma separated + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec dumpdataWithResponseSpec(String outputFile, Integer outputData, Integer indent, List scopes) throws WebClientResponseException { + return dumpdataRequestCreation(outputFile, outputData, indent, scopes); + } + /** + * Get status + * Retrieves the status of the active services + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ServicesStatus + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getStatusRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/status", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get status + * Retrieves the status of the active services + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ServicesStatus + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getStatus() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getStatusRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Get status + * Retrieves the status of the active services + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<ServicesStatus> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getStatusWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getStatusRequestCreation().toEntity(localVarReturnType); + } + + /** + * Get status + * Retrieves the status of the active services + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getStatusWithResponseSpec() throws WebClientResponseException { + return getStatusRequestCreation(); + } + /** + * Get version details + * Returns version details such as the version number, build date, commit hash and enabled features + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return VersionInfo + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getVersionRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/version", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get version details + * Returns version details such as the version number, build date, commit hash and enabled features + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return VersionInfo + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getVersion() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getVersionRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Get version details + * Returns version details such as the version number, build date, commit hash and enabled features + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<VersionInfo> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getVersionWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getVersionRequestCreation().toEntity(localVarReturnType); + } + + /** + * Get version details + * Returns version details such as the version number, build date, commit hash and enabled features + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getVersionWithResponseSpec() throws WebClientResponseException { + return getVersionRequestCreation(); + } + /** + * Load data from path + * Restores SFTPGo data from a JSON backup file on the server. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param inputFile Path for the file to read the JSON serialized data from. This can be an absolute path or a path relative to the configured \"backups_path\". The max allowed file size is 10MB + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec loaddataFromFileRequestCreation(String inputFile, Integer scanQuota, Integer mode) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'inputFile' is set + if (inputFile == null) { + throw new WebClientResponseException("Missing the required parameter 'inputFile' when calling loaddataFromFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "scan-quota", scanQuota)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mode", mode)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "input-file", inputFile)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/loaddata", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Load data from path + * Restores SFTPGo data from a JSON backup file on the server. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param inputFile Path for the file to read the JSON serialized data from. This can be an absolute path or a path relative to the configured \"backups_path\". The max allowed file size is 10MB + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono loaddataFromFile(String inputFile, Integer scanQuota, Integer mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return loaddataFromFileRequestCreation(inputFile, scanQuota, mode).bodyToMono(localVarReturnType); + } + + /** + * Load data from path + * Restores SFTPGo data from a JSON backup file on the server. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param inputFile Path for the file to read the JSON serialized data from. This can be an absolute path or a path relative to the configured \"backups_path\". The max allowed file size is 10MB + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> loaddataFromFileWithHttpInfo(String inputFile, Integer scanQuota, Integer mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return loaddataFromFileRequestCreation(inputFile, scanQuota, mode).toEntity(localVarReturnType); + } + + /** + * Load data from path + * Restores SFTPGo data from a JSON backup file on the server. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param inputFile Path for the file to read the JSON serialized data from. This can be an absolute path or a path relative to the configured \"backups_path\". The max allowed file size is 10MB + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec loaddataFromFileWithResponseSpec(String inputFile, Integer scanQuota, Integer mode) throws WebClientResponseException { + return loaddataFromFileRequestCreation(inputFile, scanQuota, mode); + } + /** + * Load data + * Restores SFTPGo data from a JSON backup. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param backupData The backupData parameter + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec loaddataFromRequestBodyRequestCreation(BackupData backupData, Integer scanQuota, Integer mode) throws WebClientResponseException { + Object postBody = backupData; + // verify the required parameter 'backupData' is set + if (backupData == null) { + throw new WebClientResponseException("Missing the required parameter 'backupData' when calling loaddataFromRequestBody", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "scan-quota", scanQuota)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mode", mode)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/loaddata", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Load data + * Restores SFTPGo data from a JSON backup. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param backupData The backupData parameter + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono loaddataFromRequestBody(BackupData backupData, Integer scanQuota, Integer mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return loaddataFromRequestBodyRequestCreation(backupData, scanQuota, mode).bodyToMono(localVarReturnType); + } + + /** + * Load data + * Restores SFTPGo data from a JSON backup. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param backupData The backupData parameter + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> loaddataFromRequestBodyWithHttpInfo(BackupData backupData, Integer scanQuota, Integer mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return loaddataFromRequestBodyRequestCreation(backupData, scanQuota, mode).toEntity(localVarReturnType); + } + + /** + * Load data + * Restores SFTPGo data from a JSON backup. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param backupData The backupData parameter + * @param scanQuota Quota scan: * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default * `1` scan quota * `2` scan quota if the user has quota restrictions required: false + * @param mode Mode: * `0` New objects are added, existing ones are updated. This is the default * `1` New objects are added, existing ones are not modified * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec loaddataFromRequestBodyWithResponseSpec(BackupData backupData, Integer scanQuota, Integer mode) throws WebClientResponseException { + return loaddataFromRequestBodyRequestCreation(backupData, scanQuota, mode); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/PublicSharesApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/PublicSharesApi.java new file mode 100644 index 00000000..73172c53 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/PublicSharesApi.java @@ -0,0 +1,628 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.DirEntry; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.*; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class PublicSharesApi { + private ApiClient apiClient; + + public PublicSharesApi() { + this(new ApiClient()); + } + + @Autowired + public PublicSharesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Download a single file + * Returns the file contents as response body. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono downloadShareFile(String id, String path, String inline) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return downloadShareFileRequestCreation(id, path, inline).bodyToMono(localVarReturnType); + } + + /** + * Download a single file + * Returns the file contents as response body. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return ResponseEntity<File> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> downloadShareFileWithHttpInfo(String id, String path, String inline) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return downloadShareFileRequestCreation(id, path, inline).toEntity(localVarReturnType); + } + + /** + * Download a single file + * Returns the file contents as response body. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec downloadShareFileWithResponseSpec(String id, String path, String inline) throws WebClientResponseException { + return downloadShareFileRequestCreation(id, path, inline); + } + + /** + * Download shared files and folders as a single zip file + * A zip file, containing the shared files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip. The share must be defined with the read scope and the associated user must have list and download permissions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param compress The compress parameter + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getShare(String id, Boolean compress) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getShareRequestCreation(id, compress).bodyToMono(localVarReturnType); + } + + /** + * Download shared files and folders as a single zip file + * A zip file, containing the shared files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip. The share must be defined with the read scope and the associated user must have list and download permissions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param compress The compress parameter + * @return ResponseEntity<File> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getShareWithHttpInfo(String id, Boolean compress) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getShareRequestCreation(id, compress).toEntity(localVarReturnType); + } + + /** + * Download shared files and folders as a single zip file + * A zip file, containing the shared files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip. The share must be defined with the read scope and the associated user must have list and download permissions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param compress The compress parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getShareWithResponseSpec(String id, Boolean compress) throws WebClientResponseException { + return getShareRequestCreation(id, compress); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the specified share. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return List<DirEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getShareDirContents(String id, String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getShareDirContentsRequestCreation(id, path).bodyToFlux(localVarReturnType); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the specified share. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return ResponseEntity<List<DirEntry>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getShareDirContentsWithHttpInfo(String id, String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getShareDirContentsRequestCreation(id, path).toEntityList(localVarReturnType); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the specified share. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getShareDirContentsWithResponseSpec(String id, String path) throws WebClientResponseException { + return getShareDirContentsRequestCreation(id, path); + } + + /** + * Upload a single file to the shared path + * The share must be defined with the write scope and the associated user must have the upload/overwrite permissions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param fileName the name of the new file. It must be path encoded. Sub directories are not accepted + * @param body The body parameter + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono uploadSingleToShare(String id, String fileName, File body, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return uploadSingleToShareRequestCreation(id, fileName, body, X_SFTPGO_MTIME).bodyToMono(localVarReturnType); + } + + /** + * Upload a single file to the shared path + * The share must be defined with the write scope and the associated user must have the upload/overwrite permissions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param fileName the name of the new file. It must be path encoded. Sub directories are not accepted + * @param body The body parameter + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> uploadSingleToShareWithHttpInfo(String id, String fileName, File body, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return uploadSingleToShareRequestCreation(id, fileName, body, X_SFTPGO_MTIME).toEntity(localVarReturnType); + } + + /** + * Upload a single file to the shared path + * The share must be defined with the write scope and the associated user must have the upload/overwrite permissions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param fileName the name of the new file. It must be path encoded. Sub directories are not accepted + * @param body The body parameter + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadSingleToShareWithResponseSpec(String id, String fileName, File body, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + return uploadSingleToShareRequestCreation(id, fileName, body, X_SFTPGO_MTIME); + } + + /** + * Upload one or more files to the shared path + * The share must be defined with the write scope and the associated user must have the upload permission + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param filenames The filenames parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono uploadToShare(String id, Set filenames) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return uploadToShareRequestCreation(id, filenames).bodyToMono(localVarReturnType); + } + + /** + * Upload one or more files to the shared path + * The share must be defined with the write scope and the associated user must have the upload permission + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param filenames The filenames parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> uploadToShareWithHttpInfo(String id, Set filenames) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return uploadToShareRequestCreation(id, filenames).toEntity(localVarReturnType); + } + + /** + * Upload one or more files to the shared path + * The share must be defined with the write scope and the associated user must have the upload permission + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param filenames The filenames parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadToShareWithResponseSpec(String id, Set filenames) throws WebClientResponseException { + return uploadToShareRequestCreation(id, filenames); + } + + /** + * Download a single file + * Returns the file contents as response body. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec downloadShareFileRequestCreation(String id, String path, String inline) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling downloadShareFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling downloadShareFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "inline", inline)); + + final String[] localVarAccepts = { + "*/*", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BasicAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/shares/{id}/files", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Download shared files and folders as a single zip file + * A zip file, containing the shared files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip. The share must be defined with the read scope and the associated user must have list and download permissions + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param compress The compress parameter + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getShareRequestCreation(String id, Boolean compress) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling getShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "compress", compress)); + + final String[] localVarAccepts = { + "*/*", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BasicAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/shares/{id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the specified share. The share must have exactly one path defined and it must be a directory for this to work + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return List<DirEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getShareDirContentsRequestCreation(String id, String path) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling getShareDirContents", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BasicAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/shares/{id}/dirs", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Upload a single file to the shared path + * The share must be defined with the write scope and the associated user must have the upload/overwrite permissions + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param fileName the name of the new file. It must be path encoded. Sub directories are not accepted + * @param body The body parameter + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec uploadSingleToShareRequestCreation(String id, String fileName, File body, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + Object postBody = body; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling uploadSingleToShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'fileName' is set + if (fileName == null) { + throw new WebClientResponseException("Missing the required parameter 'fileName' when calling uploadSingleToShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new WebClientResponseException("Missing the required parameter 'body' when calling uploadSingleToShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + pathParams.put("fileName", fileName); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + + if (X_SFTPGO_MTIME != null) + headerParams.add("X-SFTPGO-MTIME", apiClient.parameterToString(X_SFTPGO_MTIME)); + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/*", "text/*", "image/*", "audio/*", "video/*" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BasicAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/shares/{id}/{fileName}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Upload one or more files to the shared path + * The share must be defined with the write scope and the associated user must have the upload permission + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param filenames The filenames parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec uploadToShareRequestCreation(String id, Set filenames) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling uploadToShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + if (filenames != null) + formParams.addAll("filenames", filenames.stream().map(FileSystemResource::new).collect(Collectors.toList())); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BasicAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/shares/{id}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/QuotaApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/QuotaApi.java new file mode 100644 index 00000000..43c4eb73 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/QuotaApi.java @@ -0,0 +1,771 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FolderQuotaScan; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.QuotaScan; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.QuotaUsage; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TransferQuotaUsage; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class QuotaApi { + private ApiClient apiClient; + + public QuotaApi() { + this(new ApiClient()); + } + + @Autowired + public QuotaApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Update folder quota usage limits + * Sets the current used quota limits for the given folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec folderQuotaUpdateUsageRequestCreation(String name, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + Object postBody = quotaUsage; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling folderQuotaUpdateUsage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'quotaUsage' is set + if (quotaUsage == null) { + throw new WebClientResponseException("Missing the required parameter 'quotaUsage' when calling folderQuotaUpdateUsage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mode", mode)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/folders/{name}/usage", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update folder quota usage limits + * Sets the current used quota limits for the given folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono folderQuotaUpdateUsage(String name, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return folderQuotaUpdateUsageRequestCreation(name, quotaUsage, mode).bodyToMono(localVarReturnType); + } + + /** + * Update folder quota usage limits + * Sets the current used quota limits for the given folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> folderQuotaUpdateUsageWithHttpInfo(String name, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return folderQuotaUpdateUsageRequestCreation(name, quotaUsage, mode).toEntity(localVarReturnType); + } + + /** + * Update folder quota usage limits + * Sets the current used quota limits for the given folder + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec folderQuotaUpdateUsageWithResponseSpec(String name, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + return folderQuotaUpdateUsageRequestCreation(name, quotaUsage, mode); + } + /** + * Get active folder quota scans + * Returns the active folder quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<FolderQuotaScan> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getFoldersQuotaScansRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/folders/scans", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get active folder quota scans + * Returns the active folder quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<FolderQuotaScan> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getFoldersQuotaScans() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFoldersQuotaScansRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get active folder quota scans + * Returns the active folder quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<FolderQuotaScan>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getFoldersQuotaScansWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getFoldersQuotaScansRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get active folder quota scans + * Returns the active folder quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getFoldersQuotaScansWithResponseSpec() throws WebClientResponseException { + return getFoldersQuotaScansRequestCreation(); + } + /** + * Get active user quota scans + * Returns the active user quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<QuotaScan> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUsersQuotaScansRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/users/scans", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get active user quota scans + * Returns the active user quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return List<QuotaScan> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUsersQuotaScans() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUsersQuotaScansRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get active user quota scans + * Returns the active user quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<List<QuotaScan>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUsersQuotaScansWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUsersQuotaScansRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get active user quota scans + * Returns the active user quota scans + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUsersQuotaScansWithResponseSpec() throws WebClientResponseException { + return getUsersQuotaScansRequestCreation(); + } + /** + * Start a folder quota scan + * Starts a new quota scan for the given folder. A quota scan update the number of files and their total size for the specified folder + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec startFolderQuotaScanRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling startFolderQuotaScan", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/folders/{name}/scan", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Start a folder quota scan + * Starts a new quota scan for the given folder. A quota scan update the number of files and their total size for the specified folder + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono startFolderQuotaScan(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return startFolderQuotaScanRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Start a folder quota scan + * Starts a new quota scan for the given folder. A quota scan update the number of files and their total size for the specified folder + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> startFolderQuotaScanWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return startFolderQuotaScanRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Start a folder quota scan + * Starts a new quota scan for the given folder. A quota scan update the number of files and their total size for the specified folder + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name folder name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec startFolderQuotaScanWithResponseSpec(String name) throws WebClientResponseException { + return startFolderQuotaScanRequestCreation(name); + } + /** + * Start a user quota scan + * Starts a new quota scan for the given user. A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec startUserQuotaScanRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling startUserQuotaScan", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/users/{username}/scan", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Start a user quota scan + * Starts a new quota scan for the given user. A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono startUserQuotaScan(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return startUserQuotaScanRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Start a user quota scan + * Starts a new quota scan for the given user. A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> startUserQuotaScanWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return startUserQuotaScanRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Start a user quota scan + * Starts a new quota scan for the given user. A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota + *

202 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec startUserQuotaScanWithResponseSpec(String username) throws WebClientResponseException { + return startUserQuotaScanRequestCreation(username); + } + /** + * Update disk quota usage limits + * Sets the current used quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec userQuotaUpdateUsageRequestCreation(String username, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + Object postBody = quotaUsage; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling userQuotaUpdateUsage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'quotaUsage' is set + if (quotaUsage == null) { + throw new WebClientResponseException("Missing the required parameter 'quotaUsage' when calling userQuotaUpdateUsage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mode", mode)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/users/{username}/usage", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update disk quota usage limits + * Sets the current used quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono userQuotaUpdateUsage(String username, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userQuotaUpdateUsageRequestCreation(username, quotaUsage, mode).bodyToMono(localVarReturnType); + } + + /** + * Update disk quota usage limits + * Sets the current used quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> userQuotaUpdateUsageWithHttpInfo(String username, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userQuotaUpdateUsageRequestCreation(username, quotaUsage, mode).toEntity(localVarReturnType); + } + + /** + * Update disk quota usage limits + * Sets the current used quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param quotaUsage If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec userQuotaUpdateUsageWithResponseSpec(String username, QuotaUsage quotaUsage, String mode) throws WebClientResponseException { + return userQuotaUpdateUsageRequestCreation(username, quotaUsage, mode); + } + /** + * Update transfer quota usage limits + * Sets the current used transfer quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param transferQuotaUsage If used_upload_data_transfer and used_download_data_transfer are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec userTransferQuotaUpdateUsageRequestCreation(String username, TransferQuotaUsage transferQuotaUsage, String mode) throws WebClientResponseException { + Object postBody = transferQuotaUsage; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling userTransferQuotaUpdateUsage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'transferQuotaUsage' is set + if (transferQuotaUsage == null) { + throw new WebClientResponseException("Missing the required parameter 'transferQuotaUsage' when calling userTransferQuotaUpdateUsage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mode", mode)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/quotas/users/{username}/transfer-usage", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update transfer quota usage limits + * Sets the current used transfer quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param transferQuotaUsage If used_upload_data_transfer and used_download_data_transfer are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono userTransferQuotaUpdateUsage(String username, TransferQuotaUsage transferQuotaUsage, String mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userTransferQuotaUpdateUsageRequestCreation(username, transferQuotaUsage, mode).bodyToMono(localVarReturnType); + } + + /** + * Update transfer quota usage limits + * Sets the current used transfer quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param transferQuotaUsage If used_upload_data_transfer and used_download_data_transfer are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> userTransferQuotaUpdateUsageWithHttpInfo(String username, TransferQuotaUsage transferQuotaUsage, String mode) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userTransferQuotaUpdateUsageRequestCreation(username, transferQuotaUsage, mode).toEntity(localVarReturnType); + } + + /** + * Update transfer quota usage limits + * Sets the current used transfer quota limits for the given user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

409 - Conflict + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param transferQuotaUsage If used_upload_data_transfer and used_download_data_transfer are missing they will default to 0, this means that if mode is \"add\" the current value, for the missing field, will remain unchanged, if mode is \"reset\" the missing field is set to 0 + * @param mode the update mode specifies if the given quota usage values should be added or replace the current ones + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec userTransferQuotaUpdateUsageWithResponseSpec(String username, TransferQuotaUsage transferQuotaUsage, String mode) throws WebClientResponseException { + return userTransferQuotaUpdateUsageRequestCreation(username, transferQuotaUsage, mode); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/RolesApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/RolesApi.java new file mode 100644 index 00000000..93d1b056 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/RolesApi.java @@ -0,0 +1,548 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Role; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class RolesApi { + private ApiClient apiClient; + + public RolesApi() { + this(new ApiClient()); + } + + @Autowired + public RolesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add role + * Adds a new role + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param role The role parameter + * @return Role + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addRoleRequestCreation(Role role) throws WebClientResponseException { + Object postBody = role; + // verify the required parameter 'role' is set + if (role == null) { + throw new WebClientResponseException("Missing the required parameter 'role' when calling addRole", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/roles", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add role + * Adds a new role + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param role The role parameter + * @return Role + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addRole(Role role) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addRoleRequestCreation(role).bodyToMono(localVarReturnType); + } + + /** + * Add role + * Adds a new role + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param role The role parameter + * @return ResponseEntity<Role> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addRoleWithHttpInfo(Role role) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addRoleRequestCreation(role).toEntity(localVarReturnType); + } + + /** + * Add role + * Adds a new role + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param role The role parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addRoleWithResponseSpec(Role role) throws WebClientResponseException { + return addRoleRequestCreation(role); + } + /** + * Delete role + * Deletes an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteRoleRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling deleteRole", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/roles/{name}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete role + * Deletes an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteRole(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteRoleRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Delete role + * Deletes an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteRoleWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteRoleRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Delete role + * Deletes an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteRoleWithResponseSpec(String name) throws WebClientResponseException { + return deleteRoleRequestCreation(name); + } + /** + * Find roles by name + * Returns the role with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return Role + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getRoleByNameRequestCreation(String name) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling getRoleByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/roles/{name}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find roles by name + * Returns the role with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return Role + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getRoleByName(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getRoleByNameRequestCreation(name).bodyToMono(localVarReturnType); + } + + /** + * Find roles by name + * Returns the role with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return ResponseEntity<Role> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getRoleByNameWithHttpInfo(String name) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getRoleByNameRequestCreation(name).toEntity(localVarReturnType); + } + + /** + * Find roles by name + * Returns the role with the given name if it exists. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getRoleByNameWithResponseSpec(String name) throws WebClientResponseException { + return getRoleByNameRequestCreation(name); + } + /** + * Get roles + * Returns an array with one or more roles + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return List<Role> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getRolesRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/roles", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get roles + * Returns an array with one or more roles + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return List<Role> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getRoles(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getRolesRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get roles + * Returns an array with one or more roles + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return ResponseEntity<List<Role>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getRolesWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getRolesRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get roles + * Returns an array with one or more roles + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering groups by name. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getRolesWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getRolesRequestCreation(offset, limit, order); + } + /** + * Update role + * Updates an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @param role The role parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateRoleRequestCreation(String name, Role role) throws WebClientResponseException { + Object postBody = role; + // verify the required parameter 'name' is set + if (name == null) { + throw new WebClientResponseException("Missing the required parameter 'name' when calling updateRole", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'role' is set + if (role == null) { + throw new WebClientResponseException("Missing the required parameter 'role' when calling updateRole", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("name", name); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/roles/{name}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update role + * Updates an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @param role The role parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateRole(String name, Role role) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateRoleRequestCreation(name, role).bodyToMono(localVarReturnType); + } + + /** + * Update role + * Updates an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @param role The role parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateRoleWithHttpInfo(String name, Role role) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateRoleRequestCreation(name, role).toEntity(localVarReturnType); + } + + /** + * Update role + * Updates an existing role + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param name role name + * @param role The role parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateRoleWithResponseSpec(String name, Role role) throws WebClientResponseException { + return updateRoleRequestCreation(name, role); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/TokenApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/TokenApi.java new file mode 100644 index 00000000..45335cbd --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/TokenApi.java @@ -0,0 +1,384 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Token; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class TokenApi { + private ApiClient apiClient; + + public TokenApi() { + this(new ApiClient()); + } + + @Autowired + public TokenApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Invalidate a user access token + * Allows to invalidate a client token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec clientLogoutRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Invalidate a user access token + * Allows to invalidate a client token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono clientLogout() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return clientLogoutRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Invalidate a user access token + * Allows to invalidate a client token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> clientLogoutWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return clientLogoutRequestCreation().toEntity(localVarReturnType); + } + + /** + * Invalidate a user access token + * Allows to invalidate a client token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec clientLogoutWithResponseSpec() throws WebClientResponseException { + return clientLogoutRequestCreation(); + } + /** + * Get a new admin access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter + * @return Token + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getTokenRequestCreation(String X_SFTPGO_OTP) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + + if (X_SFTPGO_OTP != null) + headerParams.add("X-SFTPGO-OTP", apiClient.parameterToString(X_SFTPGO_OTP)); + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BasicAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/token", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get a new admin access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter + * @return Token + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getToken(String X_SFTPGO_OTP) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getTokenRequestCreation(X_SFTPGO_OTP).bodyToMono(localVarReturnType); + } + + /** + * Get a new admin access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter + * @return ResponseEntity<Token> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getTokenWithHttpInfo(String X_SFTPGO_OTP) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getTokenRequestCreation(X_SFTPGO_OTP).toEntity(localVarReturnType); + } + + /** + * Get a new admin access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getTokenWithResponseSpec(String X_SFTPGO_OTP) throws WebClientResponseException { + return getTokenRequestCreation(X_SFTPGO_OTP); + } + /** + * Get a new user access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured, for the HTTP protocol, for the user attempting to log in you need to set the authentication code using this header parameter + * @return Token + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserTokenRequestCreation(String X_SFTPGO_OTP) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + + if (X_SFTPGO_OTP != null) + headerParams.add("X-SFTPGO-OTP", apiClient.parameterToString(X_SFTPGO_OTP)); + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BasicAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user/token", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get a new user access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured, for the HTTP protocol, for the user attempting to log in you need to set the authentication code using this header parameter + * @return Token + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getUserToken(String X_SFTPGO_OTP) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUserTokenRequestCreation(X_SFTPGO_OTP).bodyToMono(localVarReturnType); + } + + /** + * Get a new user access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured, for the HTTP protocol, for the user attempting to log in you need to set the authentication code using this header parameter + * @return ResponseEntity<Token> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getUserTokenWithHttpInfo(String X_SFTPGO_OTP) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUserTokenRequestCreation(X_SFTPGO_OTP).toEntity(localVarReturnType); + } + + /** + * Get a new user access token + * Returns an access token and its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param X_SFTPGO_OTP If you have 2FA configured, for the HTTP protocol, for the user attempting to log in you need to set the authentication code using this header parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserTokenWithResponseSpec(String X_SFTPGO_OTP) throws WebClientResponseException { + return getUserTokenRequestCreation(X_SFTPGO_OTP); + } + /** + * Invalidate an admin access token + * Allows to invalidate an admin token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec logoutRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Invalidate an admin access token + * Allows to invalidate an admin token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono logout() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return logoutRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Invalidate an admin access token + * Allows to invalidate an admin token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> logoutWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return logoutRequestCreation().toEntity(localVarReturnType); + } + + /** + * Invalidate an admin access token + * Allows to invalidate an admin token before its expiration + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec logoutWithResponseSpec() throws WebClientResponseException { + return logoutRequestCreation(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UserApisApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UserApisApi.java new file mode 100644 index 00000000..7398247e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UserApisApi.java @@ -0,0 +1,2873 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.*; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class UserApisApi { + private ApiClient apiClient; + + public UserApisApi() { + this(new ApiClient()); + } + + @Autowired + public UserApisApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add a share + * Adds a new share. The share id will be auto-generated + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param share The share parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addShare(Share share) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return addShareRequestCreation(share).bodyToMono(localVarReturnType); + } + + /** + * Add a share + * Adds a new share. The share id will be auto-generated + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param share The share parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addShareWithHttpInfo(Share share) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return addShareRequestCreation(share).toEntity(localVarReturnType); + } + + /** + * Add a share + * Adds a new share. The share id will be auto-generated + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param share The share parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addShareWithResponseSpec(Share share) throws WebClientResponseException { + return addShareRequestCreation(share); + } + + /** + * Change user password + * Changes the password for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param pwdChange The pwdChange parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono changeUserPassword(PwdChange pwdChange) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return changeUserPasswordRequestCreation(pwdChange).bodyToMono(localVarReturnType); + } + + /** + * Change user password + * Changes the password for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param pwdChange The pwdChange parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> changeUserPasswordWithHttpInfo(PwdChange pwdChange) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return changeUserPasswordRequestCreation(pwdChange).toEntity(localVarReturnType); + } + + /** + * Change user password + * Changes the password for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param pwdChange The pwdChange parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec changeUserPasswordWithResponseSpec(PwdChange pwdChange) throws WebClientResponseException { + return changeUserPasswordRequestCreation(pwdChange); + } + + /** + * Create a directory + * Create a directory for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to create. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param mkdirParents Create parent directories if they do not exist? + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono createUserDir(String path, Boolean mkdirParents) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return createUserDirRequestCreation(path, mkdirParents).bodyToMono(localVarReturnType); + } + + /** + * Create a directory + * Create a directory for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to create. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param mkdirParents Create parent directories if they do not exist? + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> createUserDirWithHttpInfo(String path, Boolean mkdirParents) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return createUserDirRequestCreation(path, mkdirParents).toEntity(localVarReturnType); + } + + /** + * Create a directory + * Create a directory for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to create. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param mkdirParents Create parent directories if they do not exist? + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUserDirWithResponseSpec(String path, Boolean mkdirParents) throws WebClientResponseException { + return createUserDirRequestCreation(path, mkdirParents); + } + + /** + * Upload a single file + * Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file path. It must be path encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\". The parent directory must exist. If a file with the same name already exists, it will be overwritten + * @param body The body parameter + * @param mkdirParents Create parent directories if they do not exist? + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono createUserFile(String path, File body, Boolean mkdirParents, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return createUserFileRequestCreation(path, body, mkdirParents, X_SFTPGO_MTIME).bodyToMono(localVarReturnType); + } + + /** + * Upload a single file + * Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file path. It must be path encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\". The parent directory must exist. If a file with the same name already exists, it will be overwritten + * @param body The body parameter + * @param mkdirParents Create parent directories if they do not exist? + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> createUserFileWithHttpInfo(String path, File body, Boolean mkdirParents, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return createUserFileRequestCreation(path, body, mkdirParents, X_SFTPGO_MTIME).toEntity(localVarReturnType); + } + + /** + * Upload a single file + * Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file path. It must be path encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\". The parent directory must exist. If a file with the same name already exists, it will be overwritten + * @param body The body parameter + * @param mkdirParents Create parent directories if they do not exist? + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUserFileWithResponseSpec(String path, File body, Boolean mkdirParents, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + return createUserFileRequestCreation(path, body, mkdirParents, X_SFTPGO_MTIME); + } + + /** + * Upload files + * Upload one or more files for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Parent directory for the uploaded files. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the root path is assumed. If a file with the same name already exists, it will be overwritten + * @param mkdirParents Create parent directories if they do not exist? + * @param filenames The filenames parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono createUserFiles(String path, Boolean mkdirParents, Set filenames) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return createUserFilesRequestCreation(path, mkdirParents, filenames).bodyToMono(localVarReturnType); + } + + /** + * Upload files + * Upload one or more files for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Parent directory for the uploaded files. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the root path is assumed. If a file with the same name already exists, it will be overwritten + * @param mkdirParents Create parent directories if they do not exist? + * @param filenames The filenames parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> createUserFilesWithHttpInfo(String path, Boolean mkdirParents, Set filenames) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return createUserFilesRequestCreation(path, mkdirParents, filenames).toEntity(localVarReturnType); + } + + /** + * Upload files + * Upload one or more files for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Parent directory for the uploaded files. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the root path is assumed. If a file with the same name already exists, it will be overwritten + * @param mkdirParents Create parent directories if they do not exist? + * @param filenames The filenames parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUserFilesWithResponseSpec(String path, Boolean mkdirParents, Set filenames) throws WebClientResponseException { + return createUserFilesRequestCreation(path, mkdirParents, filenames); + } + + /** + * Delete a directory + * Delete a directory and any children it contains for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to delete. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteUserDir(String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return deleteUserDirRequestCreation(path).bodyToMono(localVarReturnType); + } + + /** + * Delete a directory + * Delete a directory and any children it contains for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to delete. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteUserDirWithHttpInfo(String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return deleteUserDirRequestCreation(path).toEntity(localVarReturnType); + } + + /** + * Delete a directory + * Delete a directory and any children it contains for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to delete. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserDirWithResponseSpec(String path) throws WebClientResponseException { + return deleteUserDirRequestCreation(path); + } + + /** + * Delete a file + * Delete a file for the logged in user. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to delete. It must be URL encoded + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteUserFile(String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return deleteUserFileRequestCreation(path).bodyToMono(localVarReturnType); + } + + /** + * Delete a file + * Delete a file for the logged in user. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to delete. It must be URL encoded + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteUserFileWithHttpInfo(String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return deleteUserFileRequestCreation(path).toEntity(localVarReturnType); + } + + /** + * Delete a file + * Delete a file for the logged in user. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to delete. It must be URL encoded + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserFileWithResponseSpec(String path) throws WebClientResponseException { + return deleteUserFileRequestCreation(path); + } + + /** + * Delete share + * Deletes an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteUserShare(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return deleteUserShareRequestCreation(id).bodyToMono(localVarReturnType); + } + + /** + * Delete share + * Deletes an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteUserShareWithHttpInfo(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return deleteUserShareRequestCreation(id).toEntity(localVarReturnType); + } + + /** + * Delete share + * Deletes an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserShareWithResponseSpec(String id) throws WebClientResponseException { + return deleteUserShareRequestCreation(id); + } + + /** + * Download a single file + * Returns the file contents as response body + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono downloadUserFile(String path, String inline) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return downloadUserFileRequestCreation(path, inline).bodyToMono(localVarReturnType); + } + + /** + * Download a single file + * Returns the file contents as response body + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return ResponseEntity<File> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> downloadUserFileWithHttpInfo(String path, String inline) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return downloadUserFileRequestCreation(path, inline).toEntity(localVarReturnType); + } + + /** + * Download a single file + * Returns the file contents as response body + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec downloadUserFileWithResponseSpec(String path, String inline) throws WebClientResponseException { + return downloadUserFileRequestCreation(path, inline); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return List<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> generateUserRecoveryCodes() throws WebClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() { + }; + return generateUserRecoveryCodesRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseEntity<List<String>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> generateUserRecoveryCodesWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() { + }; + return generateUserRecoveryCodesRequestCreation().toEntity(localVarReturnType); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec generateUserRecoveryCodesWithResponseSpec() throws WebClientResponseException { + return generateUserRecoveryCodesRequestCreation(); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return GenerateUserTotpSecret200Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono generateUserTotpSecret(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return generateUserTotpSecretRequestCreation(generateAdminTotpSecretRequest).bodyToMono(localVarReturnType); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return ResponseEntity<GenerateUserTotpSecret200Response> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> generateUserTotpSecretWithHttpInfo(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return generateUserTotpSecretRequestCreation(generateAdminTotpSecretRequest).toEntity(localVarReturnType); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec generateUserTotpSecretWithResponseSpec(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + return generateUserTotpSecretRequestCreation(generateAdminTotpSecretRequest); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return List<DirEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUserDirContents(String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserDirContentsRequestCreation(path).bodyToFlux(localVarReturnType); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return ResponseEntity<List<DirEntry>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUserDirContentsWithHttpInfo(String path) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserDirContentsRequestCreation(path).toEntityList(localVarReturnType); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserDirContentsWithResponseSpec(String path) throws WebClientResponseException { + return getUserDirContentsRequestCreation(path); + } + + /** + * Get user profile + * Returns the profile for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return UserProfile + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getUserProfile() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserProfileRequestCreation().bodyToMono(localVarReturnType); + } + + /** + * Get user profile + * Returns the profile for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseEntity<UserProfile> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getUserProfileWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserProfileRequestCreation().toEntity(localVarReturnType); + } + + /** + * Get user profile + * Returns the profile for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserProfileWithResponseSpec() throws WebClientResponseException { + return getUserProfileRequestCreation(); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in user. Recovery codes can be used if the user loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return List<RecoveryCode> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUserRecoveryCodes() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserRecoveryCodesRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in user. Recovery codes can be used if the user loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseEntity<List<RecoveryCode>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUserRecoveryCodesWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserRecoveryCodesRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in user. Recovery codes can be used if the user loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserRecoveryCodesWithResponseSpec() throws WebClientResponseException { + return getUserRecoveryCodesRequestCreation(); + } + + /** + * Get share by id + * Returns a share by id for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return Share + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getUserShareById(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserShareByIdRequestCreation(id).bodyToMono(localVarReturnType); + } + + /** + * Get share by id + * Returns a share by id for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return ResponseEntity<Share> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getUserShareByIdWithHttpInfo(String id) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserShareByIdRequestCreation(id).toEntity(localVarReturnType); + } + + /** + * Get share by id + * Returns a share by id for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserShareByIdWithResponseSpec(String id) throws WebClientResponseException { + return getUserShareByIdRequestCreation(id); + } + + /** + * List user shares + * Returns the share for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering shares by ID. Default ASC + * @return List<Share> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUserShares(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserSharesRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * List user shares + * Returns the share for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering shares by ID. Default ASC + * @return ResponseEntity<List<Share>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUserSharesWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserSharesRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * List user shares + * Returns the share for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering shares by ID. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserSharesWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getUserSharesRequestCreation(offset, limit, order); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return List<TOTPConfig> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUserTotpConfigs() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserTotpConfigsRequestCreation().bodyToFlux(localVarReturnType); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseEntity<List<TOTPConfig>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUserTotpConfigsWithHttpInfo() throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return getUserTotpConfigsRequestCreation().toEntityList(localVarReturnType); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserTotpConfigsWithResponseSpec() throws WebClientResponseException { + return getUserTotpConfigsRequestCreation(); + } + + /** + * Rename a directory. Deprecated, use \"file-actions/move\" + * Rename a directory for the logged in user. The rename is allowed for empty directory or for non empty local directories, with no virtual folders inside + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono renameUserDir(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return renameUserDirRequestCreation(path, target).bodyToMono(localVarReturnType); + } + + /** + * Rename a directory. Deprecated, use \"file-actions/move\" + * Rename a directory for the logged in user. The rename is allowed for empty directory or for non empty local directories, with no virtual folders inside + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> renameUserDirWithHttpInfo(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return renameUserDirRequestCreation(path, target).toEntity(localVarReturnType); + } + + /** + * Rename a directory. Deprecated, use \"file-actions/move\" + * Rename a directory for the logged in user. The rename is allowed for empty directory or for non empty local directories, with no virtual folders inside + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec renameUserDirWithResponseSpec(String path, String target) throws WebClientResponseException { + return renameUserDirRequestCreation(path, target); + } + + /** + * Rename a file + * Rename a file for the logged in user. Deprecated, use \"file-actions/move\" + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to rename. It must be URL encoded + * @param target New name. It must be URL encoded + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono renameUserFile(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return renameUserFileRequestCreation(path, target).bodyToMono(localVarReturnType); + } + + /** + * Rename a file + * Rename a file for the logged in user. Deprecated, use \"file-actions/move\" + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to rename. It must be URL encoded + * @param target New name. It must be URL encoded + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> renameUserFileWithHttpInfo(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return renameUserFileRequestCreation(path, target).toEntity(localVarReturnType); + } + + /** + * Rename a file + * Rename a file for the logged in user. Deprecated, use \"file-actions/move\" + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to rename. It must be URL encoded + * @param target New name. It must be URL encoded + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec renameUserFileWithResponseSpec(String path, String target) throws WebClientResponseException { + return renameUserFileRequestCreation(path, target); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userTOTPConfig The userTOTPConfig parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono saveUserTotpConfig(UserTOTPConfig userTOTPConfig) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return saveUserTotpConfigRequestCreation(userTOTPConfig).bodyToMono(localVarReturnType); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userTOTPConfig The userTOTPConfig parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> saveUserTotpConfigWithHttpInfo(UserTOTPConfig userTOTPConfig) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return saveUserTotpConfigRequestCreation(userTOTPConfig).toEntity(localVarReturnType); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userTOTPConfig The userTOTPConfig parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec saveUserTotpConfigWithResponseSpec(UserTOTPConfig userTOTPConfig) throws WebClientResponseException { + return saveUserTotpConfigRequestCreation(userTOTPConfig); + } + + /** + * Set metadata for a file/directory + * Set supported metadata attributes for the specified file or directory + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file/directory path. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param setpropsUserFileRequest The setpropsUserFileRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono setpropsUserFile(String path, SetpropsUserFileRequest setpropsUserFileRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return setpropsUserFileRequestCreation(path, setpropsUserFileRequest).bodyToMono(localVarReturnType); + } + + /** + * Set metadata for a file/directory + * Set supported metadata attributes for the specified file or directory + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file/directory path. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param setpropsUserFileRequest The setpropsUserFileRequest parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> setpropsUserFileWithHttpInfo(String path, SetpropsUserFileRequest setpropsUserFileRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return setpropsUserFileRequestCreation(path, setpropsUserFileRequest).toEntity(localVarReturnType); + } + + /** + * Set metadata for a file/directory + * Set supported metadata attributes for the specified file or directory + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file/directory path. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param setpropsUserFileRequest The setpropsUserFileRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec setpropsUserFileWithResponseSpec(String path, SetpropsUserFileRequest setpropsUserFileRequest) throws WebClientResponseException { + return setpropsUserFileRequestCreation(path, setpropsUserFileRequest); + } + + /** + * Download multiple files and folders as a single zip file + * A zip file, containing the specified files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param requestBody The requestBody parameter + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono streamzip(List requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return streamzipRequestCreation(requestBody).bodyToMono(localVarReturnType); + } + + /** + * Download multiple files and folders as a single zip file + * A zip file, containing the specified files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param requestBody The requestBody parameter + * @return ResponseEntity<File> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> streamzipWithHttpInfo(List requestBody) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return streamzipRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * Download multiple files and folders as a single zip file + * A zip file, containing the specified files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param requestBody The requestBody parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec streamzipWithResponseSpec(List requestBody) throws WebClientResponseException { + return streamzipRequestCreation(requestBody); + } + + /** + * Update user profile + * Allows to update the profile for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userProfile The userProfile parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateUserProfile(UserProfile userProfile) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return updateUserProfileRequestCreation(userProfile).bodyToMono(localVarReturnType); + } + + /** + * Update user profile + * Allows to update the profile for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userProfile The userProfile parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateUserProfileWithHttpInfo(UserProfile userProfile) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return updateUserProfileRequestCreation(userProfile).toEntity(localVarReturnType); + } + + /** + * Update user profile + * Allows to update the profile for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userProfile The userProfile parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateUserProfileWithResponseSpec(UserProfile userProfile) throws WebClientResponseException { + return updateUserProfileRequestCreation(userProfile); + } + + /** + * Update share + * Updates an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param share The share parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateUserShare(String id, Share share) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return updateUserShareRequestCreation(id, share).bodyToMono(localVarReturnType); + } + + /** + * Update share + * Updates an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param share The share parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateUserShareWithHttpInfo(String id, Share share) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return updateUserShareRequestCreation(id, share).toEntity(localVarReturnType); + } + + /** + * Update share + * Updates an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param share The share parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateUserShareWithResponseSpec(String id, Share share) throws WebClientResponseException { + return updateUserShareRequestCreation(id, share); + } + + /** + * Copy a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to copy. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono userFileActionsCopyPost(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return userFileActionsCopyPostRequestCreation(path, target).bodyToMono(localVarReturnType); + } + + /** + * Copy a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to copy. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> userFileActionsCopyPostWithHttpInfo(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return userFileActionsCopyPostRequestCreation(path, target).toEntity(localVarReturnType); + } + + /** + * Copy a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to copy. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec userFileActionsCopyPostWithResponseSpec(String path, String target) throws WebClientResponseException { + return userFileActionsCopyPostRequestCreation(path, target); + } + + /** + * Move (rename) a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono userFileActionsMovePost(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return userFileActionsMovePostRequestCreation(path, target).bodyToMono(localVarReturnType); + } + + /** + * Move (rename) a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> userFileActionsMovePostWithHttpInfo(String path, String target) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return userFileActionsMovePostRequestCreation(path, target).toEntity(localVarReturnType); + } + + /** + * Move (rename) a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec userFileActionsMovePostWithResponseSpec(String path, String target) throws WebClientResponseException { + return userFileActionsMovePostRequestCreation(path, target); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono validateUserTotpSecret(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return validateUserTotpSecretRequestCreation(validateAdminTotpSecretRequest).bodyToMono(localVarReturnType); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> validateUserTotpSecretWithHttpInfo(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return validateUserTotpSecretRequestCreation(validateAdminTotpSecretRequest).toEntity(localVarReturnType); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec validateUserTotpSecretWithResponseSpec(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + return validateUserTotpSecretRequestCreation(validateAdminTotpSecretRequest); + } + + /** + * Add a share + * Adds a new share. The share id will be auto-generated + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param share The share parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addShareRequestCreation(Share share) throws WebClientResponseException { + Object postBody = share; + // verify the required parameter 'share' is set + if (share == null) { + throw new WebClientResponseException("Missing the required parameter 'share' when calling addShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/shares", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Change user password + * Changes the password for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param pwdChange The pwdChange parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec changeUserPasswordRequestCreation(PwdChange pwdChange) throws WebClientResponseException { + Object postBody = pwdChange; + // verify the required parameter 'pwdChange' is set + if (pwdChange == null) { + throw new WebClientResponseException("Missing the required parameter 'pwdChange' when calling changeUserPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/changepwd", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Create a directory + * Create a directory for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to create. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param mkdirParents Create parent directories if they do not exist? + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUserDirRequestCreation(String path, Boolean mkdirParents) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling createUserDir", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mkdir_parents", mkdirParents)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/dirs", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Upload a single file + * Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file path. It must be path encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\". The parent directory must exist. If a file with the same name already exists, it will be overwritten + * @param body The body parameter + * @param mkdirParents Create parent directories if they do not exist? + * @param X_SFTPGO_MTIME File modification time as unix timestamp in milliseconds + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUserFileRequestCreation(String path, File body, Boolean mkdirParents, Integer X_SFTPGO_MTIME) throws WebClientResponseException { + Object postBody = body; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling createUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'body' is set + if (body == null) { + throw new WebClientResponseException("Missing the required parameter 'body' when calling createUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mkdir_parents", mkdirParents)); + + + if (X_SFTPGO_MTIME != null) + headerParams.add("X-SFTPGO-MTIME", apiClient.parameterToString(X_SFTPGO_MTIME)); + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/*", "text/*", "image/*", "audio/*", "video/*" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/files/upload", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Upload files + * Upload one or more files for the logged in user + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Parent directory for the uploaded files. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the root path is assumed. If a file with the same name already exists, it will be overwritten + * @param mkdirParents Create parent directories if they do not exist? + * @param filenames The filenames parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUserFilesRequestCreation(String path, Boolean mkdirParents, Set filenames) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "mkdir_parents", mkdirParents)); + + if (filenames != null) + formParams.addAll("filenames", filenames.stream().map(FileSystemResource::new).collect(Collectors.toList())); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/files", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete a directory + * Delete a directory and any children it contains for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to delete. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteUserDirRequestCreation(String path) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling deleteUserDir", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/dirs", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete a file + * Delete a file for the logged in user. + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to delete. It must be URL encoded + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteUserFileRequestCreation(String path) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling deleteUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/files", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete share + * Deletes an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteUserShareRequestCreation(String id) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling deleteUserShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/shares/{id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Download a single file + * Returns the file contents as response body + *

200 - successful operation + *

206 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to download. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param inline If set, the response will not have the Content-Disposition header set to `attachment` + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec downloadUserFileRequestCreation(String path, String inline) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling downloadUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "inline", inline)); + + final String[] localVarAccepts = { + "*/*", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/files", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Generate recovery codes + * Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return List<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec generateUserRecoveryCodesRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() { + }; + return apiClient.invokeAPI("/user/2fa/recoverycodes", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Generate a new TOTP secret + * Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param generateAdminTotpSecretRequest The generateAdminTotpSecretRequest parameter + * @return GenerateUserTotpSecret200Response + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec generateUserTotpSecretRequestCreation(GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest) throws WebClientResponseException { + Object postBody = generateAdminTotpSecretRequest; + // verify the required parameter 'generateAdminTotpSecretRequest' is set + if (generateAdminTotpSecretRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'generateAdminTotpSecretRequest' when calling generateUserTotpSecret", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/totp/generate", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Read directory contents + * Returns the contents of the specified directory for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to read. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + * @return List<DirEntry> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserDirContentsRequestCreation(String path) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/dirs", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get user profile + * Returns the profile for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return UserProfile + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserProfileRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/profile", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get recovery codes + * Returns the recovery codes for the logged in user. Recovery codes can be used if the user loses access to their second factor auth device. Recovery codes are returned unencrypted + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return List<RecoveryCode> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserRecoveryCodesRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/2fa/recoverycodes", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get share by id + * Returns a share by id for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @return Share + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserShareByIdRequestCreation(String id) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling getUserShareById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/shares/{id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * List user shares + * Returns the share for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering shares by ID. Default ASC + * @return List<Share> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserSharesRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/shares", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get available TOTP configuration + * Returns the available TOTP configurations for the logged in user + *

200 - successful operation + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @return List<TOTPConfig> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserTotpConfigsRequestCreation() throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/totp/configs", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Rename a directory. Deprecated, use \"file-actions/move\" + * Rename a directory for the logged in user. The rename is allowed for empty directory or for non empty local directories, with no virtual folders inside + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + * @deprecated + */ + @Deprecated + private ResponseSpec renameUserDirRequestCreation(String path, String target) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling renameUserDir", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'target' is set + if (target == null) { + throw new WebClientResponseException("Missing the required parameter 'target' when calling renameUserDir", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "target", target)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/dirs", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Rename a file + * Rename a file for the logged in user. Deprecated, use \"file-actions/move\" + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file to rename. It must be URL encoded + * @param target New name. It must be URL encoded + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + * @deprecated + */ + @Deprecated + private ResponseSpec renameUserFileRequestCreation(String path, String target) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling renameUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'target' is set + if (target == null) { + throw new WebClientResponseException("Missing the required parameter 'target' when calling renameUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "target", target)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/files", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Save a TOTP config + * Saves the specified TOTP config for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userTOTPConfig The userTOTPConfig parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec saveUserTotpConfigRequestCreation(UserTOTPConfig userTOTPConfig) throws WebClientResponseException { + Object postBody = userTOTPConfig; + // verify the required parameter 'userTOTPConfig' is set + if (userTOTPConfig == null) { + throw new WebClientResponseException("Missing the required parameter 'userTOTPConfig' when calling saveUserTotpConfig", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/totp/save", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Set metadata for a file/directory + * Set supported metadata attributes for the specified file or directory + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

413 - Request Entity Too Large, max allowed size exceeded + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Full file/directory path. It must be URL encoded, for example the path \"my dir/àdir/file.txt\" must be sent as \"my%20dir%2F%C3%A0dir%2Ffile.txt\" + * @param setpropsUserFileRequest The setpropsUserFileRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec setpropsUserFileRequestCreation(String path, SetpropsUserFileRequest setpropsUserFileRequest) throws WebClientResponseException { + Object postBody = setpropsUserFileRequest; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling setpropsUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'setpropsUserFileRequest' is set + if (setpropsUserFileRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'setpropsUserFileRequest' when calling setpropsUserFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/files/metadata", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Download multiple files and folders as a single zip file + * A zip file, containing the specified files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param requestBody The requestBody parameter + * @return File + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec streamzipRequestCreation(List requestBody) throws WebClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new WebClientResponseException("Missing the required parameter 'requestBody' when calling streamzip", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/zip", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/streamzip", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update user profile + * Allows to update the profile for the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param userProfile The userProfile parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateUserProfileRequestCreation(UserProfile userProfile) throws WebClientResponseException { + Object postBody = userProfile; + // verify the required parameter 'userProfile' is set + if (userProfile == null) { + throw new WebClientResponseException("Missing the required parameter 'userProfile' when calling updateUserProfile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/profile", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update share + * Updates an existing share belonging to the logged in user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param id the share id + * @param share The share parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateUserShareRequestCreation(String id, Share share) throws WebClientResponseException { + Object postBody = share; + // verify the required parameter 'id' is set + if (id == null) { + throw new WebClientResponseException("Missing the required parameter 'id' when calling updateUserShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'share' is set + if (share == null) { + throw new WebClientResponseException("Missing the required parameter 'share' when calling updateUserShare", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("id", id); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/shares/{id}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Copy a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to copy. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec userFileActionsCopyPostRequestCreation(String path, String target) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling userFileActionsCopyPost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'target' is set + if (target == null) { + throw new WebClientResponseException("Missing the required parameter 'target' when calling userFileActionsCopyPost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "target", target)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/file-actions/copy", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Move (rename) a file or a directory + * + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param path Path to the file/folder to rename. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @param target New name. It must be URL encoded, for example the path \"my dir/àdir\" must be sent as \"my%20dir%2F%C3%A0dir\" + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec userFileActionsMovePostRequestCreation(String path, String target) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'path' is set + if (path == null) { + throw new WebClientResponseException("Missing the required parameter 'path' when calling userFileActionsMovePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'target' is set + if (target == null) { + throw new WebClientResponseException("Missing the required parameter 'target' when calling userFileActionsMovePost", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "path", path)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "target", target)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"APIKeyAuth", "BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/file-actions/move", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Validate a one time authentication code + * Checks if the given authentication code can be validated using the specified secret and config name + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * + * @param validateAdminTotpSecretRequest The validateAdminTotpSecretRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec validateUserTotpSecretRequestCreation(ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest) throws WebClientResponseException { + Object postBody = validateAdminTotpSecretRequest; + // verify the required parameter 'validateAdminTotpSecretRequest' is set + if (validateAdminTotpSecretRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'validateAdminTotpSecretRequest' when calling validateUserTotpSecret", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[]{"BearerAuth"}; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() { + }; + return apiClient.invokeAPI("/user/totp/validate", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UsersApi.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UsersApi.java new file mode 100644 index 00000000..06787a11 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/api/UsersApi.java @@ -0,0 +1,871 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminResetPasswordRequest; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.reactive.function.client.WebClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class UsersApi { + private ApiClient apiClient; + + public UsersApi() { + this(new ApiClient()); + } + + @Autowired + public UsersApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add user + * Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param user The user parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return User + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addUserRequestCreation(User user, Integer confidentialData) throws WebClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new WebClientResponseException("Missing the required parameter 'user' when calling addUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add user + * Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param user The user parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return User + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono addUser(User user, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addUserRequestCreation(user, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Add user + * Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param user The user parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<User> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> addUserWithHttpInfo(User user, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return addUserRequestCreation(user, confidentialData).toEntity(localVarReturnType); + } + + /** + * Add user + * Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs + *

201 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param user The user parameter + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addUserWithResponseSpec(User user, Integer confidentialData) throws WebClientResponseException { + return addUserRequestCreation(user, confidentialData); + } + /** + * Delete user + * Deletes an existing user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteUserRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling deleteUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete user + * Deletes an existing user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono deleteUser(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteUserRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Delete user + * Deletes an existing user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> deleteUserWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return deleteUserRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Delete user + * Deletes an existing user + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserWithResponseSpec(String username) throws WebClientResponseException { + return deleteUserRequestCreation(username); + } + /** + * Disable second factor authentication + * Disables second factor authentication for the given user. This API must be used if the user loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec disableUser2faRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling disableUser2fa", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users/{username}/2fa/disable", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Disable second factor authentication + * Disables second factor authentication for the given user. This API must be used if the user loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono disableUser2fa(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return disableUser2faRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Disable second factor authentication + * Disables second factor authentication for the given user. This API must be used if the user loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> disableUser2faWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return disableUser2faRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Disable second factor authentication + * Disables second factor authentication for the given user. This API must be used if the user loses access to their second factor auth device and has no recovery codes + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec disableUser2faWithResponseSpec(String username) throws WebClientResponseException { + return disableUser2faRequestCreation(username); + } + /** + * Find users by username + * Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return User + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserByUsernameRequestCreation(String username, Integer confidentialData) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling getUserByUsername", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "confidential_data", confidentialData)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find users by username + * Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return User + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono getUserByUsername(String username, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUserByUsernameRequestCreation(username, confidentialData).bodyToMono(localVarReturnType); + } + + /** + * Find users by username + * Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseEntity<User> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> getUserByUsernameWithHttpInfo(String username, Integer confidentialData) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUserByUsernameRequestCreation(username, confidentialData).toEntity(localVarReturnType); + } + + /** + * Find users by username + * Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param confidentialData If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserByUsernameWithResponseSpec(String username, Integer confidentialData) throws WebClientResponseException { + return getUserByUsernameRequestCreation(username, confidentialData); + } + /** + * Get users + * Returns an array with one or more users. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering users by username. Default ASC + * @return List<User> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUsersRequestCreation(Integer offset, Integer limit, String order) throws WebClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "offset", offset)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "limit", limit)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get users + * Returns an array with one or more users. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering users by username. Default ASC + * @return List<User> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Flux getUsers(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUsersRequestCreation(offset, limit, order).bodyToFlux(localVarReturnType); + } + + /** + * Get users + * Returns an array with one or more users. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering users by username. Default ASC + * @return ResponseEntity<List<User>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono>> getUsersWithHttpInfo(Integer offset, Integer limit, String order) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return getUsersRequestCreation(offset, limit, order).toEntityList(localVarReturnType); + } + + /** + * Get users + * Returns an array with one or more users. For security reasons hashed passwords are omitted in the response + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param offset The offset parameter + * @param limit The maximum number of items to return. Max value is 500, default is 100 + * @param order Ordering users by username. Default ASC + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUsersWithResponseSpec(Integer offset, Integer limit, String order) throws WebClientResponseException { + return getUsersRequestCreation(offset, limit, order); + } + /** + * Update user + * Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param user The user parameter + * @param disconnect Disconnect: * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default * `1` The user will be disconnected after a successful update. It must login again and so it will be forced to use the new configuration + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateUserRequestCreation(String username, User user, Integer disconnect) throws WebClientResponseException { + Object postBody = user; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new WebClientResponseException("Missing the required parameter 'user' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "disconnect", disconnect)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "APIKeyAuth", "BearerAuth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update user + * Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param user The user parameter + * @param disconnect Disconnect: * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default * `1` The user will be disconnected after a successful update. It must login again and so it will be forced to use the new configuration + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono updateUser(String username, User user, Integer disconnect) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateUserRequestCreation(username, user, disconnect).bodyToMono(localVarReturnType); + } + + /** + * Update user + * Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param user The user parameter + * @param disconnect Disconnect: * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default * `1` The user will be disconnected after a successful update. It must login again and so it will be forced to use the new configuration + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> updateUserWithHttpInfo(String username, User user, Integer disconnect) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return updateUserRequestCreation(username, user, disconnect).toEntity(localVarReturnType); + } + + /** + * Update user + * Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param user The user parameter + * @param disconnect Disconnect: * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default * `1` The user will be disconnected after a successful update. It must login again and so it will be forced to use the new configuration + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateUserWithResponseSpec(String username, User user, Integer disconnect) throws WebClientResponseException { + return updateUserRequestCreation(username, user, disconnect); + } + /** + * Send a password reset code by email + * You must configure an SMTP server, the account must have a valid email address and must not have the \"reset-password-disabled\" restriction, in which case SFTPGo will send a code via email to reset the password. If the specified user does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing users + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec userForgotPasswordRequestCreation(String username) throws WebClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling userForgotPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users/{username}/forgot-password", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Send a password reset code by email + * You must configure an SMTP server, the account must have a valid email address and must not have the \"reset-password-disabled\" restriction, in which case SFTPGo will send a code via email to reset the password. If the specified user does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing users + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono userForgotPassword(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userForgotPasswordRequestCreation(username).bodyToMono(localVarReturnType); + } + + /** + * Send a password reset code by email + * You must configure an SMTP server, the account must have a valid email address and must not have the \"reset-password-disabled\" restriction, in which case SFTPGo will send a code via email to reset the password. If the specified user does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing users + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> userForgotPasswordWithHttpInfo(String username) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userForgotPasswordRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Send a password reset code by email + * You must configure an SMTP server, the account must have a valid email address and must not have the \"reset-password-disabled\" restriction, in which case SFTPGo will send a code via email to reset the password. If the specified user does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing users + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec userForgotPasswordWithResponseSpec(String username) throws WebClientResponseException { + return userForgotPasswordRequestCreation(username); + } + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec userResetPasswordRequestCreation(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + Object postBody = adminResetPasswordRequest; + // verify the required parameter 'username' is set + if (username == null) { + throw new WebClientResponseException("Missing the required parameter 'username' when calling userResetPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'adminResetPasswordRequest' is set + if (adminResetPasswordRequest == null) { + throw new WebClientResponseException("Missing the required parameter 'adminResetPasswordRequest' when calling userResetPassword", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/users/{username}/reset-password", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ModelApiResponse + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono userResetPassword(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userResetPasswordRequestCreation(username, adminResetPasswordRequest).bodyToMono(localVarReturnType); + } + + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public Mono> userResetPasswordWithHttpInfo(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; + return userResetPasswordRequestCreation(username, adminResetPasswordRequest).toEntity(localVarReturnType); + } + + /** + * Reset the password + * Set a new password using the code received via email + *

200 - successful operation + *

400 - Bad Request + *

401 - Unauthorized + *

403 - Forbidden + *

404 - Not Found + *

500 - Internal Server Error + *

0 - Unexpected Error + * @param username the username + * @param adminResetPasswordRequest The adminResetPasswordRequest parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec userResetPasswordWithResponseSpec(String username, AdminResetPasswordRequest adminResetPasswordRequest) throws WebClientResponseException { + return userResetPasswordRequestCreation(username, adminResetPasswordRequest); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ApiClient.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ApiClient.java new file mode 100644 index 00000000..dc8e4a84 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ApiClient.java @@ -0,0 +1,736 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.ApiKeyAuth; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.Authentication; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.HttpBasicAuth; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.HttpBearerAuth; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; +import org.springframework.http.client.reactive.ClientHttpRequest; +import org.springframework.http.codec.json.Jackson2JsonDecoder; +import org.springframework.http.codec.json.Jackson2JsonEncoder; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.reactive.function.BodyInserter; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.ExchangeStrategies; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; +import org.springframework.web.util.UriComponentsBuilder; + +import javax.annotation.Nullable; +import java.text.DateFormat; +import java.text.ParseException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.Map.Entry; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ApiClient extends JavaTimeFormatter { + private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate"; + private final WebClient webClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + private HttpHeaders defaultHeaders = new HttpHeaders(); + private MultiValueMap defaultCookies = new LinkedMultiValueMap(); + private String basePath = "/api/v2"; + private Map authentications; + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.webClient = buildWebClient(this.objectMapper); + this.init(); + } + + + public ApiClient(WebClient webClient) { + this(Optional.ofNullable(webClient).orElseGet(() -> buildWebClient()), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildWebClient(mapper.copy()), format); + } + + public ApiClient(WebClient webClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(webClient).orElseGet(() -> buildWebClient(mapper.copy())), format); + } + + private ApiClient(WebClient webClient, DateFormat format) { + this.webClient = webClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + } + + /** + * Build the WebClientBuilder used to make WebClient. + * + * @param mapper ObjectMapper used for serialize/deserialize + * @return WebClient + */ + public static WebClient.Builder buildWebClientBuilder(ObjectMapper mapper) { + ExchangeStrategies strategies = ExchangeStrategies + .builder() + .codecs(clientDefaultCodecsConfigurer -> { + clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper, MediaType.APPLICATION_JSON)); + clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper, MediaType.APPLICATION_JSON)); + }).build(); + WebClient.Builder webClientBuilder = WebClient.builder().exchangeStrategies(strategies); + return webClientBuilder; + } + + /** + * Build the WebClientBuilder used to make WebClient. + * + * @return WebClient + */ + public static WebClient.Builder buildWebClientBuilder() { + return buildWebClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the WebClient used to make HTTP requests. + * + * @param mapper ObjectMapper used for serialize/deserialize + * @return WebClient + */ + public static WebClient buildWebClient(ObjectMapper mapper) { + return buildWebClientBuilder(mapper).build(); + } + + /** + * Build the WebClient used to make HTTP requests. + * + * @return WebClient + */ + public static WebClient buildWebClient() { + return buildWebClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the WebClient used to make HTTP requests. + * + * @return WebClient webClient + */ + public WebClient getWebClient() { + return webClient; + } + + /** + * Format the given parameter object into string. + * + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if (collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()) { + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList(); + for (Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if (collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if (contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + requestBuilder.attribute(URI_TEMPLATE_ATTRIBUTE, path); + + requestBuilder.body(selectBody(body, formParams, contentType)); + return requestBuilder; + } + + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + + private CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + authentications.put("BasicAuth", new HttpBasicAuth()); + authentications.put("BearerAuth", new HttpBearerAuth("bearer")); + authentications.put("APIKeyAuth", new ApiKeyAuth("header", "X-SFTPGO-API-KEY")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected BodyInserter selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + if (MediaType.APPLICATION_FORM_URLENCODED.equals(contentType)) { + MultiValueMap map = new LinkedMultiValueMap<>(); + + formParams + .toSingleValueMap() + .entrySet() + .forEach(es -> map.add(es.getKey(), String.valueOf(es.getValue()))); + + return BodyInserters.fromFormData(map); + } else if (MediaType.MULTIPART_FORM_DATA.equals(contentType)) { + return BodyInserters.fromMultipartData(formParams); + } else { + return obj != null ? BodyInserters.fromValue(obj) : null; + } + } + + /** + * Add headers to the request that is being built + * + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, WebClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for (String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, WebClient.RequestBodySpec requestBuilder) { + for (Entry> entry : cookies.entrySet()) { + List values = entry.getValue(); + for (String value : values) { + if (value != null) { + requestBuilder.cookie(entry.getKey(), value); + } + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/JavaTimeFormatter.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/JavaTimeFormatter.java new file mode 100644 index 00000000..c15f5983 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/RFC3339DateFormat.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/RFC3339DateFormat.java new file mode 100644 index 00000000..38680f25 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerConfiguration.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerConfiguration.java new file mode 100644 index 00000000..93dd2091 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerVariable.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerVariable.java new file mode 100644 index 00000000..511e611b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/StringUtil.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/StringUtil.java new file mode 100644 index 00000000..943d61f9 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/StringUtil.java @@ -0,0 +1,83 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/ApiKeyAuth.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/ApiKeyAuth.java new file mode 100644 index 00000000..a11cb486 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/ApiKeyAuth.java @@ -0,0 +1,75 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/Authentication.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/Authentication.java new file mode 100644 index 00000000..61c405a4 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/Authentication.java @@ -0,0 +1,27 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBasicAuth.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBasicAuth.java new file mode 100644 index 00000000..c3e152dd --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBasicAuth.java @@ -0,0 +1,51 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBearerAuth.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBearerAuth.java new file mode 100644 index 00000000..0504281b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/invoker/auth/HttpBearerAuth.java @@ -0,0 +1,48 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + public String getBearerToken() { + return bearerToken; + } + + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } + +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKey.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKey.java new file mode 100644 index 00000000..e95f95c0 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKey.java @@ -0,0 +1,414 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.APIKeyScope; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * APIKey + */ +@JsonPropertyOrder({ + APIKey.JSON_PROPERTY_ID, + APIKey.JSON_PROPERTY_NAME, + APIKey.JSON_PROPERTY_KEY, + APIKey.JSON_PROPERTY_SCOPE, + APIKey.JSON_PROPERTY_CREATED_AT, + APIKey.JSON_PROPERTY_UPDATED_AT, + APIKey.JSON_PROPERTY_LAST_USE_AT, + APIKey.JSON_PROPERTY_EXPIRES_AT, + APIKey.JSON_PROPERTY_DESCRIPTION, + APIKey.JSON_PROPERTY_USER, + APIKey.JSON_PROPERTY_ADMIN +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class APIKey { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_SCOPE = "scope"; + private APIKeyScope scope; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_LAST_USE_AT = "last_use_at"; + private Long lastUseAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Long expiresAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_USER = "user"; + private String user; + + public static final String JSON_PROPERTY_ADMIN = "admin"; + private String admin; + + public APIKey() { + } + + public APIKey id(String id) { + + this.id = id; + return this; + } + + /** + * unique key identifier + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + public APIKey name(String name) { + + this.name = name; + return this; + } + + /** + * User friendly key name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public APIKey key(String key) { + + this.key = key; + return this; + } + + /** + * We store the hash of the key. This is just like a password. For security reasons this field is omitted when you search/get API keys + * @return key + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(String key) { + this.key = key; + } + + public APIKey scope(APIKeyScope scope) { + + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public APIKeyScope getScope() { + return scope; + } + + + @JsonProperty(JSON_PROPERTY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScope(APIKeyScope scope) { + this.scope = scope; + } + + public APIKey createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public APIKey updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in milliseconds + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public APIKey lastUseAt(Long lastUseAt) { + + this.lastUseAt = lastUseAt; + return this; + } + + /** + * last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes + * @return lastUseAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_USE_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastUseAt() { + return lastUseAt; + } + + + @JsonProperty(JSON_PROPERTY_LAST_USE_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUseAt(Long lastUseAt) { + this.lastUseAt = lastUseAt; + } + + public APIKey expiresAt(Long expiresAt) { + + this.expiresAt = expiresAt; + return this; + } + + /** + * expiration time as unix timestamp in milliseconds + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Long expiresAt) { + this.expiresAt = expiresAt; + } + + public APIKey description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public APIKey user(String user) { + + this.user = user; + return this; + } + + /** + * username associated with this API key. If empty and the scope is \"user scope\" the key can impersonate any user + * @return user + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUser() { + return user; + } + + + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUser(String user) { + this.user = user; + } + + public APIKey admin(String admin) { + + this.admin = admin; + return this; + } + + /** + * admin associated with this API key. If empty and the scope is \"admin scope\" the key can impersonate any admin + * @return admin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADMIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAdmin() { + return admin; + } + + + @JsonProperty(JSON_PROPERTY_ADMIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdmin(String admin) { + this.admin = admin; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APIKey apIKey = (APIKey) o; + return Objects.equals(this.id, apIKey.id) && + Objects.equals(this.name, apIKey.name) && + Objects.equals(this.key, apIKey.key) && + Objects.equals(this.scope, apIKey.scope) && + Objects.equals(this.createdAt, apIKey.createdAt) && + Objects.equals(this.updatedAt, apIKey.updatedAt) && + Objects.equals(this.lastUseAt, apIKey.lastUseAt) && + Objects.equals(this.expiresAt, apIKey.expiresAt) && + Objects.equals(this.description, apIKey.description) && + Objects.equals(this.user, apIKey.user) && + Objects.equals(this.admin, apIKey.admin); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, key, scope, createdAt, updatedAt, lastUseAt, expiresAt, description, user, admin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APIKey {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" key: ").append("*").append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastUseAt: ").append(toIndentedString(lastUseAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" admin: ").append(toIndentedString(admin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKeyScope.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKeyScope.java new file mode 100644 index 00000000..8ea47144 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/APIKeyScope.java @@ -0,0 +1,59 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Options: * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin * `2` - user scope. The API key will be used to impersonate an SFTPGo user + */ +public enum APIKeyScope { + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + APIKeyScope(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static APIKeyScope fromValue(Integer value) { + for (APIKeyScope b : APIKeyScope.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AddApiKey201Response.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AddApiKey201Response.java new file mode 100644 index 00000000..8ffc3a71 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AddApiKey201Response.java @@ -0,0 +1,135 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AddApiKey201Response + */ +@JsonPropertyOrder({ + AddApiKey201Response.JSON_PROPERTY_MESAGE, + AddApiKey201Response.JSON_PROPERTY_KEY +}) +@JsonTypeName("add_api_key_201_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AddApiKey201Response { + public static final String JSON_PROPERTY_MESAGE = "mesage"; + private String mesage; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public AddApiKey201Response() { + } + + public AddApiKey201Response mesage(String mesage) { + + this.mesage = mesage; + return this; + } + + /** + * Get mesage + * @return mesage + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMesage() { + return mesage; + } + + + @JsonProperty(JSON_PROPERTY_MESAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMesage(String mesage) { + this.mesage = mesage; + } + + public AddApiKey201Response key(String key) { + + this.key = key; + return this; + } + + /** + * generated API key + * @return key + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(String key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddApiKey201Response addApiKey201Response = (AddApiKey201Response) o; + return Objects.equals(this.mesage, addApiKey201Response.mesage) && + Objects.equals(this.key, addApiKey201Response.key); + } + + @Override + public int hashCode() { + return Objects.hash(mesage, key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddApiKey201Response {\n"); + sb.append(" mesage: ").append(toIndentedString(mesage)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Admin.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Admin.java new file mode 100644 index 00000000..b1a3440b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Admin.java @@ -0,0 +1,564 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminFilters; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminGroupMapping; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminPermissions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Admin + */ +@JsonPropertyOrder({ + Admin.JSON_PROPERTY_ID, + Admin.JSON_PROPERTY_STATUS, + Admin.JSON_PROPERTY_USERNAME, + Admin.JSON_PROPERTY_DESCRIPTION, + Admin.JSON_PROPERTY_PASSWORD, + Admin.JSON_PROPERTY_EMAIL, + Admin.JSON_PROPERTY_PERMISSIONS, + Admin.JSON_PROPERTY_FILTERS, + Admin.JSON_PROPERTY_ADDITIONAL_INFO, + Admin.JSON_PROPERTY_GROUPS, + Admin.JSON_PROPERTY_CREATED_AT, + Admin.JSON_PROPERTY_UPDATED_AT, + Admin.JSON_PROPERTY_LAST_LOGIN, + Admin.JSON_PROPERTY_ROLE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Admin { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + /** + * status: * `0` user is disabled, login is not allowed * `1` user is enabled + */ + public enum StatusEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + StatusEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(Integer value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private List permissions = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILTERS = "filters"; + private AdminFilters filters; + + public static final String JSON_PROPERTY_ADDITIONAL_INFO = "additional_info"; + private String additionalInfo; + + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_LAST_LOGIN = "last_login"; + private Long lastLogin; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public Admin() { + } + + public Admin id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public Admin status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * status: * `0` user is disabled, login is not allowed * `1` user is enabled + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Admin username(String username) { + + this.username = username; + return this; + } + + /** + * username is unique + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public Admin description(String description) { + + this.description = description; + return this; + } + + /** + * optional description, for example the admin full name + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public Admin password(String password) { + + this.password = password; + return this; + } + + /** + * Admin password. For security reasons this field is omitted when you search/get admins + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public Admin email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public Admin permissions(List permissions) { + + this.permissions = permissions; + return this; + } + + public Admin addPermissionsItem(AdminPermissions permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Get permissions + * @return permissions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPermissions() { + return permissions; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPermissions(List permissions) { + this.permissions = permissions; + } + + public Admin filters(AdminFilters filters) { + + this.filters = filters; + return this; + } + + /** + * Get filters + * @return filters + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AdminFilters getFilters() { + return filters; + } + + + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilters(AdminFilters filters) { + this.filters = filters; + } + + public Admin additionalInfo(String additionalInfo) { + + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Free form text field + * @return additionalInfo + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDITIONAL_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAdditionalInfo() { + return additionalInfo; + } + + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public Admin groups(List groups) { + + this.groups = groups; + return this; + } + + public Admin addGroupsItem(AdminGroupMapping groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Groups automatically selected for new users created by this admin. The admin will still be able to choose different groups. These settings are only used for this admin UI and they will be ignored in REST API/hooks. + * @return groups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroups() { + return groups; + } + + + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroups(List groups) { + this.groups = groups; + } + + public Admin createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0 + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public Admin updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in milliseconds + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public Admin lastLogin(Long lastLogin) { + + this.lastLogin = lastLogin; + return this; + } + + /** + * Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes + * @return lastLogin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastLogin() { + return lastLogin; + } + + + @JsonProperty(JSON_PROPERTY_LAST_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastLogin(Long lastLogin) { + this.lastLogin = lastLogin; + } + + public Admin role(String role) { + + this.role = role; + return this; + } + + /** + * If set the admin can only administer users with the same role. Role admins cannot have the \"*\" permission + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Admin admin = (Admin) o; + return Objects.equals(this.id, admin.id) && + Objects.equals(this.status, admin.status) && + Objects.equals(this.username, admin.username) && + Objects.equals(this.description, admin.description) && + Objects.equals(this.password, admin.password) && + Objects.equals(this.email, admin.email) && + Objects.equals(this.permissions, admin.permissions) && + Objects.equals(this.filters, admin.filters) && + Objects.equals(this.additionalInfo, admin.additionalInfo) && + Objects.equals(this.groups, admin.groups) && + Objects.equals(this.createdAt, admin.createdAt) && + Objects.equals(this.updatedAt, admin.updatedAt) && + Objects.equals(this.lastLogin, admin.lastLogin) && + Objects.equals(this.role, admin.role); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, username, description, password, email, permissions, filters, additionalInfo, groups, createdAt, updatedAt, lastLogin, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Admin {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastLogin: ").append(toIndentedString(lastLogin)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminFilters.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminFilters.java new file mode 100644 index 00000000..6fbb3822 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminFilters.java @@ -0,0 +1,311 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminPreferences; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminTOTPConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.RecoveryCode; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminFilters + */ +@JsonPropertyOrder({ + AdminFilters.JSON_PROPERTY_ALLOW_LIST, + AdminFilters.JSON_PROPERTY_ALLOW_API_KEY_AUTH, + AdminFilters.JSON_PROPERTY_REQUIRE_TWO_FACTOR, + AdminFilters.JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE, + AdminFilters.JSON_PROPERTY_TOTP_CONFIG, + AdminFilters.JSON_PROPERTY_RECOVERY_CODES, + AdminFilters.JSON_PROPERTY_PREFERENCES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminFilters { + public static final String JSON_PROPERTY_ALLOW_LIST = "allow_list"; + private List allowList = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_API_KEY_AUTH = "allow_api_key_auth"; + private Boolean allowApiKeyAuth; + + public static final String JSON_PROPERTY_REQUIRE_TWO_FACTOR = "require_two_factor"; + private Boolean requireTwoFactor; + + public static final String JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE = "require_password_change"; + private Boolean requirePasswordChange; + + public static final String JSON_PROPERTY_TOTP_CONFIG = "totp_config"; + private AdminTOTPConfig totpConfig; + + public static final String JSON_PROPERTY_RECOVERY_CODES = "recovery_codes"; + private List recoveryCodes = new ArrayList<>(); + + public static final String JSON_PROPERTY_PREFERENCES = "preferences"; + private AdminPreferences preferences; + + public AdminFilters() { + } + + public AdminFilters allowList(List allowList) { + + this.allowList = allowList; + return this; + } + + public AdminFilters addAllowListItem(String allowListItem) { + if (this.allowList == null) { + this.allowList = new ArrayList<>(); + } + this.allowList.add(allowListItem); + return this; + } + + /** + * only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example \"192.0.2.0/24\" or \"2001:db8::/32\" + * @return allowList + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAllowList() { + return allowList; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowList(List allowList) { + this.allowList = allowList; + } + + public AdminFilters allowApiKeyAuth(Boolean allowApiKeyAuth) { + + this.allowApiKeyAuth = allowApiKeyAuth; + return this; + } + + /** + * API key auth allows to impersonate this administrator with an API key + * @return allowApiKeyAuth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowApiKeyAuth() { + return allowApiKeyAuth; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowApiKeyAuth(Boolean allowApiKeyAuth) { + this.allowApiKeyAuth = allowApiKeyAuth; + } + + public AdminFilters requireTwoFactor(Boolean requireTwoFactor) { + + this.requireTwoFactor = requireTwoFactor; + return this; + } + + /** + * Get requireTwoFactor + * @return requireTwoFactor + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRE_TWO_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequireTwoFactor() { + return requireTwoFactor; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRE_TWO_FACTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequireTwoFactor(Boolean requireTwoFactor) { + this.requireTwoFactor = requireTwoFactor; + } + + public AdminFilters requirePasswordChange(Boolean requirePasswordChange) { + + this.requirePasswordChange = requirePasswordChange; + return this; + } + + /** + * Get requirePasswordChange + * @return requirePasswordChange + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequirePasswordChange() { + return requirePasswordChange; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirePasswordChange(Boolean requirePasswordChange) { + this.requirePasswordChange = requirePasswordChange; + } + + public AdminFilters totpConfig(AdminTOTPConfig totpConfig) { + + this.totpConfig = totpConfig; + return this; + } + + /** + * Get totpConfig + * @return totpConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AdminTOTPConfig getTotpConfig() { + return totpConfig; + } + + + @JsonProperty(JSON_PROPERTY_TOTP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotpConfig(AdminTOTPConfig totpConfig) { + this.totpConfig = totpConfig; + } + + public AdminFilters recoveryCodes(List recoveryCodes) { + + this.recoveryCodes = recoveryCodes; + return this; + } + + public AdminFilters addRecoveryCodesItem(RecoveryCode recoveryCodesItem) { + if (this.recoveryCodes == null) { + this.recoveryCodes = new ArrayList<>(); + } + this.recoveryCodes.add(recoveryCodesItem); + return this; + } + + /** + * Get recoveryCodes + * @return recoveryCodes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECOVERY_CODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRecoveryCodes() { + return recoveryCodes; + } + + + @JsonProperty(JSON_PROPERTY_RECOVERY_CODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecoveryCodes(List recoveryCodes) { + this.recoveryCodes = recoveryCodes; + } + + public AdminFilters preferences(AdminPreferences preferences) { + + this.preferences = preferences; + return this; + } + + /** + * Get preferences + * @return preferences + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFERENCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AdminPreferences getPreferences() { + return preferences; + } + + + @JsonProperty(JSON_PROPERTY_PREFERENCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreferences(AdminPreferences preferences) { + this.preferences = preferences; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminFilters adminFilters = (AdminFilters) o; + return Objects.equals(this.allowList, adminFilters.allowList) && + Objects.equals(this.allowApiKeyAuth, adminFilters.allowApiKeyAuth) && + Objects.equals(this.requireTwoFactor, adminFilters.requireTwoFactor) && + Objects.equals(this.requirePasswordChange, adminFilters.requirePasswordChange) && + Objects.equals(this.totpConfig, adminFilters.totpConfig) && + Objects.equals(this.recoveryCodes, adminFilters.recoveryCodes) && + Objects.equals(this.preferences, adminFilters.preferences); + } + + @Override + public int hashCode() { + return Objects.hash(allowList, allowApiKeyAuth, requireTwoFactor, requirePasswordChange, totpConfig, recoveryCodes, preferences); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminFilters {\n"); + sb.append(" allowList: ").append(toIndentedString(allowList)).append("\n"); + sb.append(" allowApiKeyAuth: ").append(toIndentedString(allowApiKeyAuth)).append("\n"); + sb.append(" requireTwoFactor: ").append(toIndentedString(requireTwoFactor)).append("\n"); + sb.append(" requirePasswordChange: ").append(toIndentedString(requirePasswordChange)).append("\n"); + sb.append(" totpConfig: ").append(toIndentedString(totpConfig)).append("\n"); + sb.append(" recoveryCodes: ").append(toIndentedString(recoveryCodes)).append("\n"); + sb.append(" preferences: ").append(toIndentedString(preferences)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMapping.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMapping.java new file mode 100644 index 00000000..fdae603f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMapping.java @@ -0,0 +1,135 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AdminGroupMappingOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminGroupMapping + */ +@JsonPropertyOrder({ + AdminGroupMapping.JSON_PROPERTY_NAME, + AdminGroupMapping.JSON_PROPERTY_OPTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminGroupMapping { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private AdminGroupMappingOptions options; + + public AdminGroupMapping() { + } + + public AdminGroupMapping name(String name) { + + this.name = name; + return this; + } + + /** + * group name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public AdminGroupMapping options(AdminGroupMappingOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AdminGroupMappingOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(AdminGroupMappingOptions options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminGroupMapping adminGroupMapping = (AdminGroupMapping) o; + return Objects.equals(this.name, adminGroupMapping.name) && + Objects.equals(this.options, adminGroupMapping.options); + } + + @Override + public int hashCode() { + return Objects.hash(name, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminGroupMapping {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMappingOptions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMappingOptions.java new file mode 100644 index 00000000..e65c7f3e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminGroupMappingOptions.java @@ -0,0 +1,141 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminGroupMappingOptions + */ +@JsonPropertyOrder({ + AdminGroupMappingOptions.JSON_PROPERTY_ADD_TO_USERS_AS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminGroupMappingOptions { + /** + * Add to new users as: * `0` - the admin's group will be added as membership group for new users * `1` - the admin's group will be added as primary group for new users * `2` - the admin's group will be added as secondary group for new users + */ + public enum AddToUsersAsEnum { + NUMBER_0(new BigDecimal("0")), + + NUMBER_1(new BigDecimal("1")), + + NUMBER_2(new BigDecimal("2")); + + private BigDecimal value; + + AddToUsersAsEnum(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AddToUsersAsEnum fromValue(BigDecimal value) { + for (AddToUsersAsEnum b : AddToUsersAsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ADD_TO_USERS_AS = "add_to_users_as"; + private AddToUsersAsEnum addToUsersAs; + + public AdminGroupMappingOptions() { + } + + public AdminGroupMappingOptions addToUsersAs(AddToUsersAsEnum addToUsersAs) { + + this.addToUsersAs = addToUsersAs; + return this; + } + + /** + * Add to new users as: * `0` - the admin's group will be added as membership group for new users * `1` - the admin's group will be added as primary group for new users * `2` - the admin's group will be added as secondary group for new users + * @return addToUsersAs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADD_TO_USERS_AS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AddToUsersAsEnum getAddToUsersAs() { + return addToUsersAs; + } + + + @JsonProperty(JSON_PROPERTY_ADD_TO_USERS_AS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddToUsersAs(AddToUsersAsEnum addToUsersAs) { + this.addToUsersAs = addToUsersAs; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminGroupMappingOptions adminGroupMappingOptions = (AdminGroupMappingOptions) o; + return Objects.equals(this.addToUsersAs, adminGroupMappingOptions.addToUsersAs); + } + + @Override + public int hashCode() { + return Objects.hash(addToUsersAs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminGroupMappingOptions {\n"); + sb.append(" addToUsersAs: ").append(toIndentedString(addToUsersAs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPermissions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPermissions.java new file mode 100644 index 00000000..1554c3fd --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPermissions.java @@ -0,0 +1,85 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Admin permissions: * `*` - super admin permissions are granted * `add_users` - add new users is allowed * `edit_users` - change existing users is allowed * `del_users` - remove users is allowed * `view_users` - list users is allowed * `view_conns` - list active connections is allowed * `close_conns` - close active connections is allowed * `view_status` - view the server status is allowed * `manage_folders` - manage folders is allowed * `manage_groups` - manage groups is allowed * `quota_scans` - view and start quota scans is allowed * `manage_defender` - remove ip from the dynamic blocklist is allowed * `view_defender` - list the dynamic blocklist is allowed * `view_events` - view and search filesystem and provider events is allowed * `disable_mfa` - allow to disable two-factor authentication for users and admins + */ +public enum AdminPermissions { + + STAR("*"), + + ADD_USERS("add_users"), + + EDIT_USERS("edit_users"), + + DEL_USERS("del_users"), + + VIEW_USERS("view_users"), + + VIEW_CONNS("view_conns"), + + CLOSE_CONNS("close_conns"), + + VIEW_STATUS("view_status"), + + MANAGE_FOLDERS("manage_folders"), + + MANAGE_GROUPS("manage_groups"), + + QUOTA_SCANS("quota_scans"), + + MANAGE_DEFENDER("manage_defender"), + + VIEW_DEFENDER("view_defender"), + + VIEW_EVENTS("view_events"), + + DISABLE_MFA("disable_mfa"); + + private String value; + + AdminPermissions(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AdminPermissions fromValue(String value) { + for (AdminPermissions b : AdminPermissions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPreferences.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPreferences.java new file mode 100644 index 00000000..65e2d29c --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminPreferences.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminPreferences + */ +@JsonPropertyOrder({ + AdminPreferences.JSON_PROPERTY_HIDE_USER_PAGE_SECTIONS, + AdminPreferences.JSON_PROPERTY_DEFAULT_USERS_EXPIRATION +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminPreferences { + public static final String JSON_PROPERTY_HIDE_USER_PAGE_SECTIONS = "hide_user_page_sections"; + private Integer hideUserPageSections; + + public static final String JSON_PROPERTY_DEFAULT_USERS_EXPIRATION = "default_users_expiration"; + private Integer defaultUsersExpiration; + + public AdminPreferences() { + } + + public AdminPreferences hideUserPageSections(Integer hideUserPageSections) { + + this.hideUserPageSections = hideUserPageSections; + return this; + } + + /** + * Allow to hide some sections from the user page. These are not security settings and are not enforced server side in any way. They are only intended to simplify the user page in the WebAdmin UI. 1 means hide groups section, 2 means hide filesystem section, \"users_base_dir\" must be set in the config file otherwise this setting is ignored, 4 means hide virtual folders section, 8 means hide profile section, 16 means hide ACLs section, 32 means hide disk and bandwidth quota limits section, 64 means hide advanced settings section. The settings can be combined + * @return hideUserPageSections + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_USER_PAGE_SECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getHideUserPageSections() { + return hideUserPageSections; + } + + + @JsonProperty(JSON_PROPERTY_HIDE_USER_PAGE_SECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHideUserPageSections(Integer hideUserPageSections) { + this.hideUserPageSections = hideUserPageSections; + } + + public AdminPreferences defaultUsersExpiration(Integer defaultUsersExpiration) { + + this.defaultUsersExpiration = defaultUsersExpiration; + return this; + } + + /** + * Defines the default expiration for newly created users as number of days. 0 means no expiration + * @return defaultUsersExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_USERS_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultUsersExpiration() { + return defaultUsersExpiration; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_USERS_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultUsersExpiration(Integer defaultUsersExpiration) { + this.defaultUsersExpiration = defaultUsersExpiration; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminPreferences adminPreferences = (AdminPreferences) o; + return Objects.equals(this.hideUserPageSections, adminPreferences.hideUserPageSections) && + Objects.equals(this.defaultUsersExpiration, adminPreferences.defaultUsersExpiration); + } + + @Override + public int hashCode() { + return Objects.hash(hideUserPageSections, defaultUsersExpiration); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminPreferences {\n"); + sb.append(" hideUserPageSections: ").append(toIndentedString(hideUserPageSections)).append("\n"); + sb.append(" defaultUsersExpiration: ").append(toIndentedString(defaultUsersExpiration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminProfile.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminProfile.java new file mode 100644 index 00000000..15a50efd --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminProfile.java @@ -0,0 +1,165 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminProfile + */ +@JsonPropertyOrder({ + AdminProfile.JSON_PROPERTY_EMAIL, + AdminProfile.JSON_PROPERTY_DESCRIPTION, + AdminProfile.JSON_PROPERTY_ALLOW_API_KEY_AUTH +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminProfile { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ALLOW_API_KEY_AUTH = "allow_api_key_auth"; + private Boolean allowApiKeyAuth; + + public AdminProfile() { + } + + public AdminProfile email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public AdminProfile description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public AdminProfile allowApiKeyAuth(Boolean allowApiKeyAuth) { + + this.allowApiKeyAuth = allowApiKeyAuth; + return this; + } + + /** + * If enabled, you can impersonate this admin, in REST API, using an API key. If disabled admin credentials are required for impersonation + * @return allowApiKeyAuth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowApiKeyAuth() { + return allowApiKeyAuth; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowApiKeyAuth(Boolean allowApiKeyAuth) { + this.allowApiKeyAuth = allowApiKeyAuth; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminProfile adminProfile = (AdminProfile) o; + return Objects.equals(this.email, adminProfile.email) && + Objects.equals(this.description, adminProfile.description) && + Objects.equals(this.allowApiKeyAuth, adminProfile.allowApiKeyAuth); + } + + @Override + public int hashCode() { + return Objects.hash(email, description, allowApiKeyAuth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminProfile {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" allowApiKeyAuth: ").append(toIndentedString(allowApiKeyAuth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminResetPasswordRequest.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminResetPasswordRequest.java new file mode 100644 index 00000000..f46dec4d --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminResetPasswordRequest.java @@ -0,0 +1,135 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminResetPasswordRequest + */ +@JsonPropertyOrder({ + AdminResetPasswordRequest.JSON_PROPERTY_CODE, + AdminResetPasswordRequest.JSON_PROPERTY_PASSWORD +}) +@JsonTypeName("admin_reset_password_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminResetPasswordRequest { + public static final String JSON_PROPERTY_CODE = "code"; + private String code; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public AdminResetPasswordRequest() { + } + + public AdminResetPasswordRequest code(String code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(String code) { + this.code = code; + } + + public AdminResetPasswordRequest password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminResetPasswordRequest adminResetPasswordRequest = (AdminResetPasswordRequest) o; + return Objects.equals(this.code, adminResetPasswordRequest.code) && + Objects.equals(this.password, adminResetPasswordRequest.password); + } + + @Override + public int hashCode() { + return Objects.hash(code, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminResetPasswordRequest {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminTOTPConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminTOTPConfig.java new file mode 100644 index 00000000..843b86eb --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AdminTOTPConfig.java @@ -0,0 +1,166 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdminTOTPConfig + */ +@JsonPropertyOrder({ + AdminTOTPConfig.JSON_PROPERTY_ENABLED, + AdminTOTPConfig.JSON_PROPERTY_CONFIG_NAME, + AdminTOTPConfig.JSON_PROPERTY_SECRET +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AdminTOTPConfig { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private Secret secret; + + public AdminTOTPConfig() { + } + + public AdminTOTPConfig enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AdminTOTPConfig configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * This name must be defined within the \"totp\" section of the SFTPGo configuration file. You will be unable to save a user/admin referencing a missing config_name + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + public AdminTOTPConfig secret(Secret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(Secret secret) { + this.secret = secret; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdminTOTPConfig adminTOTPConfig = (AdminTOTPConfig) o; + return Objects.equals(this.enabled, adminTOTPConfig.enabled) && + Objects.equals(this.configName, adminTOTPConfig.configName) && + Objects.equals(this.secret, adminTOTPConfig.secret); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, configName, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminTOTPConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AzureBlobFsConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AzureBlobFsConfig.java new file mode 100644 index 00000000..5b809ee4 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/AzureBlobFsConfig.java @@ -0,0 +1,484 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure Blob Storage configuration details + */ +@JsonPropertyOrder({ + AzureBlobFsConfig.JSON_PROPERTY_CONTAINER, + AzureBlobFsConfig.JSON_PROPERTY_ACCOUNT_NAME, + AzureBlobFsConfig.JSON_PROPERTY_ACCOUNT_KEY, + AzureBlobFsConfig.JSON_PROPERTY_SAS_URL, + AzureBlobFsConfig.JSON_PROPERTY_ENDPOINT, + AzureBlobFsConfig.JSON_PROPERTY_UPLOAD_PART_SIZE, + AzureBlobFsConfig.JSON_PROPERTY_UPLOAD_CONCURRENCY, + AzureBlobFsConfig.JSON_PROPERTY_DOWNLOAD_PART_SIZE, + AzureBlobFsConfig.JSON_PROPERTY_DOWNLOAD_CONCURRENCY, + AzureBlobFsConfig.JSON_PROPERTY_ACCESS_TIER, + AzureBlobFsConfig.JSON_PROPERTY_KEY_PREFIX, + AzureBlobFsConfig.JSON_PROPERTY_USE_EMULATOR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class AzureBlobFsConfig { + public static final String JSON_PROPERTY_CONTAINER = "container"; + private String container; + + public static final String JSON_PROPERTY_ACCOUNT_NAME = "account_name"; + private String accountName; + + public static final String JSON_PROPERTY_ACCOUNT_KEY = "account_key"; + private Secret accountKey; + + public static final String JSON_PROPERTY_SAS_URL = "sas_url"; + private Secret sasUrl; + + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_UPLOAD_PART_SIZE = "upload_part_size"; + private Integer uploadPartSize; + + public static final String JSON_PROPERTY_UPLOAD_CONCURRENCY = "upload_concurrency"; + private Integer uploadConcurrency; + + public static final String JSON_PROPERTY_DOWNLOAD_PART_SIZE = "download_part_size"; + private Integer downloadPartSize; + + public static final String JSON_PROPERTY_DOWNLOAD_CONCURRENCY = "download_concurrency"; + private Integer downloadConcurrency; + + /** + * Gets or Sets accessTier + */ + public enum AccessTierEnum { + EMPTY(""), + + ARCHIVE("Archive"), + + HOT("Hot"), + + COOL("Cool"); + + private String value; + + AccessTierEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AccessTierEnum fromValue(String value) { + for (AccessTierEnum b : AccessTierEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ACCESS_TIER = "access_tier"; + private AccessTierEnum accessTier; + + public static final String JSON_PROPERTY_KEY_PREFIX = "key_prefix"; + private String keyPrefix; + + public static final String JSON_PROPERTY_USE_EMULATOR = "use_emulator"; + private Boolean useEmulator; + + public AzureBlobFsConfig() { + } + + public AzureBlobFsConfig container(String container) { + + this.container = container; + return this; + } + + /** + * Get container + * @return container + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContainer() { + return container; + } + + + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContainer(String container) { + this.container = container; + } + + public AzureBlobFsConfig accountName(String accountName) { + + this.accountName = accountName; + return this; + } + + /** + * Storage Account Name, leave blank to use SAS URL + * @return accountName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccountName() { + return accountName; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public AzureBlobFsConfig accountKey(Secret accountKey) { + + this.accountKey = accountKey; + return this; + } + + /** + * Get accountKey + * @return accountKey + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getAccountKey() { + return accountKey; + } + + + @JsonProperty(JSON_PROPERTY_ACCOUNT_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountKey(Secret accountKey) { + this.accountKey = accountKey; + } + + public AzureBlobFsConfig sasUrl(Secret sasUrl) { + + this.sasUrl = sasUrl; + return this; + } + + /** + * Get sasUrl + * @return sasUrl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SAS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getSasUrl() { + return sasUrl; + } + + + @JsonProperty(JSON_PROPERTY_SAS_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSasUrl(Secret sasUrl) { + this.sasUrl = sasUrl; + } + + public AzureBlobFsConfig endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * optional endpoint. Default is \"blob.core.windows.net\". If you use the emulator the endpoint must include the protocol, for example \"http://127.0.0.1:10000\" + * @return endpoint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public AzureBlobFsConfig uploadPartSize(Integer uploadPartSize) { + + this.uploadPartSize = uploadPartSize; + return this; + } + + /** + * the buffer size (in MB) to use for multipart uploads. If this value is set to zero, the default value (5MB) will be used. + * @return uploadPartSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadPartSize() { + return uploadPartSize; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadPartSize(Integer uploadPartSize) { + this.uploadPartSize = uploadPartSize; + } + + public AzureBlobFsConfig uploadConcurrency(Integer uploadConcurrency) { + + this.uploadConcurrency = uploadConcurrency; + return this; + } + + /** + * the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used + * @return uploadConcurrency + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadConcurrency() { + return uploadConcurrency; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadConcurrency(Integer uploadConcurrency) { + this.uploadConcurrency = uploadConcurrency; + } + + public AzureBlobFsConfig downloadPartSize(Integer downloadPartSize) { + + this.downloadPartSize = downloadPartSize; + return this; + } + + /** + * the buffer size (in MB) to use for multipart downloads. If this value is set to zero, the default value (5MB) will be used. + * @return downloadPartSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadPartSize() { + return downloadPartSize; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadPartSize(Integer downloadPartSize) { + this.downloadPartSize = downloadPartSize; + } + + public AzureBlobFsConfig downloadConcurrency(Integer downloadConcurrency) { + + this.downloadConcurrency = downloadConcurrency; + return this; + } + + /** + * the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used + * @return downloadConcurrency + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadConcurrency() { + return downloadConcurrency; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadConcurrency(Integer downloadConcurrency) { + this.downloadConcurrency = downloadConcurrency; + } + + public AzureBlobFsConfig accessTier(AccessTierEnum accessTier) { + + this.accessTier = accessTier; + return this; + } + + /** + * Get accessTier + * @return accessTier + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AccessTierEnum getAccessTier() { + return accessTier; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessTier(AccessTierEnum accessTier) { + this.accessTier = accessTier; + } + + public AzureBlobFsConfig keyPrefix(String keyPrefix) { + + this.keyPrefix = keyPrefix; + return this; + } + + /** + * key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with \"/\" and must end with \"/\". If empty the whole container contents will be available + * @return keyPrefix + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKeyPrefix() { + return keyPrefix; + } + + + @JsonProperty(JSON_PROPERTY_KEY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyPrefix(String keyPrefix) { + this.keyPrefix = keyPrefix; + } + + public AzureBlobFsConfig useEmulator(Boolean useEmulator) { + + this.useEmulator = useEmulator; + return this; + } + + /** + * Get useEmulator + * @return useEmulator + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USE_EMULATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUseEmulator() { + return useEmulator; + } + + + @JsonProperty(JSON_PROPERTY_USE_EMULATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseEmulator(Boolean useEmulator) { + this.useEmulator = useEmulator; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AzureBlobFsConfig azureBlobFsConfig = (AzureBlobFsConfig) o; + return Objects.equals(this.container, azureBlobFsConfig.container) && + Objects.equals(this.accountName, azureBlobFsConfig.accountName) && + Objects.equals(this.accountKey, azureBlobFsConfig.accountKey) && + Objects.equals(this.sasUrl, azureBlobFsConfig.sasUrl) && + Objects.equals(this.endpoint, azureBlobFsConfig.endpoint) && + Objects.equals(this.uploadPartSize, azureBlobFsConfig.uploadPartSize) && + Objects.equals(this.uploadConcurrency, azureBlobFsConfig.uploadConcurrency) && + Objects.equals(this.downloadPartSize, azureBlobFsConfig.downloadPartSize) && + Objects.equals(this.downloadConcurrency, azureBlobFsConfig.downloadConcurrency) && + Objects.equals(this.accessTier, azureBlobFsConfig.accessTier) && + Objects.equals(this.keyPrefix, azureBlobFsConfig.keyPrefix) && + Objects.equals(this.useEmulator, azureBlobFsConfig.useEmulator); + } + + @Override + public int hashCode() { + return Objects.hash(container, accountName, accountKey, sasUrl, endpoint, uploadPartSize, uploadConcurrency, downloadPartSize, downloadConcurrency, accessTier, keyPrefix, useEmulator); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AzureBlobFsConfig {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" accountKey: ").append(toIndentedString(accountKey)).append("\n"); + sb.append(" sasUrl: ").append(toIndentedString(sasUrl)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" uploadPartSize: ").append(toIndentedString(uploadPartSize)).append("\n"); + sb.append(" uploadConcurrency: ").append(toIndentedString(uploadConcurrency)).append("\n"); + sb.append(" downloadPartSize: ").append(toIndentedString(downloadPartSize)).append("\n"); + sb.append(" downloadConcurrency: ").append(toIndentedString(downloadConcurrency)).append("\n"); + sb.append(" accessTier: ").append(toIndentedString(accessTier)).append("\n"); + sb.append(" keyPrefix: ").append(toIndentedString(keyPrefix)).append("\n"); + sb.append(" useEmulator: ").append(toIndentedString(useEmulator)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BackupData.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BackupData.java new file mode 100644 index 00000000..efe22e98 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BackupData.java @@ -0,0 +1,466 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.APIKey; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Admin; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseVirtualFolder; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventRule; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Group; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Role; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Share; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BackupData + */ +@JsonPropertyOrder({ + BackupData.JSON_PROPERTY_USERS, + BackupData.JSON_PROPERTY_FOLDERS, + BackupData.JSON_PROPERTY_GROUPS, + BackupData.JSON_PROPERTY_ADMINS, + BackupData.JSON_PROPERTY_API_KEYS, + BackupData.JSON_PROPERTY_SHARES, + BackupData.JSON_PROPERTY_EVENT_ACTIONS, + BackupData.JSON_PROPERTY_EVENT_RULES, + BackupData.JSON_PROPERTY_ROLES, + BackupData.JSON_PROPERTY_VERSION +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BackupData { + public static final String JSON_PROPERTY_USERS = "users"; + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_FOLDERS = "folders"; + private List folders = new ArrayList<>(); + + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_ADMINS = "admins"; + private List admins = new ArrayList<>(); + + public static final String JSON_PROPERTY_API_KEYS = "api_keys"; + private List apiKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_SHARES = "shares"; + private List shares = new ArrayList<>(); + + public static final String JSON_PROPERTY_EVENT_ACTIONS = "event_actions"; + private List eventActions = new ArrayList<>(); + + public static final String JSON_PROPERTY_EVENT_RULES = "event_rules"; + private List eventRules = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROLES = "roles"; + private List roles = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + private Integer version; + + public BackupData() { + } + + public BackupData users(List users) { + + this.users = users; + return this; + } + + public BackupData addUsersItem(User usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + public BackupData folders(List folders) { + + this.folders = folders; + return this; + } + + public BackupData addFoldersItem(BaseVirtualFolder foldersItem) { + if (this.folders == null) { + this.folders = new ArrayList<>(); + } + this.folders.add(foldersItem); + return this; + } + + /** + * Get folders + * @return folders + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFolders() { + return folders; + } + + + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolders(List folders) { + this.folders = folders; + } + + public BackupData groups(List groups) { + + this.groups = groups; + return this; + } + + public BackupData addGroupsItem(Group groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Get groups + * @return groups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroups() { + return groups; + } + + + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroups(List groups) { + this.groups = groups; + } + + public BackupData admins(List admins) { + + this.admins = admins; + return this; + } + + public BackupData addAdminsItem(Admin adminsItem) { + if (this.admins == null) { + this.admins = new ArrayList<>(); + } + this.admins.add(adminsItem); + return this; + } + + /** + * Get admins + * @return admins + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAdmins() { + return admins; + } + + + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdmins(List admins) { + this.admins = admins; + } + + public BackupData apiKeys(List apiKeys) { + + this.apiKeys = apiKeys; + return this; + } + + public BackupData addApiKeysItem(APIKey apiKeysItem) { + if (this.apiKeys == null) { + this.apiKeys = new ArrayList<>(); + } + this.apiKeys.add(apiKeysItem); + return this; + } + + /** + * Get apiKeys + * @return apiKeys + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getApiKeys() { + return apiKeys; + } + + + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKeys(List apiKeys) { + this.apiKeys = apiKeys; + } + + public BackupData shares(List shares) { + + this.shares = shares; + return this; + } + + public BackupData addSharesItem(Share sharesItem) { + if (this.shares == null) { + this.shares = new ArrayList<>(); + } + this.shares.add(sharesItem); + return this; + } + + /** + * Get shares + * @return shares + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getShares() { + return shares; + } + + + @JsonProperty(JSON_PROPERTY_SHARES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShares(List shares) { + this.shares = shares; + } + + public BackupData eventActions(List eventActions) { + + this.eventActions = eventActions; + return this; + } + + public BackupData addEventActionsItem(EventAction eventActionsItem) { + if (this.eventActions == null) { + this.eventActions = new ArrayList<>(); + } + this.eventActions.add(eventActionsItem); + return this; + } + + /** + * Get eventActions + * @return eventActions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEventActions() { + return eventActions; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventActions(List eventActions) { + this.eventActions = eventActions; + } + + public BackupData eventRules(List eventRules) { + + this.eventRules = eventRules; + return this; + } + + public BackupData addEventRulesItem(EventRule eventRulesItem) { + if (this.eventRules == null) { + this.eventRules = new ArrayList<>(); + } + this.eventRules.add(eventRulesItem); + return this; + } + + /** + * Get eventRules + * @return eventRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEventRules() { + return eventRules; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventRules(List eventRules) { + this.eventRules = eventRules; + } + + public BackupData roles(List roles) { + + this.roles = roles; + return this; + } + + public BackupData addRolesItem(Role rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Get roles + * @return roles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRoles() { + return roles; + } + + + @JsonProperty(JSON_PROPERTY_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoles(List roles) { + this.roles = roles; + } + + public BackupData version(Integer version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getVersion() { + return version; + } + + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(Integer version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BackupData backupData = (BackupData) o; + return Objects.equals(this.users, backupData.users) && + Objects.equals(this.folders, backupData.folders) && + Objects.equals(this.groups, backupData.groups) && + Objects.equals(this.admins, backupData.admins) && + Objects.equals(this.apiKeys, backupData.apiKeys) && + Objects.equals(this.shares, backupData.shares) && + Objects.equals(this.eventActions, backupData.eventActions) && + Objects.equals(this.eventRules, backupData.eventRules) && + Objects.equals(this.roles, backupData.roles) && + Objects.equals(this.version, backupData.version); + } + + @Override + public int hashCode() { + return Objects.hash(users, folders, groups, admins, apiKeys, shares, eventActions, eventRules, roles, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BackupData {\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" folders: ").append(toIndentedString(folders)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" admins: ").append(toIndentedString(admins)).append("\n"); + sb.append(" apiKeys: ").append(toIndentedString(apiKeys)).append("\n"); + sb.append(" shares: ").append(toIndentedString(shares)).append("\n"); + sb.append(" eventActions: ").append(toIndentedString(eventActions)).append("\n"); + sb.append(" eventRules: ").append(toIndentedString(eventRules)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BandwidthLimit.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BandwidthLimit.java new file mode 100644 index 00000000..680e4682 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BandwidthLimit.java @@ -0,0 +1,176 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BandwidthLimit + */ +@JsonPropertyOrder({ + BandwidthLimit.JSON_PROPERTY_SOURCES, + BandwidthLimit.JSON_PROPERTY_UPLOAD_BANDWIDTH, + BandwidthLimit.JSON_PROPERTY_DOWNLOAD_BANDWIDTH +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BandwidthLimit { + public static final String JSON_PROPERTY_SOURCES = "sources"; + private List sources = new ArrayList<>(); + + public static final String JSON_PROPERTY_UPLOAD_BANDWIDTH = "upload_bandwidth"; + private Integer uploadBandwidth; + + public static final String JSON_PROPERTY_DOWNLOAD_BANDWIDTH = "download_bandwidth"; + private Integer downloadBandwidth; + + public BandwidthLimit() { + } + + public BandwidthLimit sources(List sources) { + + this.sources = sources; + return this; + } + + public BandwidthLimit addSourcesItem(String sourcesItem) { + if (this.sources == null) { + this.sources = new ArrayList<>(); + } + this.sources.add(sourcesItem); + return this; + } + + /** + * Source networks in CIDR notation as defined in RFC 4632 and RFC 4291 for example `192.0.2.0/24` or `2001:db8::/32`. The limit applies if the defined networks contain the client IP + * @return sources + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSources() { + return sources; + } + + + @JsonProperty(JSON_PROPERTY_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSources(List sources) { + this.sources = sources; + } + + public BandwidthLimit uploadBandwidth(Integer uploadBandwidth) { + + this.uploadBandwidth = uploadBandwidth; + return this; + } + + /** + * Maximum upload bandwidth as KB/s, 0 means unlimited + * @return uploadBandwidth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadBandwidth() { + return uploadBandwidth; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadBandwidth(Integer uploadBandwidth) { + this.uploadBandwidth = uploadBandwidth; + } + + public BandwidthLimit downloadBandwidth(Integer downloadBandwidth) { + + this.downloadBandwidth = downloadBandwidth; + return this; + } + + /** + * Maximum download bandwidth as KB/s, 0 means unlimited + * @return downloadBandwidth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadBandwidth() { + return downloadBandwidth; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadBandwidth(Integer downloadBandwidth) { + this.downloadBandwidth = downloadBandwidth; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BandwidthLimit bandwidthLimit = (BandwidthLimit) o; + return Objects.equals(this.sources, bandwidthLimit.sources) && + Objects.equals(this.uploadBandwidth, bandwidthLimit.uploadBandwidth) && + Objects.equals(this.downloadBandwidth, bandwidthLimit.downloadBandwidth); + } + + @Override + public int hashCode() { + return Objects.hash(sources, uploadBandwidth, downloadBandwidth); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BandwidthLimit {\n"); + sb.append(" sources: ").append(toIndentedString(sources)).append("\n"); + sb.append(" uploadBandwidth: ").append(toIndentedString(uploadBandwidth)).append("\n"); + sb.append(" downloadBandwidth: ").append(toIndentedString(downloadBandwidth)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventAction.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventAction.java new file mode 100644 index 00000000..1bb46c6e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventAction.java @@ -0,0 +1,272 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseEventActionOptions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionTypes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BaseEventAction + */ +@JsonPropertyOrder({ + BaseEventAction.JSON_PROPERTY_ID, + BaseEventAction.JSON_PROPERTY_NAME, + BaseEventAction.JSON_PROPERTY_DESCRIPTION, + BaseEventAction.JSON_PROPERTY_TYPE, + BaseEventAction.JSON_PROPERTY_OPTIONS, + BaseEventAction.JSON_PROPERTY_RULES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BaseEventAction { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EventActionTypes type; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private BaseEventActionOptions options; + + public static final String JSON_PROPERTY_RULES = "rules"; + private List rules = new ArrayList<>(); + + public BaseEventAction() { + } + + public BaseEventAction id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public BaseEventAction name(String name) { + + this.name = name; + return this; + } + + /** + * unique name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public BaseEventAction description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public BaseEventAction type(EventActionTypes type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionTypes getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(EventActionTypes type) { + this.type = type; + } + + public BaseEventAction options(BaseEventActionOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BaseEventActionOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(BaseEventActionOptions options) { + this.options = options; + } + + public BaseEventAction rules(List rules) { + + this.rules = rules; + return this; + } + + public BaseEventAction addRulesItem(String rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); + } + this.rules.add(rulesItem); + return this; + } + + /** + * list of event rules names associated with this action + * @return rules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRules() { + return rules; + } + + + @JsonProperty(JSON_PROPERTY_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRules(List rules) { + this.rules = rules; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEventAction baseEventAction = (BaseEventAction) o; + return Objects.equals(this.id, baseEventAction.id) && + Objects.equals(this.name, baseEventAction.name) && + Objects.equals(this.description, baseEventAction.description) && + Objects.equals(this.type, baseEventAction.type) && + Objects.equals(this.options, baseEventAction.options) && + Objects.equals(this.rules, baseEventAction.rules); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, type, options, rules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseEventAction {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventActionOptions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventActionOptions.java new file mode 100644 index 00000000..e27b5363 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventActionOptions.java @@ -0,0 +1,328 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionCommandConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionDataRetentionConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionEmailConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionFilesystemConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionHTTPConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionIDPAccountCheck; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionPasswordExpiration; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionUserInactivity; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BaseEventActionOptions + */ +@JsonPropertyOrder({ + BaseEventActionOptions.JSON_PROPERTY_HTTP_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_CMD_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_EMAIL_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_RETENTION_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_FS_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_PWD_EXPIRATION_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_USER_INACTIVITY_CONFIG, + BaseEventActionOptions.JSON_PROPERTY_IDP_CONFIG +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BaseEventActionOptions { + public static final String JSON_PROPERTY_HTTP_CONFIG = "http_config"; + private EventActionHTTPConfig httpConfig; + + public static final String JSON_PROPERTY_CMD_CONFIG = "cmd_config"; + private EventActionCommandConfig cmdConfig; + + public static final String JSON_PROPERTY_EMAIL_CONFIG = "email_config"; + private EventActionEmailConfig emailConfig; + + public static final String JSON_PROPERTY_RETENTION_CONFIG = "retention_config"; + private EventActionDataRetentionConfig retentionConfig; + + public static final String JSON_PROPERTY_FS_CONFIG = "fs_config"; + private EventActionFilesystemConfig fsConfig; + + public static final String JSON_PROPERTY_PWD_EXPIRATION_CONFIG = "pwd_expiration_config"; + private EventActionPasswordExpiration pwdExpirationConfig; + + public static final String JSON_PROPERTY_USER_INACTIVITY_CONFIG = "user_inactivity_config"; + private EventActionUserInactivity userInactivityConfig; + + public static final String JSON_PROPERTY_IDP_CONFIG = "idp_config"; + private EventActionIDPAccountCheck idpConfig; + + public BaseEventActionOptions() { + } + + public BaseEventActionOptions httpConfig(EventActionHTTPConfig httpConfig) { + + this.httpConfig = httpConfig; + return this; + } + + /** + * Get httpConfig + * @return httpConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTTP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionHTTPConfig getHttpConfig() { + return httpConfig; + } + + + @JsonProperty(JSON_PROPERTY_HTTP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpConfig(EventActionHTTPConfig httpConfig) { + this.httpConfig = httpConfig; + } + + public BaseEventActionOptions cmdConfig(EventActionCommandConfig cmdConfig) { + + this.cmdConfig = cmdConfig; + return this; + } + + /** + * Get cmdConfig + * @return cmdConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CMD_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionCommandConfig getCmdConfig() { + return cmdConfig; + } + + + @JsonProperty(JSON_PROPERTY_CMD_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCmdConfig(EventActionCommandConfig cmdConfig) { + this.cmdConfig = cmdConfig; + } + + public BaseEventActionOptions emailConfig(EventActionEmailConfig emailConfig) { + + this.emailConfig = emailConfig; + return this; + } + + /** + * Get emailConfig + * @return emailConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionEmailConfig getEmailConfig() { + return emailConfig; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmailConfig(EventActionEmailConfig emailConfig) { + this.emailConfig = emailConfig; + } + + public BaseEventActionOptions retentionConfig(EventActionDataRetentionConfig retentionConfig) { + + this.retentionConfig = retentionConfig; + return this; + } + + /** + * Get retentionConfig + * @return retentionConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETENTION_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionDataRetentionConfig getRetentionConfig() { + return retentionConfig; + } + + + @JsonProperty(JSON_PROPERTY_RETENTION_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetentionConfig(EventActionDataRetentionConfig retentionConfig) { + this.retentionConfig = retentionConfig; + } + + public BaseEventActionOptions fsConfig(EventActionFilesystemConfig fsConfig) { + + this.fsConfig = fsConfig; + return this; + } + + /** + * Get fsConfig + * @return fsConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionFilesystemConfig getFsConfig() { + return fsConfig; + } + + + @JsonProperty(JSON_PROPERTY_FS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsConfig(EventActionFilesystemConfig fsConfig) { + this.fsConfig = fsConfig; + } + + public BaseEventActionOptions pwdExpirationConfig(EventActionPasswordExpiration pwdExpirationConfig) { + + this.pwdExpirationConfig = pwdExpirationConfig; + return this; + } + + /** + * Get pwdExpirationConfig + * @return pwdExpirationConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PWD_EXPIRATION_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionPasswordExpiration getPwdExpirationConfig() { + return pwdExpirationConfig; + } + + + @JsonProperty(JSON_PROPERTY_PWD_EXPIRATION_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPwdExpirationConfig(EventActionPasswordExpiration pwdExpirationConfig) { + this.pwdExpirationConfig = pwdExpirationConfig; + } + + public BaseEventActionOptions userInactivityConfig(EventActionUserInactivity userInactivityConfig) { + + this.userInactivityConfig = userInactivityConfig; + return this; + } + + /** + * Get userInactivityConfig + * @return userInactivityConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_INACTIVITY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionUserInactivity getUserInactivityConfig() { + return userInactivityConfig; + } + + + @JsonProperty(JSON_PROPERTY_USER_INACTIVITY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserInactivityConfig(EventActionUserInactivity userInactivityConfig) { + this.userInactivityConfig = userInactivityConfig; + } + + public BaseEventActionOptions idpConfig(EventActionIDPAccountCheck idpConfig) { + + this.idpConfig = idpConfig; + return this; + } + + /** + * Get idpConfig + * @return idpConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionIDPAccountCheck getIdpConfig() { + return idpConfig; + } + + + @JsonProperty(JSON_PROPERTY_IDP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdpConfig(EventActionIDPAccountCheck idpConfig) { + this.idpConfig = idpConfig; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEventActionOptions baseEventActionOptions = (BaseEventActionOptions) o; + return Objects.equals(this.httpConfig, baseEventActionOptions.httpConfig) && + Objects.equals(this.cmdConfig, baseEventActionOptions.cmdConfig) && + Objects.equals(this.emailConfig, baseEventActionOptions.emailConfig) && + Objects.equals(this.retentionConfig, baseEventActionOptions.retentionConfig) && + Objects.equals(this.fsConfig, baseEventActionOptions.fsConfig) && + Objects.equals(this.pwdExpirationConfig, baseEventActionOptions.pwdExpirationConfig) && + Objects.equals(this.userInactivityConfig, baseEventActionOptions.userInactivityConfig) && + Objects.equals(this.idpConfig, baseEventActionOptions.idpConfig); + } + + @Override + public int hashCode() { + return Objects.hash(httpConfig, cmdConfig, emailConfig, retentionConfig, fsConfig, pwdExpirationConfig, userInactivityConfig, idpConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseEventActionOptions {\n"); + sb.append(" httpConfig: ").append(toIndentedString(httpConfig)).append("\n"); + sb.append(" cmdConfig: ").append(toIndentedString(cmdConfig)).append("\n"); + sb.append(" emailConfig: ").append(toIndentedString(emailConfig)).append("\n"); + sb.append(" retentionConfig: ").append(toIndentedString(retentionConfig)).append("\n"); + sb.append(" fsConfig: ").append(toIndentedString(fsConfig)).append("\n"); + sb.append(" pwdExpirationConfig: ").append(toIndentedString(pwdExpirationConfig)).append("\n"); + sb.append(" userInactivityConfig: ").append(toIndentedString(userInactivityConfig)).append("\n"); + sb.append(" idpConfig: ").append(toIndentedString(idpConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventRule.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventRule.java new file mode 100644 index 00000000..19272c7a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseEventRule.java @@ -0,0 +1,358 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventConditions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventTriggerTypes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BaseEventRule + */ +@JsonPropertyOrder({ + BaseEventRule.JSON_PROPERTY_ID, + BaseEventRule.JSON_PROPERTY_NAME, + BaseEventRule.JSON_PROPERTY_STATUS, + BaseEventRule.JSON_PROPERTY_DESCRIPTION, + BaseEventRule.JSON_PROPERTY_CREATED_AT, + BaseEventRule.JSON_PROPERTY_UPDATED_AT, + BaseEventRule.JSON_PROPERTY_TRIGGER, + BaseEventRule.JSON_PROPERTY_CONDITIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BaseEventRule { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * status: * `0` disabled * `1` enabled + */ + public enum StatusEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + StatusEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(Integer value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private EventTriggerTypes trigger; + + public static final String JSON_PROPERTY_CONDITIONS = "conditions"; + private EventConditions conditions; + + public BaseEventRule() { + } + + public BaseEventRule id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public BaseEventRule name(String name) { + + this.name = name; + return this; + } + + /** + * unique name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public BaseEventRule status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * status: * `0` disabled * `1` enabled + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public BaseEventRule description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public BaseEventRule createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public BaseEventRule updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in millisecond + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public BaseEventRule trigger(EventTriggerTypes trigger) { + + this.trigger = trigger; + return this; + } + + /** + * Get trigger + * @return trigger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventTriggerTypes getTrigger() { + return trigger; + } + + + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(EventTriggerTypes trigger) { + this.trigger = trigger; + } + + public BaseEventRule conditions(EventConditions conditions) { + + this.conditions = conditions; + return this; + } + + /** + * Get conditions + * @return conditions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventConditions getConditions() { + return conditions; + } + + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(EventConditions conditions) { + this.conditions = conditions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseEventRule baseEventRule = (BaseEventRule) o; + return Objects.equals(this.id, baseEventRule.id) && + Objects.equals(this.name, baseEventRule.name) && + Objects.equals(this.status, baseEventRule.status) && + Objects.equals(this.description, baseEventRule.description) && + Objects.equals(this.createdAt, baseEventRule.createdAt) && + Objects.equals(this.updatedAt, baseEventRule.updatedAt) && + Objects.equals(this.trigger, baseEventRule.trigger) && + Objects.equals(this.conditions, baseEventRule.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, description, createdAt, updatedAt, trigger, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseEventRule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseTOTPConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseTOTPConfig.java new file mode 100644 index 00000000..734d48fb --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseTOTPConfig.java @@ -0,0 +1,166 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * BaseTOTPConfig + */ +@JsonPropertyOrder({ + BaseTOTPConfig.JSON_PROPERTY_ENABLED, + BaseTOTPConfig.JSON_PROPERTY_CONFIG_NAME, + BaseTOTPConfig.JSON_PROPERTY_SECRET +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BaseTOTPConfig { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private Secret secret; + + public BaseTOTPConfig() { + } + + public BaseTOTPConfig enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public BaseTOTPConfig configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * This name must be defined within the \"totp\" section of the SFTPGo configuration file. You will be unable to save a user/admin referencing a missing config_name + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + public BaseTOTPConfig secret(Secret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(Secret secret) { + this.secret = secret; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseTOTPConfig baseTOTPConfig = (BaseTOTPConfig) o; + return Objects.equals(this.enabled, baseTOTPConfig.enabled) && + Objects.equals(this.configName, baseTOTPConfig.configName) && + Objects.equals(this.secret, baseTOTPConfig.secret); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, configName, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseTOTPConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseUserFilters.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseUserFilters.java new file mode 100644 index 00000000..14573b87 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseUserFilters.java @@ -0,0 +1,943 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BandwidthLimit; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.HooksFilter; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.LoginMethods; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.MFAProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.PatternsFilter; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.SupportedProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TimePeriod; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.UserType; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.WebClientOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Additional user options + */ +@JsonPropertyOrder({ + BaseUserFilters.JSON_PROPERTY_ALLOWED_IP, + BaseUserFilters.JSON_PROPERTY_DENIED_IP, + BaseUserFilters.JSON_PROPERTY_DENIED_LOGIN_METHODS, + BaseUserFilters.JSON_PROPERTY_DENIED_PROTOCOLS, + BaseUserFilters.JSON_PROPERTY_FILE_PATTERNS, + BaseUserFilters.JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE, + BaseUserFilters.JSON_PROPERTY_TLS_USERNAME, + BaseUserFilters.JSON_PROPERTY_TLS_CERTS, + BaseUserFilters.JSON_PROPERTY_HOOKS, + BaseUserFilters.JSON_PROPERTY_DISABLE_FS_CHECKS, + BaseUserFilters.JSON_PROPERTY_WEB_CLIENT, + BaseUserFilters.JSON_PROPERTY_ALLOW_API_KEY_AUTH, + BaseUserFilters.JSON_PROPERTY_USER_TYPE, + BaseUserFilters.JSON_PROPERTY_BANDWIDTH_LIMITS, + BaseUserFilters.JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME, + BaseUserFilters.JSON_PROPERTY_START_DIRECTORY, + BaseUserFilters.JSON_PROPERTY_TWO_FACTOR_PROTOCOLS, + BaseUserFilters.JSON_PROPERTY_FTP_SECURITY, + BaseUserFilters.JSON_PROPERTY_IS_ANONYMOUS, + BaseUserFilters.JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION, + BaseUserFilters.JSON_PROPERTY_MAX_SHARES_EXPIRATION, + BaseUserFilters.JSON_PROPERTY_PASSWORD_EXPIRATION, + BaseUserFilters.JSON_PROPERTY_PASSWORD_STRENGTH, + BaseUserFilters.JSON_PROPERTY_ACCESS_TIME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BaseUserFilters { + public static final String JSON_PROPERTY_ALLOWED_IP = "allowed_ip"; + private List allowedIp = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_IP = "denied_ip"; + private List deniedIp = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_LOGIN_METHODS = "denied_login_methods"; + private List deniedLoginMethods = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_PROTOCOLS = "denied_protocols"; + private List deniedProtocols = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILE_PATTERNS = "file_patterns"; + private List filePatterns = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE = "max_upload_file_size"; + private Long maxUploadFileSize; + + public static final String JSON_PROPERTY_TLS_USERNAME = "tls_username"; + private String tlsUsername; + + public static final String JSON_PROPERTY_TLS_CERTS = "tls_certs"; + private List tlsCerts = new ArrayList<>(); + + public static final String JSON_PROPERTY_HOOKS = "hooks"; + private HooksFilter hooks; + + public static final String JSON_PROPERTY_DISABLE_FS_CHECKS = "disable_fs_checks"; + private Boolean disableFsChecks; + + public static final String JSON_PROPERTY_WEB_CLIENT = "web_client"; + private List webClient = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_API_KEY_AUTH = "allow_api_key_auth"; + private Boolean allowApiKeyAuth; + + public static final String JSON_PROPERTY_USER_TYPE = "user_type"; + private UserType userType; + + public static final String JSON_PROPERTY_BANDWIDTH_LIMITS = "bandwidth_limits"; + private List bandwidthLimits = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME = "external_auth_cache_time"; + private Integer externalAuthCacheTime; + + public static final String JSON_PROPERTY_START_DIRECTORY = "start_directory"; + private String startDirectory; + + public static final String JSON_PROPERTY_TWO_FACTOR_PROTOCOLS = "two_factor_protocols"; + private List twoFactorProtocols = new ArrayList<>(); + + /** + * Set to `1` to require TLS for both data and control connection. his setting is useful if you want to allow both encrypted and plain text FTP sessions globally and then you want to require encrypted sessions on a per-user basis. It has no effect if TLS is already required for all users in the configuration file. + */ + public enum FtpSecurityEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + FtpSecurityEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FtpSecurityEnum fromValue(Integer value) { + for (FtpSecurityEnum b : FtpSecurityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FTP_SECURITY = "ftp_security"; + private FtpSecurityEnum ftpSecurity; + + public static final String JSON_PROPERTY_IS_ANONYMOUS = "is_anonymous"; + private Boolean isAnonymous; + + public static final String JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION = "default_shares_expiration"; + private Integer defaultSharesExpiration; + + public static final String JSON_PROPERTY_MAX_SHARES_EXPIRATION = "max_shares_expiration"; + private Integer maxSharesExpiration; + + public static final String JSON_PROPERTY_PASSWORD_EXPIRATION = "password_expiration"; + private Integer passwordExpiration; + + public static final String JSON_PROPERTY_PASSWORD_STRENGTH = "password_strength"; + private Integer passwordStrength; + + public static final String JSON_PROPERTY_ACCESS_TIME = "access_time"; + private List accessTime = new ArrayList<>(); + + public BaseUserFilters() { + } + + public BaseUserFilters allowedIp(List allowedIp) { + + this.allowedIp = allowedIp; + return this; + } + + public BaseUserFilters addAllowedIpItem(String allowedIpItem) { + if (this.allowedIp == null) { + this.allowedIp = new ArrayList<>(); + } + this.allowedIp.add(allowedIpItem); + return this; + } + + /** + * only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example \"192.0.2.0/24\" or \"2001:db8::/32\" + * @return allowedIp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOWED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAllowedIp() { + return allowedIp; + } + + + @JsonProperty(JSON_PROPERTY_ALLOWED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedIp(List allowedIp) { + this.allowedIp = allowedIp; + } + + public BaseUserFilters deniedIp(List deniedIp) { + + this.deniedIp = deniedIp; + return this; + } + + public BaseUserFilters addDeniedIpItem(String deniedIpItem) { + if (this.deniedIp == null) { + this.deniedIp = new ArrayList<>(); + } + this.deniedIp.add(deniedIpItem); + return this; + } + + /** + * clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones + * @return deniedIp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedIp() { + return deniedIp; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedIp(List deniedIp) { + this.deniedIp = deniedIp; + } + + public BaseUserFilters deniedLoginMethods(List deniedLoginMethods) { + + this.deniedLoginMethods = deniedLoginMethods; + return this; + } + + public BaseUserFilters addDeniedLoginMethodsItem(LoginMethods deniedLoginMethodsItem) { + if (this.deniedLoginMethods == null) { + this.deniedLoginMethods = new ArrayList<>(); + } + this.deniedLoginMethods.add(deniedLoginMethodsItem); + return this; + } + + /** + * if null or empty any available login method is allowed + * @return deniedLoginMethods + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_LOGIN_METHODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedLoginMethods() { + return deniedLoginMethods; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_LOGIN_METHODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedLoginMethods(List deniedLoginMethods) { + this.deniedLoginMethods = deniedLoginMethods; + } + + public BaseUserFilters deniedProtocols(List deniedProtocols) { + + this.deniedProtocols = deniedProtocols; + return this; + } + + public BaseUserFilters addDeniedProtocolsItem(SupportedProtocols deniedProtocolsItem) { + if (this.deniedProtocols == null) { + this.deniedProtocols = new ArrayList<>(); + } + this.deniedProtocols.add(deniedProtocolsItem); + return this; + } + + /** + * if null or empty any available protocol is allowed + * @return deniedProtocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedProtocols() { + return deniedProtocols; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedProtocols(List deniedProtocols) { + this.deniedProtocols = deniedProtocols; + } + + public BaseUserFilters filePatterns(List filePatterns) { + + this.filePatterns = filePatterns; + return this; + } + + public BaseUserFilters addFilePatternsItem(PatternsFilter filePatternsItem) { + if (this.filePatterns == null) { + this.filePatterns = new ArrayList<>(); + } + this.filePatterns.add(filePatternsItem); + return this; + } + + /** + * filters based on shell like file patterns. These restrictions do not apply to files listing for performance reasons, so a denied file cannot be downloaded/overwritten/renamed but it will still be in the list of files. Please note that these restrictions can be easily bypassed + * @return filePatterns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFilePatterns() { + return filePatterns; + } + + + @JsonProperty(JSON_PROPERTY_FILE_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilePatterns(List filePatterns) { + this.filePatterns = filePatterns; + } + + public BaseUserFilters maxUploadFileSize(Long maxUploadFileSize) { + + this.maxUploadFileSize = maxUploadFileSize; + return this; + } + + /** + * maximum allowed size, as bytes, for a single file upload. The upload will be aborted if/when the size of the file being sent exceeds this limit. 0 means unlimited. This restriction does not apply for SSH system commands such as `git` and `rsync` + * @return maxUploadFileSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getMaxUploadFileSize() { + return maxUploadFileSize; + } + + + @JsonProperty(JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxUploadFileSize(Long maxUploadFileSize) { + this.maxUploadFileSize = maxUploadFileSize; + } + + public BaseUserFilters tlsUsername(String tlsUsername) { + + this.tlsUsername = tlsUsername; + return this; + } + + /** + * defines the TLS certificate field to use as username. For FTP clients it must match the name provided using the \"USER\" command. For WebDAV, if no username is provided, the CN will be used as username. For WebDAV clients it must match the implicit or provided username. Ignored if mutual TLS is disabled. Currently the only supported value is `CommonName` + * @return tlsUsername + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTlsUsername() { + return tlsUsername; + } + + + @JsonProperty(JSON_PROPERTY_TLS_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsUsername(String tlsUsername) { + this.tlsUsername = tlsUsername; + } + + public BaseUserFilters tlsCerts(List tlsCerts) { + + this.tlsCerts = tlsCerts; + return this; + } + + public BaseUserFilters addTlsCertsItem(String tlsCertsItem) { + if (this.tlsCerts == null) { + this.tlsCerts = new ArrayList<>(); + } + this.tlsCerts.add(tlsCertsItem); + return this; + } + + /** + * Get tlsCerts + * @return tlsCerts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_CERTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTlsCerts() { + return tlsCerts; + } + + + @JsonProperty(JSON_PROPERTY_TLS_CERTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsCerts(List tlsCerts) { + this.tlsCerts = tlsCerts; + } + + public BaseUserFilters hooks(HooksFilter hooks) { + + this.hooks = hooks; + return this; + } + + /** + * Get hooks + * @return hooks + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public HooksFilter getHooks() { + return hooks; + } + + + @JsonProperty(JSON_PROPERTY_HOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHooks(HooksFilter hooks) { + this.hooks = hooks; + } + + public BaseUserFilters disableFsChecks(Boolean disableFsChecks) { + + this.disableFsChecks = disableFsChecks; + return this; + } + + /** + * Disable checks for existence and automatic creation of home directory and virtual folders. SFTPGo requires that the user's home directory, virtual folder root, and intermediate paths to virtual folders exist to work properly. If you already know that the required directories exist, disabling these checks will speed up login. You could, for example, disable these checks after the first login + * @return disableFsChecks + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLE_FS_CHECKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableFsChecks() { + return disableFsChecks; + } + + + @JsonProperty(JSON_PROPERTY_DISABLE_FS_CHECKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableFsChecks(Boolean disableFsChecks) { + this.disableFsChecks = disableFsChecks; + } + + public BaseUserFilters webClient(List webClient) { + + this.webClient = webClient; + return this; + } + + public BaseUserFilters addWebClientItem(WebClientOptions webClientItem) { + if (this.webClient == null) { + this.webClient = new ArrayList<>(); + } + this.webClient.add(webClientItem); + return this; + } + + /** + * WebClient/user REST API related configuration options + * @return webClient + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEB_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWebClient() { + return webClient; + } + + + @JsonProperty(JSON_PROPERTY_WEB_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebClient(List webClient) { + this.webClient = webClient; + } + + public BaseUserFilters allowApiKeyAuth(Boolean allowApiKeyAuth) { + + this.allowApiKeyAuth = allowApiKeyAuth; + return this; + } + + /** + * API key authentication allows to impersonate this user with an API key + * @return allowApiKeyAuth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowApiKeyAuth() { + return allowApiKeyAuth; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowApiKeyAuth(Boolean allowApiKeyAuth) { + this.allowApiKeyAuth = allowApiKeyAuth; + } + + public BaseUserFilters userType(UserType userType) { + + this.userType = userType; + return this; + } + + /** + * Get userType + * @return userType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserType getUserType() { + return userType; + } + + + @JsonProperty(JSON_PROPERTY_USER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserType(UserType userType) { + this.userType = userType; + } + + public BaseUserFilters bandwidthLimits(List bandwidthLimits) { + + this.bandwidthLimits = bandwidthLimits; + return this; + } + + public BaseUserFilters addBandwidthLimitsItem(BandwidthLimit bandwidthLimitsItem) { + if (this.bandwidthLimits == null) { + this.bandwidthLimits = new ArrayList<>(); + } + this.bandwidthLimits.add(bandwidthLimitsItem); + return this; + } + + /** + * Get bandwidthLimits + * @return bandwidthLimits + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BANDWIDTH_LIMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBandwidthLimits() { + return bandwidthLimits; + } + + + @JsonProperty(JSON_PROPERTY_BANDWIDTH_LIMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBandwidthLimits(List bandwidthLimits) { + this.bandwidthLimits = bandwidthLimits; + } + + public BaseUserFilters externalAuthCacheTime(Integer externalAuthCacheTime) { + + this.externalAuthCacheTime = externalAuthCacheTime; + return this; + } + + /** + * Defines the cache time, in seconds, for users authenticated using an external auth hook. 0 means no cache + * @return externalAuthCacheTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExternalAuthCacheTime() { + return externalAuthCacheTime; + } + + + @JsonProperty(JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalAuthCacheTime(Integer externalAuthCacheTime) { + this.externalAuthCacheTime = externalAuthCacheTime; + } + + public BaseUserFilters startDirectory(String startDirectory) { + + this.startDirectory = startDirectory; + return this; + } + + /** + * Specifies an alternate starting directory. If not set, the default is \"/\". This option is supported for SFTP/SCP, FTP and HTTP (WebClient/REST API) protocols. Relative paths will use this directory as base. + * @return startDirectory + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DIRECTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStartDirectory() { + return startDirectory; + } + + + @JsonProperty(JSON_PROPERTY_START_DIRECTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDirectory(String startDirectory) { + this.startDirectory = startDirectory; + } + + public BaseUserFilters twoFactorProtocols(List twoFactorProtocols) { + + this.twoFactorProtocols = twoFactorProtocols; + return this; + } + + public BaseUserFilters addTwoFactorProtocolsItem(MFAProtocols twoFactorProtocolsItem) { + if (this.twoFactorProtocols == null) { + this.twoFactorProtocols = new ArrayList<>(); + } + this.twoFactorProtocols.add(twoFactorProtocolsItem); + return this; + } + + /** + * Defines protocols that require two factor authentication + * @return twoFactorProtocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TWO_FACTOR_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTwoFactorProtocols() { + return twoFactorProtocols; + } + + + @JsonProperty(JSON_PROPERTY_TWO_FACTOR_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwoFactorProtocols(List twoFactorProtocols) { + this.twoFactorProtocols = twoFactorProtocols; + } + + public BaseUserFilters ftpSecurity(FtpSecurityEnum ftpSecurity) { + + this.ftpSecurity = ftpSecurity; + return this; + } + + /** + * Set to `1` to require TLS for both data and control connection. his setting is useful if you want to allow both encrypted and plain text FTP sessions globally and then you want to require encrypted sessions on a per-user basis. It has no effect if TLS is already required for all users in the configuration file. + * @return ftpSecurity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FTP_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FtpSecurityEnum getFtpSecurity() { + return ftpSecurity; + } + + + @JsonProperty(JSON_PROPERTY_FTP_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFtpSecurity(FtpSecurityEnum ftpSecurity) { + this.ftpSecurity = ftpSecurity; + } + + public BaseUserFilters isAnonymous(Boolean isAnonymous) { + + this.isAnonymous = isAnonymous; + return this; + } + + /** + * If enabled the user can login with any password or no password at all. Anonymous users are supported for FTP and WebDAV protocols and permissions will be automatically set to \"list\" and \"download\" (read only) + * @return isAnonymous + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ANONYMOUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsAnonymous() { + return isAnonymous; + } + + + @JsonProperty(JSON_PROPERTY_IS_ANONYMOUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAnonymous(Boolean isAnonymous) { + this.isAnonymous = isAnonymous; + } + + public BaseUserFilters defaultSharesExpiration(Integer defaultSharesExpiration) { + + this.defaultSharesExpiration = defaultSharesExpiration; + return this; + } + + /** + * Defines the default expiration for newly created shares as number of days. 0 means no expiration + * @return defaultSharesExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultSharesExpiration() { + return defaultSharesExpiration; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSharesExpiration(Integer defaultSharesExpiration) { + this.defaultSharesExpiration = defaultSharesExpiration; + } + + public BaseUserFilters maxSharesExpiration(Integer maxSharesExpiration) { + + this.maxSharesExpiration = maxSharesExpiration; + return this; + } + + /** + * Defines the maximum allowed expiration, as a number of days, when a user creates or updates a share. 0 means no expiration + * @return maxSharesExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxSharesExpiration() { + return maxSharesExpiration; + } + + + @JsonProperty(JSON_PROPERTY_MAX_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxSharesExpiration(Integer maxSharesExpiration) { + this.maxSharesExpiration = maxSharesExpiration; + } + + public BaseUserFilters passwordExpiration(Integer passwordExpiration) { + + this.passwordExpiration = passwordExpiration; + return this; + } + + /** + * The password expires after the defined number of days. 0 means no expiration + * @return passwordExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPasswordExpiration() { + return passwordExpiration; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPasswordExpiration(Integer passwordExpiration) { + this.passwordExpiration = passwordExpiration; + } + + public BaseUserFilters passwordStrength(Integer passwordStrength) { + + this.passwordStrength = passwordStrength; + return this; + } + + /** + * Defines the minimum password strength. 0 means disabled, any password will be accepted. Values in the 50-70 range are suggested for common use cases + * @return passwordStrength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD_STRENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPasswordStrength() { + return passwordStrength; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD_STRENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPasswordStrength(Integer passwordStrength) { + this.passwordStrength = passwordStrength; + } + + public BaseUserFilters accessTime(List accessTime) { + + this.accessTime = accessTime; + return this; + } + + public BaseUserFilters addAccessTimeItem(TimePeriod accessTimeItem) { + if (this.accessTime == null) { + this.accessTime = new ArrayList<>(); + } + this.accessTime.add(accessTimeItem); + return this; + } + + /** + * Get accessTime + * @return accessTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccessTime() { + return accessTime; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessTime(List accessTime) { + this.accessTime = accessTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseUserFilters baseUserFilters = (BaseUserFilters) o; + return Objects.equals(this.allowedIp, baseUserFilters.allowedIp) && + Objects.equals(this.deniedIp, baseUserFilters.deniedIp) && + Objects.equals(this.deniedLoginMethods, baseUserFilters.deniedLoginMethods) && + Objects.equals(this.deniedProtocols, baseUserFilters.deniedProtocols) && + Objects.equals(this.filePatterns, baseUserFilters.filePatterns) && + Objects.equals(this.maxUploadFileSize, baseUserFilters.maxUploadFileSize) && + Objects.equals(this.tlsUsername, baseUserFilters.tlsUsername) && + Objects.equals(this.tlsCerts, baseUserFilters.tlsCerts) && + Objects.equals(this.hooks, baseUserFilters.hooks) && + Objects.equals(this.disableFsChecks, baseUserFilters.disableFsChecks) && + Objects.equals(this.webClient, baseUserFilters.webClient) && + Objects.equals(this.allowApiKeyAuth, baseUserFilters.allowApiKeyAuth) && + Objects.equals(this.userType, baseUserFilters.userType) && + Objects.equals(this.bandwidthLimits, baseUserFilters.bandwidthLimits) && + Objects.equals(this.externalAuthCacheTime, baseUserFilters.externalAuthCacheTime) && + Objects.equals(this.startDirectory, baseUserFilters.startDirectory) && + Objects.equals(this.twoFactorProtocols, baseUserFilters.twoFactorProtocols) && + Objects.equals(this.ftpSecurity, baseUserFilters.ftpSecurity) && + Objects.equals(this.isAnonymous, baseUserFilters.isAnonymous) && + Objects.equals(this.defaultSharesExpiration, baseUserFilters.defaultSharesExpiration) && + Objects.equals(this.maxSharesExpiration, baseUserFilters.maxSharesExpiration) && + Objects.equals(this.passwordExpiration, baseUserFilters.passwordExpiration) && + Objects.equals(this.passwordStrength, baseUserFilters.passwordStrength) && + Objects.equals(this.accessTime, baseUserFilters.accessTime); + } + + @Override + public int hashCode() { + return Objects.hash(allowedIp, deniedIp, deniedLoginMethods, deniedProtocols, filePatterns, maxUploadFileSize, tlsUsername, tlsCerts, hooks, disableFsChecks, webClient, allowApiKeyAuth, userType, bandwidthLimits, externalAuthCacheTime, startDirectory, twoFactorProtocols, ftpSecurity, isAnonymous, defaultSharesExpiration, maxSharesExpiration, passwordExpiration, passwordStrength, accessTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseUserFilters {\n"); + sb.append(" allowedIp: ").append(toIndentedString(allowedIp)).append("\n"); + sb.append(" deniedIp: ").append(toIndentedString(deniedIp)).append("\n"); + sb.append(" deniedLoginMethods: ").append(toIndentedString(deniedLoginMethods)).append("\n"); + sb.append(" deniedProtocols: ").append(toIndentedString(deniedProtocols)).append("\n"); + sb.append(" filePatterns: ").append(toIndentedString(filePatterns)).append("\n"); + sb.append(" maxUploadFileSize: ").append(toIndentedString(maxUploadFileSize)).append("\n"); + sb.append(" tlsUsername: ").append(toIndentedString(tlsUsername)).append("\n"); + sb.append(" tlsCerts: ").append(toIndentedString(tlsCerts)).append("\n"); + sb.append(" hooks: ").append(toIndentedString(hooks)).append("\n"); + sb.append(" disableFsChecks: ").append(toIndentedString(disableFsChecks)).append("\n"); + sb.append(" webClient: ").append(toIndentedString(webClient)).append("\n"); + sb.append(" allowApiKeyAuth: ").append(toIndentedString(allowApiKeyAuth)).append("\n"); + sb.append(" userType: ").append(toIndentedString(userType)).append("\n"); + sb.append(" bandwidthLimits: ").append(toIndentedString(bandwidthLimits)).append("\n"); + sb.append(" externalAuthCacheTime: ").append(toIndentedString(externalAuthCacheTime)).append("\n"); + sb.append(" startDirectory: ").append(toIndentedString(startDirectory)).append("\n"); + sb.append(" twoFactorProtocols: ").append(toIndentedString(twoFactorProtocols)).append("\n"); + sb.append(" ftpSecurity: ").append(toIndentedString(ftpSecurity)).append("\n"); + sb.append(" isAnonymous: ").append(toIndentedString(isAnonymous)).append("\n"); + sb.append(" defaultSharesExpiration: ").append(toIndentedString(defaultSharesExpiration)).append("\n"); + sb.append(" maxSharesExpiration: ").append(toIndentedString(maxSharesExpiration)).append("\n"); + sb.append(" passwordExpiration: ").append(toIndentedString(passwordExpiration)).append("\n"); + sb.append(" passwordStrength: ").append(toIndentedString(passwordStrength)).append("\n"); + sb.append(" accessTime: ").append(toIndentedString(accessTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseVirtualFolder.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseVirtualFolder.java new file mode 100644 index 00000000..832b0eb4 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/BaseVirtualFolder.java @@ -0,0 +1,364 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FilesystemConfig; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines the filesystem for the virtual folder and the used quota limits. The same folder can be shared among multiple users and each user can have different quota limits or a different virtual path. + */ +@JsonPropertyOrder({ + BaseVirtualFolder.JSON_PROPERTY_ID, + BaseVirtualFolder.JSON_PROPERTY_NAME, + BaseVirtualFolder.JSON_PROPERTY_MAPPED_PATH, + BaseVirtualFolder.JSON_PROPERTY_DESCRIPTION, + BaseVirtualFolder.JSON_PROPERTY_USED_QUOTA_SIZE, + BaseVirtualFolder.JSON_PROPERTY_USED_QUOTA_FILES, + BaseVirtualFolder.JSON_PROPERTY_LAST_QUOTA_UPDATE, + BaseVirtualFolder.JSON_PROPERTY_USERS, + BaseVirtualFolder.JSON_PROPERTY_FILESYSTEM +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class BaseVirtualFolder { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_MAPPED_PATH = "mapped_path"; + private String mappedPath; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_USED_QUOTA_SIZE = "used_quota_size"; + private Long usedQuotaSize; + + public static final String JSON_PROPERTY_USED_QUOTA_FILES = "used_quota_files"; + private Integer usedQuotaFiles; + + public static final String JSON_PROPERTY_LAST_QUOTA_UPDATE = "last_quota_update"; + private Long lastQuotaUpdate; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILESYSTEM = "filesystem"; + private FilesystemConfig filesystem; + + public BaseVirtualFolder() { + } + + public BaseVirtualFolder id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public BaseVirtualFolder name(String name) { + + this.name = name; + return this; + } + + /** + * unique name for this virtual folder + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public BaseVirtualFolder mappedPath(String mappedPath) { + + this.mappedPath = mappedPath; + return this; + } + + /** + * absolute filesystem path to use as virtual folder + * @return mappedPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAPPED_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMappedPath() { + return mappedPath; + } + + + @JsonProperty(JSON_PROPERTY_MAPPED_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMappedPath(String mappedPath) { + this.mappedPath = mappedPath; + } + + public BaseVirtualFolder description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public BaseVirtualFolder usedQuotaSize(Long usedQuotaSize) { + + this.usedQuotaSize = usedQuotaSize; + return this; + } + + /** + * Get usedQuotaSize + * @return usedQuotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedQuotaSize() { + return usedQuotaSize; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaSize(Long usedQuotaSize) { + this.usedQuotaSize = usedQuotaSize; + } + + public BaseVirtualFolder usedQuotaFiles(Integer usedQuotaFiles) { + + this.usedQuotaFiles = usedQuotaFiles; + return this; + } + + /** + * Get usedQuotaFiles + * @return usedQuotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedQuotaFiles() { + return usedQuotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaFiles(Integer usedQuotaFiles) { + this.usedQuotaFiles = usedQuotaFiles; + } + + public BaseVirtualFolder lastQuotaUpdate(Long lastQuotaUpdate) { + + this.lastQuotaUpdate = lastQuotaUpdate; + return this; + } + + /** + * Last quota update as unix timestamp in milliseconds + * @return lastQuotaUpdate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_QUOTA_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastQuotaUpdate() { + return lastQuotaUpdate; + } + + + @JsonProperty(JSON_PROPERTY_LAST_QUOTA_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastQuotaUpdate(Long lastQuotaUpdate) { + this.lastQuotaUpdate = lastQuotaUpdate; + } + + public BaseVirtualFolder users(List users) { + + this.users = users; + return this; + } + + public BaseVirtualFolder addUsersItem(String usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * list of usernames associated with this virtual folder + * @return users + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + public BaseVirtualFolder filesystem(FilesystemConfig filesystem) { + + this.filesystem = filesystem; + return this; + } + + /** + * Get filesystem + * @return filesystem + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FilesystemConfig getFilesystem() { + return filesystem; + } + + + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesystem(FilesystemConfig filesystem) { + this.filesystem = filesystem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BaseVirtualFolder baseVirtualFolder = (BaseVirtualFolder) o; + return Objects.equals(this.id, baseVirtualFolder.id) && + Objects.equals(this.name, baseVirtualFolder.name) && + Objects.equals(this.mappedPath, baseVirtualFolder.mappedPath) && + Objects.equals(this.description, baseVirtualFolder.description) && + Objects.equals(this.usedQuotaSize, baseVirtualFolder.usedQuotaSize) && + Objects.equals(this.usedQuotaFiles, baseVirtualFolder.usedQuotaFiles) && + Objects.equals(this.lastQuotaUpdate, baseVirtualFolder.lastQuotaUpdate) && + Objects.equals(this.users, baseVirtualFolder.users) && + Objects.equals(this.filesystem, baseVirtualFolder.filesystem); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, mappedPath, description, usedQuotaSize, usedQuotaFiles, lastQuotaUpdate, users, filesystem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BaseVirtualFolder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" mappedPath: ").append(toIndentedString(mappedPath)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" usedQuotaSize: ").append(toIndentedString(usedQuotaSize)).append("\n"); + sb.append(" usedQuotaFiles: ").append(toIndentedString(usedQuotaFiles)).append("\n"); + sb.append(" lastQuotaUpdate: ").append(toIndentedString(lastQuotaUpdate)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" filesystem: ").append(toIndentedString(filesystem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionOptions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionOptions.java new file mode 100644 index 00000000..d3791301 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionOptions.java @@ -0,0 +1,495 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ConditionPattern; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ConditionOptions + */ +@JsonPropertyOrder({ + ConditionOptions.JSON_PROPERTY_NAMES, + ConditionOptions.JSON_PROPERTY_GROUP_NAMES, + ConditionOptions.JSON_PROPERTY_ROLE_NAMES, + ConditionOptions.JSON_PROPERTY_FS_PATHS, + ConditionOptions.JSON_PROPERTY_PROTOCOLS, + ConditionOptions.JSON_PROPERTY_PROVIDER_OBJECTS, + ConditionOptions.JSON_PROPERTY_MIN_SIZE, + ConditionOptions.JSON_PROPERTY_MAX_SIZE, + ConditionOptions.JSON_PROPERTY_CONCURRENT_EXECUTION +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ConditionOptions { + public static final String JSON_PROPERTY_NAMES = "names"; + private List names = new ArrayList<>(); + + public static final String JSON_PROPERTY_GROUP_NAMES = "group_names"; + private List groupNames = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROLE_NAMES = "role_names"; + private List roleNames = new ArrayList<>(); + + public static final String JSON_PROPERTY_FS_PATHS = "fs_paths"; + private List fsPaths = new ArrayList<>(); + + /** + * Gets or Sets protocols + */ + public enum ProtocolsEnum { + SFTP("SFTP"), + + SCP("SCP"), + + SSH("SSH"), + + FTP("FTP"), + + DAV("DAV"), + + HTTP("HTTP"), + + HTTP_SHARE("HTTPShare"), + + OIDC("OIDC"); + + private String value; + + ProtocolsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProtocolsEnum fromValue(String value) { + for (ProtocolsEnum b : ProtocolsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PROTOCOLS = "protocols"; + private List protocols = new ArrayList<>(); + + /** + * Gets or Sets providerObjects + */ + public enum ProviderObjectsEnum { + USER("user"), + + GROUP("group"), + + ADMIN("admin"), + + API_KEY("api_key"), + + SHARE("share"), + + EVENT_ACTION("event_action"), + + EVENT_RULE("event_rule"); + + private String value; + + ProviderObjectsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProviderObjectsEnum fromValue(String value) { + for (ProviderObjectsEnum b : ProviderObjectsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PROVIDER_OBJECTS = "provider_objects"; + private List providerObjects = new ArrayList<>(); + + public static final String JSON_PROPERTY_MIN_SIZE = "min_size"; + private Long minSize; + + public static final String JSON_PROPERTY_MAX_SIZE = "max_size"; + private Long maxSize; + + public static final String JSON_PROPERTY_CONCURRENT_EXECUTION = "concurrent_execution"; + private Boolean concurrentExecution; + + public ConditionOptions() { + } + + public ConditionOptions names(List names) { + + this.names = names; + return this; + } + + public ConditionOptions addNamesItem(ConditionPattern namesItem) { + if (this.names == null) { + this.names = new ArrayList<>(); + } + this.names.add(namesItem); + return this; + } + + /** + * Get names + * @return names + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNames() { + return names; + } + + + @JsonProperty(JSON_PROPERTY_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNames(List names) { + this.names = names; + } + + public ConditionOptions groupNames(List groupNames) { + + this.groupNames = groupNames; + return this; + } + + public ConditionOptions addGroupNamesItem(ConditionPattern groupNamesItem) { + if (this.groupNames == null) { + this.groupNames = new ArrayList<>(); + } + this.groupNames.add(groupNamesItem); + return this; + } + + /** + * Get groupNames + * @return groupNames + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroupNames() { + return groupNames; + } + + + @JsonProperty(JSON_PROPERTY_GROUP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroupNames(List groupNames) { + this.groupNames = groupNames; + } + + public ConditionOptions roleNames(List roleNames) { + + this.roleNames = roleNames; + return this; + } + + public ConditionOptions addRoleNamesItem(ConditionPattern roleNamesItem) { + if (this.roleNames == null) { + this.roleNames = new ArrayList<>(); + } + this.roleNames.add(roleNamesItem); + return this; + } + + /** + * Get roleNames + * @return roleNames + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRoleNames() { + return roleNames; + } + + + @JsonProperty(JSON_PROPERTY_ROLE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoleNames(List roleNames) { + this.roleNames = roleNames; + } + + public ConditionOptions fsPaths(List fsPaths) { + + this.fsPaths = fsPaths; + return this; + } + + public ConditionOptions addFsPathsItem(ConditionPattern fsPathsItem) { + if (this.fsPaths == null) { + this.fsPaths = new ArrayList<>(); + } + this.fsPaths.add(fsPathsItem); + return this; + } + + /** + * Get fsPaths + * @return fsPaths + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFsPaths() { + return fsPaths; + } + + + @JsonProperty(JSON_PROPERTY_FS_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsPaths(List fsPaths) { + this.fsPaths = fsPaths; + } + + public ConditionOptions protocols(List protocols) { + + this.protocols = protocols; + return this; + } + + public ConditionOptions addProtocolsItem(ProtocolsEnum protocolsItem) { + if (this.protocols == null) { + this.protocols = new ArrayList<>(); + } + this.protocols.add(protocolsItem); + return this; + } + + /** + * Get protocols + * @return protocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProtocols() { + return protocols; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocols(List protocols) { + this.protocols = protocols; + } + + public ConditionOptions providerObjects(List providerObjects) { + + this.providerObjects = providerObjects; + return this; + } + + public ConditionOptions addProviderObjectsItem(ProviderObjectsEnum providerObjectsItem) { + if (this.providerObjects == null) { + this.providerObjects = new ArrayList<>(); + } + this.providerObjects.add(providerObjectsItem); + return this; + } + + /** + * Get providerObjects + * @return providerObjects + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER_OBJECTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProviderObjects() { + return providerObjects; + } + + + @JsonProperty(JSON_PROPERTY_PROVIDER_OBJECTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderObjects(List providerObjects) { + this.providerObjects = providerObjects; + } + + public ConditionOptions minSize(Long minSize) { + + this.minSize = minSize; + return this; + } + + /** + * Get minSize + * @return minSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getMinSize() { + return minSize; + } + + + @JsonProperty(JSON_PROPERTY_MIN_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinSize(Long minSize) { + this.minSize = minSize; + } + + public ConditionOptions maxSize(Long maxSize) { + + this.maxSize = maxSize; + return this; + } + + /** + * Get maxSize + * @return maxSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getMaxSize() { + return maxSize; + } + + + @JsonProperty(JSON_PROPERTY_MAX_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxSize(Long maxSize) { + this.maxSize = maxSize; + } + + public ConditionOptions concurrentExecution(Boolean concurrentExecution) { + + this.concurrentExecution = concurrentExecution; + return this; + } + + /** + * allow concurrent execution from multiple nodes + * @return concurrentExecution + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONCURRENT_EXECUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getConcurrentExecution() { + return concurrentExecution; + } + + + @JsonProperty(JSON_PROPERTY_CONCURRENT_EXECUTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConcurrentExecution(Boolean concurrentExecution) { + this.concurrentExecution = concurrentExecution; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionOptions conditionOptions = (ConditionOptions) o; + return Objects.equals(this.names, conditionOptions.names) && + Objects.equals(this.groupNames, conditionOptions.groupNames) && + Objects.equals(this.roleNames, conditionOptions.roleNames) && + Objects.equals(this.fsPaths, conditionOptions.fsPaths) && + Objects.equals(this.protocols, conditionOptions.protocols) && + Objects.equals(this.providerObjects, conditionOptions.providerObjects) && + Objects.equals(this.minSize, conditionOptions.minSize) && + Objects.equals(this.maxSize, conditionOptions.maxSize) && + Objects.equals(this.concurrentExecution, conditionOptions.concurrentExecution); + } + + @Override + public int hashCode() { + return Objects.hash(names, groupNames, roleNames, fsPaths, protocols, providerObjects, minSize, maxSize, concurrentExecution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionOptions {\n"); + sb.append(" names: ").append(toIndentedString(names)).append("\n"); + sb.append(" groupNames: ").append(toIndentedString(groupNames)).append("\n"); + sb.append(" roleNames: ").append(toIndentedString(roleNames)).append("\n"); + sb.append(" fsPaths: ").append(toIndentedString(fsPaths)).append("\n"); + sb.append(" protocols: ").append(toIndentedString(protocols)).append("\n"); + sb.append(" providerObjects: ").append(toIndentedString(providerObjects)).append("\n"); + sb.append(" minSize: ").append(toIndentedString(minSize)).append("\n"); + sb.append(" maxSize: ").append(toIndentedString(maxSize)).append("\n"); + sb.append(" concurrentExecution: ").append(toIndentedString(concurrentExecution)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionPattern.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionPattern.java new file mode 100644 index 00000000..d5149125 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConditionPattern.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ConditionPattern + */ +@JsonPropertyOrder({ + ConditionPattern.JSON_PROPERTY_PATTERN, + ConditionPattern.JSON_PROPERTY_INVERSE_MATCH +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ConditionPattern { + public static final String JSON_PROPERTY_PATTERN = "pattern"; + private String pattern; + + public static final String JSON_PROPERTY_INVERSE_MATCH = "inverse_match"; + private Boolean inverseMatch; + + public ConditionPattern() { + } + + public ConditionPattern pattern(String pattern) { + + this.pattern = pattern; + return this; + } + + /** + * Get pattern + * @return pattern + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPattern() { + return pattern; + } + + + @JsonProperty(JSON_PROPERTY_PATTERN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public ConditionPattern inverseMatch(Boolean inverseMatch) { + + this.inverseMatch = inverseMatch; + return this; + } + + /** + * Get inverseMatch + * @return inverseMatch + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INVERSE_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getInverseMatch() { + return inverseMatch; + } + + + @JsonProperty(JSON_PROPERTY_INVERSE_MATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInverseMatch(Boolean inverseMatch) { + this.inverseMatch = inverseMatch; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConditionPattern conditionPattern = (ConditionPattern) o; + return Objects.equals(this.pattern, conditionPattern.pattern) && + Objects.equals(this.inverseMatch, conditionPattern.inverseMatch); + } + + @Override + public int hashCode() { + return Objects.hash(pattern, inverseMatch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConditionPattern {\n"); + sb.append(" pattern: ").append(toIndentedString(pattern)).append("\n"); + sb.append(" inverseMatch: ").append(toIndentedString(inverseMatch)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConnectionStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConnectionStatus.java new file mode 100644 index 00000000..45775851 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ConnectionStatus.java @@ -0,0 +1,435 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Transfer; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ConnectionStatus + */ +@JsonPropertyOrder({ + ConnectionStatus.JSON_PROPERTY_USERNAME, + ConnectionStatus.JSON_PROPERTY_CONNECTION_ID, + ConnectionStatus.JSON_PROPERTY_CLIENT_VERSION, + ConnectionStatus.JSON_PROPERTY_REMOTE_ADDRESS, + ConnectionStatus.JSON_PROPERTY_CONNECTION_TIME, + ConnectionStatus.JSON_PROPERTY_COMMAND, + ConnectionStatus.JSON_PROPERTY_LAST_ACTIVITY, + ConnectionStatus.JSON_PROPERTY_PROTOCOL, + ConnectionStatus.JSON_PROPERTY_ACTIVE_TRANSFERS, + ConnectionStatus.JSON_PROPERTY_NODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ConnectionStatus { + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_CONNECTION_ID = "connection_id"; + private String connectionId; + + public static final String JSON_PROPERTY_CLIENT_VERSION = "client_version"; + private String clientVersion; + + public static final String JSON_PROPERTY_REMOTE_ADDRESS = "remote_address"; + private String remoteAddress; + + public static final String JSON_PROPERTY_CONNECTION_TIME = "connection_time"; + private Long connectionTime; + + public static final String JSON_PROPERTY_COMMAND = "command"; + private String command; + + public static final String JSON_PROPERTY_LAST_ACTIVITY = "last_activity"; + private Long lastActivity; + + /** + * Gets or Sets protocol + */ + public enum ProtocolEnum { + SFTP("SFTP"), + + SCP("SCP"), + + SSH("SSH"), + + FTP("FTP"), + + DAV("DAV"); + + private String value; + + ProtocolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProtocolEnum fromValue(String value) { + for (ProtocolEnum b : ProtocolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private ProtocolEnum protocol; + + public static final String JSON_PROPERTY_ACTIVE_TRANSFERS = "active_transfers"; + private List activeTransfers = new ArrayList<>(); + + public static final String JSON_PROPERTY_NODE = "node"; + private String node; + + public ConnectionStatus() { + } + + public ConnectionStatus username(String username) { + + this.username = username; + return this; + } + + /** + * connected username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public ConnectionStatus connectionId(String connectionId) { + + this.connectionId = connectionId; + return this; + } + + /** + * unique connection identifier + * @return connectionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConnectionId() { + return connectionId; + } + + + @JsonProperty(JSON_PROPERTY_CONNECTION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConnectionId(String connectionId) { + this.connectionId = connectionId; + } + + public ConnectionStatus clientVersion(String clientVersion) { + + this.clientVersion = clientVersion; + return this; + } + + /** + * client version + * @return clientVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClientVersion() { + return clientVersion; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientVersion(String clientVersion) { + this.clientVersion = clientVersion; + } + + public ConnectionStatus remoteAddress(String remoteAddress) { + + this.remoteAddress = remoteAddress; + return this; + } + + /** + * Remote address for the connected client + * @return remoteAddress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMOTE_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRemoteAddress() { + return remoteAddress; + } + + + @JsonProperty(JSON_PROPERTY_REMOTE_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRemoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + } + + public ConnectionStatus connectionTime(Long connectionTime) { + + this.connectionTime = connectionTime; + return this; + } + + /** + * connection time as unix timestamp in milliseconds + * @return connectionTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getConnectionTime() { + return connectionTime; + } + + + @JsonProperty(JSON_PROPERTY_CONNECTION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConnectionTime(Long connectionTime) { + this.connectionTime = connectionTime; + } + + public ConnectionStatus command(String command) { + + this.command = command; + return this; + } + + /** + * Last SSH/FTP command or WebDAV method + * @return command + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCommand() { + return command; + } + + + @JsonProperty(JSON_PROPERTY_COMMAND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommand(String command) { + this.command = command; + } + + public ConnectionStatus lastActivity(Long lastActivity) { + + this.lastActivity = lastActivity; + return this; + } + + /** + * last client activity as unix timestamp in milliseconds + * @return lastActivity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastActivity() { + return lastActivity; + } + + + @JsonProperty(JSON_PROPERTY_LAST_ACTIVITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastActivity(Long lastActivity) { + this.lastActivity = lastActivity; + } + + public ConnectionStatus protocol(ProtocolEnum protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * @return protocol + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ProtocolEnum getProtocol() { + return protocol; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(ProtocolEnum protocol) { + this.protocol = protocol; + } + + public ConnectionStatus activeTransfers(List activeTransfers) { + + this.activeTransfers = activeTransfers; + return this; + } + + public ConnectionStatus addActiveTransfersItem(Transfer activeTransfersItem) { + if (this.activeTransfers == null) { + this.activeTransfers = new ArrayList<>(); + } + this.activeTransfers.add(activeTransfersItem); + return this; + } + + /** + * Get activeTransfers + * @return activeTransfers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTIVE_TRANSFERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getActiveTransfers() { + return activeTransfers; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE_TRANSFERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActiveTransfers(List activeTransfers) { + this.activeTransfers = activeTransfers; + } + + public ConnectionStatus node(String node) { + + this.node = node; + return this; + } + + /** + * Node identifier, omitted for single node installations + * @return node + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNode() { + return node; + } + + + @JsonProperty(JSON_PROPERTY_NODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNode(String node) { + this.node = node; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionStatus connectionStatus = (ConnectionStatus) o; + return Objects.equals(this.username, connectionStatus.username) && + Objects.equals(this.connectionId, connectionStatus.connectionId) && + Objects.equals(this.clientVersion, connectionStatus.clientVersion) && + Objects.equals(this.remoteAddress, connectionStatus.remoteAddress) && + Objects.equals(this.connectionTime, connectionStatus.connectionTime) && + Objects.equals(this.command, connectionStatus.command) && + Objects.equals(this.lastActivity, connectionStatus.lastActivity) && + Objects.equals(this.protocol, connectionStatus.protocol) && + Objects.equals(this.activeTransfers, connectionStatus.activeTransfers) && + Objects.equals(this.node, connectionStatus.node); + } + + @Override + public int hashCode() { + return Objects.hash(username, connectionId, clientVersion, remoteAddress, connectionTime, command, lastActivity, protocol, activeTransfers, node); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionStatus {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" connectionId: ").append(toIndentedString(connectionId)).append("\n"); + sb.append(" clientVersion: ").append(toIndentedString(clientVersion)).append("\n"); + sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); + sb.append(" connectionTime: ").append(toIndentedString(connectionTime)).append("\n"); + sb.append(" command: ").append(toIndentedString(command)).append("\n"); + sb.append(" lastActivity: ").append(toIndentedString(lastActivity)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" activeTransfers: ").append(toIndentedString(activeTransfers)).append("\n"); + sb.append(" node: ").append(toIndentedString(node)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/CryptFsConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/CryptFsConfig.java new file mode 100644 index 00000000..8a695259 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/CryptFsConfig.java @@ -0,0 +1,170 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Crypt filesystem configuration details + */ +@JsonPropertyOrder({ + CryptFsConfig.JSON_PROPERTY_PASSPHRASE, + CryptFsConfig.JSON_PROPERTY_READ_BUFFER_SIZE, + CryptFsConfig.JSON_PROPERTY_WRITE_BUFFER_SIZE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class CryptFsConfig { + public static final String JSON_PROPERTY_PASSPHRASE = "passphrase"; + private Secret passphrase; + + public static final String JSON_PROPERTY_READ_BUFFER_SIZE = "read_buffer_size"; + private Integer readBufferSize; + + public static final String JSON_PROPERTY_WRITE_BUFFER_SIZE = "write_buffer_size"; + private Integer writeBufferSize; + + public CryptFsConfig() { + } + + public CryptFsConfig passphrase(Secret passphrase) { + + this.passphrase = passphrase; + return this; + } + + /** + * Get passphrase + * @return passphrase + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSPHRASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getPassphrase() { + return passphrase; + } + + + @JsonProperty(JSON_PROPERTY_PASSPHRASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassphrase(Secret passphrase) { + this.passphrase = passphrase; + } + + public CryptFsConfig readBufferSize(Integer readBufferSize) { + + this.readBufferSize = readBufferSize; + return this; + } + + /** + * The read buffer size, as MB, to use for downloads. 0 means no buffering, that's fine in most use cases. + * minimum: 0 + * maximum: 10 + * @return readBufferSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_READ_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getReadBufferSize() { + return readBufferSize; + } + + + @JsonProperty(JSON_PROPERTY_READ_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReadBufferSize(Integer readBufferSize) { + this.readBufferSize = readBufferSize; + } + + public CryptFsConfig writeBufferSize(Integer writeBufferSize) { + + this.writeBufferSize = writeBufferSize; + return this; + } + + /** + * The write buffer size, as MB, to use for uploads. 0 means no buffering, that's fine in most use cases. + * minimum: 0 + * maximum: 10 + * @return writeBufferSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WRITE_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWriteBufferSize() { + return writeBufferSize; + } + + + @JsonProperty(JSON_PROPERTY_WRITE_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWriteBufferSize(Integer writeBufferSize) { + this.writeBufferSize = writeBufferSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CryptFsConfig cryptFsConfig = (CryptFsConfig) o; + return Objects.equals(this.passphrase, cryptFsConfig.passphrase) && + Objects.equals(this.readBufferSize, cryptFsConfig.readBufferSize) && + Objects.equals(this.writeBufferSize, cryptFsConfig.writeBufferSize); + } + + @Override + public int hashCode() { + return Objects.hash(passphrase, readBufferSize, writeBufferSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CryptFsConfig {\n"); + sb.append(" passphrase: ").append(toIndentedString(passphrase)).append("\n"); + sb.append(" readBufferSize: ").append(toIndentedString(readBufferSize)).append("\n"); + sb.append(" writeBufferSize: ").append(toIndentedString(writeBufferSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DataProviderStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DataProviderStatus.java new file mode 100644 index 00000000..409b1e23 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DataProviderStatus.java @@ -0,0 +1,165 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DataProviderStatus + */ +@JsonPropertyOrder({ + DataProviderStatus.JSON_PROPERTY_IS_ACTIVE, + DataProviderStatus.JSON_PROPERTY_DRIVER, + DataProviderStatus.JSON_PROPERTY_ERROR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class DataProviderStatus { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + private Boolean isActive; + + public static final String JSON_PROPERTY_DRIVER = "driver"; + private String driver; + + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public DataProviderStatus() { + } + + public DataProviderStatus isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public DataProviderStatus driver(String driver) { + + this.driver = driver; + return this; + } + + /** + * Get driver + * @return driver + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DRIVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDriver() { + return driver; + } + + + @JsonProperty(JSON_PROPERTY_DRIVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDriver(String driver) { + this.driver = driver; + } + + public DataProviderStatus error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(String error) { + this.error = error; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataProviderStatus dataProviderStatus = (DataProviderStatus) o; + return Objects.equals(this.isActive, dataProviderStatus.isActive) && + Objects.equals(this.driver, dataProviderStatus.driver) && + Objects.equals(this.error, dataProviderStatus.error); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, driver, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataProviderStatus {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" driver: ").append(toIndentedString(driver)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DefenderEntry.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DefenderEntry.java new file mode 100644 index 00000000..679e74f7 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DefenderEntry.java @@ -0,0 +1,197 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DefenderEntry + */ +@JsonPropertyOrder({ + DefenderEntry.JSON_PROPERTY_ID, + DefenderEntry.JSON_PROPERTY_IP, + DefenderEntry.JSON_PROPERTY_SCORE, + DefenderEntry.JSON_PROPERTY_BAN_TIME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class DefenderEntry { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_SCORE = "score"; + private Integer score; + + public static final String JSON_PROPERTY_BAN_TIME = "ban_time"; + private OffsetDateTime banTime; + + public DefenderEntry() { + } + + public DefenderEntry id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + public DefenderEntry ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Get ip + * @return ip + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + public DefenderEntry score(Integer score) { + + this.score = score; + return this; + } + + /** + * the score increases whenever a violation is detected, such as an attempt to log in using an incorrect password or invalid username. If the score exceeds the configured threshold, the IP is banned. Omitted for banned IPs + * @return score + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getScore() { + return score; + } + + + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScore(Integer score) { + this.score = score; + } + + public DefenderEntry banTime(OffsetDateTime banTime) { + + this.banTime = banTime; + return this; + } + + /** + * date time until the IP is banned. For already banned hosts, the ban time is increased each time a new violation is detected. Omitted if the IP is not banned + * @return banTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAN_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getBanTime() { + return banTime; + } + + + @JsonProperty(JSON_PROPERTY_BAN_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBanTime(OffsetDateTime banTime) { + this.banTime = banTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefenderEntry defenderEntry = (DefenderEntry) o; + return Objects.equals(this.id, defenderEntry.id) && + Objects.equals(this.ip, defenderEntry.ip) && + Objects.equals(this.score, defenderEntry.score) && + Objects.equals(this.banTime, defenderEntry.banTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, ip, score, banTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefenderEntry {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" banTime: ").append(toIndentedString(banTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DirEntry.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DirEntry.java new file mode 100644 index 00000000..4b9eba12 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DirEntry.java @@ -0,0 +1,197 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DirEntry + */ +@JsonPropertyOrder({ + DirEntry.JSON_PROPERTY_NAME, + DirEntry.JSON_PROPERTY_SIZE, + DirEntry.JSON_PROPERTY_MODE, + DirEntry.JSON_PROPERTY_LAST_MODIFIED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class DirEntry { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_MODE = "mode"; + private Integer mode; + + public static final String JSON_PROPERTY_LAST_MODIFIED = "last_modified"; + private OffsetDateTime lastModified; + + public DirEntry() { + } + + public DirEntry name(String name) { + + this.name = name; + return this; + } + + /** + * name of the file (or subdirectory) described by the entry. This name is the final element of the path (the base name), not the entire path + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public DirEntry size(Long size) { + + this.size = size; + return this; + } + + /** + * file size, omitted for folders and non regular files + * @return size + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(Long size) { + this.size = size; + } + + public DirEntry mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * File mode and permission bits. More details here: https://golang.org/pkg/io/fs/#FileMode. Let's see some examples: - for a directory mode&2147483648 != 0 - for a symlink mode&134217728 != 0 - for a regular file mode&2401763328 == 0 + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMode() { + return mode; + } + + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(Integer mode) { + this.mode = mode; + } + + public DirEntry lastModified(OffsetDateTime lastModified) { + + this.lastModified = lastModified; + return this; + } + + /** + * Get lastModified + * @return lastModified + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getLastModified() { + return lastModified; + } + + + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastModified(OffsetDateTime lastModified) { + this.lastModified = lastModified; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirEntry dirEntry = (DirEntry) o; + return Objects.equals(this.name, dirEntry.name) && + Objects.equals(this.size, dirEntry.size) && + Objects.equals(this.mode, dirEntry.mode) && + Objects.equals(this.lastModified, dirEntry.lastModified); + } + + @Override + public int hashCode() { + return Objects.hash(name, size, mode, lastModified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirEntry {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" lastModified: ").append(toIndentedString(lastModified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DumpDataScopes.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DumpDataScopes.java new file mode 100644 index 00000000..66556cb6 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/DumpDataScopes.java @@ -0,0 +1,77 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets DumpDataScopes + */ +public enum DumpDataScopes { + + USERS("users"), + + FOLDERS("folders"), + + GROUPS("groups"), + + ADMINS("admins"), + + API_KEYS("api_keys"), + + SHARES("shares"), + + ACTIONS("actions"), + + RULES("rules"), + + ROLES("roles"), + + IP_LISTS("ip_lists"), + + CONFIGS("configs"); + + private String value; + + DumpDataScopes(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DumpDataScopes fromValue(String value) { + for (DumpDataScopes b : DumpDataScopes.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Dumpdata200Response.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Dumpdata200Response.java new file mode 100644 index 00000000..816ed72f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Dumpdata200Response.java @@ -0,0 +1,531 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.APIKey; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Admin; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BackupData; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseVirtualFolder; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventRule; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Group; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ModelApiResponse; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Role; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Share; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Dumpdata200Response + */ +@JsonPropertyOrder({ + Dumpdata200Response.JSON_PROPERTY_MESSAGE, + Dumpdata200Response.JSON_PROPERTY_ERROR, + Dumpdata200Response.JSON_PROPERTY_USERS, + Dumpdata200Response.JSON_PROPERTY_FOLDERS, + Dumpdata200Response.JSON_PROPERTY_GROUPS, + Dumpdata200Response.JSON_PROPERTY_ADMINS, + Dumpdata200Response.JSON_PROPERTY_API_KEYS, + Dumpdata200Response.JSON_PROPERTY_SHARES, + Dumpdata200Response.JSON_PROPERTY_EVENT_ACTIONS, + Dumpdata200Response.JSON_PROPERTY_EVENT_RULES, + Dumpdata200Response.JSON_PROPERTY_ROLES, + Dumpdata200Response.JSON_PROPERTY_VERSION +}) +@JsonTypeName("dumpdata_200_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Dumpdata200Response { + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_FOLDERS = "folders"; + private List folders = new ArrayList<>(); + + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_ADMINS = "admins"; + private List admins = new ArrayList<>(); + + public static final String JSON_PROPERTY_API_KEYS = "api_keys"; + private List apiKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_SHARES = "shares"; + private List shares = new ArrayList<>(); + + public static final String JSON_PROPERTY_EVENT_ACTIONS = "event_actions"; + private List eventActions = new ArrayList<>(); + + public static final String JSON_PROPERTY_EVENT_RULES = "event_rules"; + private List eventRules = new ArrayList<>(); + + public static final String JSON_PROPERTY_ROLES = "roles"; + private List roles = new ArrayList<>(); + + public static final String JSON_PROPERTY_VERSION = "version"; + private Integer version; + + public Dumpdata200Response() { + } + + public Dumpdata200Response message(String message) { + + this.message = message; + return this; + } + + /** + * message, can be empty + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public Dumpdata200Response error(String error) { + + this.error = error; + return this; + } + + /** + * error description if any + * @return error + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(String error) { + this.error = error; + } + + public Dumpdata200Response users(List users) { + + this.users = users; + return this; + } + + public Dumpdata200Response addUsersItem(User usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + public Dumpdata200Response folders(List folders) { + + this.folders = folders; + return this; + } + + public Dumpdata200Response addFoldersItem(BaseVirtualFolder foldersItem) { + if (this.folders == null) { + this.folders = new ArrayList<>(); + } + this.folders.add(foldersItem); + return this; + } + + /** + * Get folders + * @return folders + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFolders() { + return folders; + } + + + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolders(List folders) { + this.folders = folders; + } + + public Dumpdata200Response groups(List groups) { + + this.groups = groups; + return this; + } + + public Dumpdata200Response addGroupsItem(Group groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Get groups + * @return groups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroups() { + return groups; + } + + + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroups(List groups) { + this.groups = groups; + } + + public Dumpdata200Response admins(List admins) { + + this.admins = admins; + return this; + } + + public Dumpdata200Response addAdminsItem(Admin adminsItem) { + if (this.admins == null) { + this.admins = new ArrayList<>(); + } + this.admins.add(adminsItem); + return this; + } + + /** + * Get admins + * @return admins + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAdmins() { + return admins; + } + + + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdmins(List admins) { + this.admins = admins; + } + + public Dumpdata200Response apiKeys(List apiKeys) { + + this.apiKeys = apiKeys; + return this; + } + + public Dumpdata200Response addApiKeysItem(APIKey apiKeysItem) { + if (this.apiKeys == null) { + this.apiKeys = new ArrayList<>(); + } + this.apiKeys.add(apiKeysItem); + return this; + } + + /** + * Get apiKeys + * @return apiKeys + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getApiKeys() { + return apiKeys; + } + + + @JsonProperty(JSON_PROPERTY_API_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKeys(List apiKeys) { + this.apiKeys = apiKeys; + } + + public Dumpdata200Response shares(List shares) { + + this.shares = shares; + return this; + } + + public Dumpdata200Response addSharesItem(Share sharesItem) { + if (this.shares == null) { + this.shares = new ArrayList<>(); + } + this.shares.add(sharesItem); + return this; + } + + /** + * Get shares + * @return shares + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHARES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getShares() { + return shares; + } + + + @JsonProperty(JSON_PROPERTY_SHARES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShares(List shares) { + this.shares = shares; + } + + public Dumpdata200Response eventActions(List eventActions) { + + this.eventActions = eventActions; + return this; + } + + public Dumpdata200Response addEventActionsItem(EventAction eventActionsItem) { + if (this.eventActions == null) { + this.eventActions = new ArrayList<>(); + } + this.eventActions.add(eventActionsItem); + return this; + } + + /** + * Get eventActions + * @return eventActions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEventActions() { + return eventActions; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventActions(List eventActions) { + this.eventActions = eventActions; + } + + public Dumpdata200Response eventRules(List eventRules) { + + this.eventRules = eventRules; + return this; + } + + public Dumpdata200Response addEventRulesItem(EventRule eventRulesItem) { + if (this.eventRules == null) { + this.eventRules = new ArrayList<>(); + } + this.eventRules.add(eventRulesItem); + return this; + } + + /** + * Get eventRules + * @return eventRules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEventRules() { + return eventRules; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventRules(List eventRules) { + this.eventRules = eventRules; + } + + public Dumpdata200Response roles(List roles) { + + this.roles = roles; + return this; + } + + public Dumpdata200Response addRolesItem(Role rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Get roles + * @return roles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRoles() { + return roles; + } + + + @JsonProperty(JSON_PROPERTY_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoles(List roles) { + this.roles = roles; + } + + public Dumpdata200Response version(Integer version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getVersion() { + return version; + } + + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(Integer version) { + this.version = version; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dumpdata200Response dumpdata200Response = (Dumpdata200Response) o; + return Objects.equals(this.message, dumpdata200Response.message) && + Objects.equals(this.error, dumpdata200Response.error) && + Objects.equals(this.users, dumpdata200Response.users) && + Objects.equals(this.folders, dumpdata200Response.folders) && + Objects.equals(this.groups, dumpdata200Response.groups) && + Objects.equals(this.admins, dumpdata200Response.admins) && + Objects.equals(this.apiKeys, dumpdata200Response.apiKeys) && + Objects.equals(this.shares, dumpdata200Response.shares) && + Objects.equals(this.eventActions, dumpdata200Response.eventActions) && + Objects.equals(this.eventRules, dumpdata200Response.eventRules) && + Objects.equals(this.roles, dumpdata200Response.roles) && + Objects.equals(this.version, dumpdata200Response.version); + } + + @Override + public int hashCode() { + return Objects.hash(message, error, users, folders, groups, admins, apiKeys, shares, eventActions, eventRules, roles, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dumpdata200Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" folders: ").append(toIndentedString(folders)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" admins: ").append(toIndentedString(admins)).append("\n"); + sb.append(" apiKeys: ").append(toIndentedString(apiKeys)).append("\n"); + sb.append(" shares: ").append(toIndentedString(shares)).append("\n"); + sb.append(" eventActions: ").append(toIndentedString(eventActions)).append("\n"); + sb.append(" eventRules: ").append(toIndentedString(eventRules)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventAction.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventAction.java new file mode 100644 index 00000000..976a54c6 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventAction.java @@ -0,0 +1,335 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseEventActionOptions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionOptions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionTypes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventAction + */ +@JsonPropertyOrder({ + EventAction.JSON_PROPERTY_ID, + EventAction.JSON_PROPERTY_NAME, + EventAction.JSON_PROPERTY_DESCRIPTION, + EventAction.JSON_PROPERTY_TYPE, + EventAction.JSON_PROPERTY_OPTIONS, + EventAction.JSON_PROPERTY_RULES, + EventAction.JSON_PROPERTY_ORDER, + EventAction.JSON_PROPERTY_RELATION_OPTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventAction { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EventActionTypes type; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private BaseEventActionOptions options; + + public static final String JSON_PROPERTY_RULES = "rules"; + private List rules = new ArrayList<>(); + + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; + + public static final String JSON_PROPERTY_RELATION_OPTIONS = "relation_options"; + private EventActionOptions relationOptions; + + public EventAction() { + } + + public EventAction id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public EventAction name(String name) { + + this.name = name; + return this; + } + + /** + * unique name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public EventAction description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public EventAction type(EventActionTypes type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionTypes getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(EventActionTypes type) { + this.type = type; + } + + public EventAction options(BaseEventActionOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BaseEventActionOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(BaseEventActionOptions options) { + this.options = options; + } + + public EventAction rules(List rules) { + + this.rules = rules; + return this; + } + + public EventAction addRulesItem(String rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); + } + this.rules.add(rulesItem); + return this; + } + + /** + * list of event rules names associated with this action + * @return rules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRules() { + return rules; + } + + + @JsonProperty(JSON_PROPERTY_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRules(List rules) { + this.rules = rules; + } + + public EventAction order(Integer order) { + + this.order = order; + return this; + } + + /** + * execution order + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; + } + + public EventAction relationOptions(EventActionOptions relationOptions) { + + this.relationOptions = relationOptions; + return this; + } + + /** + * Get relationOptions + * @return relationOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATION_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionOptions getRelationOptions() { + return relationOptions; + } + + + @JsonProperty(JSON_PROPERTY_RELATION_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRelationOptions(EventActionOptions relationOptions) { + this.relationOptions = relationOptions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventAction eventAction = (EventAction) o; + return Objects.equals(this.id, eventAction.id) && + Objects.equals(this.name, eventAction.name) && + Objects.equals(this.description, eventAction.description) && + Objects.equals(this.type, eventAction.type) && + Objects.equals(this.options, eventAction.options) && + Objects.equals(this.rules, eventAction.rules) && + Objects.equals(this.order, eventAction.order) && + Objects.equals(this.relationOptions, eventAction.relationOptions); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, type, options, rules, order, relationOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventAction {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" relationOptions: ").append(toIndentedString(relationOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionCommandConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionCommandConfig.java new file mode 100644 index 00000000..fab350ea --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionCommandConfig.java @@ -0,0 +1,218 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.KeyValue; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionCommandConfig + */ +@JsonPropertyOrder({ + EventActionCommandConfig.JSON_PROPERTY_CMD, + EventActionCommandConfig.JSON_PROPERTY_ARGS, + EventActionCommandConfig.JSON_PROPERTY_TIMEOUT, + EventActionCommandConfig.JSON_PROPERTY_ENV_VARS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionCommandConfig { + public static final String JSON_PROPERTY_CMD = "cmd"; + private String cmd; + + public static final String JSON_PROPERTY_ARGS = "args"; + private List args = new ArrayList<>(); + + public static final String JSON_PROPERTY_TIMEOUT = "timeout"; + private Integer timeout; + + public static final String JSON_PROPERTY_ENV_VARS = "env_vars"; + private List envVars = new ArrayList<>(); + + public EventActionCommandConfig() { + } + + public EventActionCommandConfig cmd(String cmd) { + + this.cmd = cmd; + return this; + } + + /** + * absolute path to the command to execute + * @return cmd + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CMD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCmd() { + return cmd; + } + + + @JsonProperty(JSON_PROPERTY_CMD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCmd(String cmd) { + this.cmd = cmd; + } + + public EventActionCommandConfig args(List args) { + + this.args = args; + return this; + } + + public EventActionCommandConfig addArgsItem(String argsItem) { + if (this.args == null) { + this.args = new ArrayList<>(); + } + this.args.add(argsItem); + return this; + } + + /** + * command line arguments + * @return args + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArgs() { + return args; + } + + + @JsonProperty(JSON_PROPERTY_ARGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArgs(List args) { + this.args = args; + } + + public EventActionCommandConfig timeout(Integer timeout) { + + this.timeout = timeout; + return this; + } + + /** + * Get timeout + * minimum: 1 + * maximum: 120 + * @return timeout + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTimeout() { + return timeout; + } + + + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public EventActionCommandConfig envVars(List envVars) { + + this.envVars = envVars; + return this; + } + + public EventActionCommandConfig addEnvVarsItem(KeyValue envVarsItem) { + if (this.envVars == null) { + this.envVars = new ArrayList<>(); + } + this.envVars.add(envVarsItem); + return this; + } + + /** + * Get envVars + * @return envVars + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENV_VARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getEnvVars() { + return envVars; + } + + + @JsonProperty(JSON_PROPERTY_ENV_VARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnvVars(List envVars) { + this.envVars = envVars; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionCommandConfig eventActionCommandConfig = (EventActionCommandConfig) o; + return Objects.equals(this.cmd, eventActionCommandConfig.cmd) && + Objects.equals(this.args, eventActionCommandConfig.args) && + Objects.equals(this.timeout, eventActionCommandConfig.timeout) && + Objects.equals(this.envVars, eventActionCommandConfig.envVars); + } + + @Override + public int hashCode() { + return Objects.hash(cmd, args, timeout, envVars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionCommandConfig {\n"); + sb.append(" cmd: ").append(toIndentedString(cmd)).append("\n"); + sb.append(" args: ").append(toIndentedString(args)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" envVars: ").append(toIndentedString(envVars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionDataRetentionConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionDataRetentionConfig.java new file mode 100644 index 00000000..c51294b4 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionDataRetentionConfig.java @@ -0,0 +1,115 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FolderRetention; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionDataRetentionConfig + */ +@JsonPropertyOrder({ + EventActionDataRetentionConfig.JSON_PROPERTY_FOLDERS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionDataRetentionConfig { + public static final String JSON_PROPERTY_FOLDERS = "folders"; + private List folders = new ArrayList<>(); + + public EventActionDataRetentionConfig() { + } + + public EventActionDataRetentionConfig folders(List folders) { + + this.folders = folders; + return this; + } + + public EventActionDataRetentionConfig addFoldersItem(FolderRetention foldersItem) { + if (this.folders == null) { + this.folders = new ArrayList<>(); + } + this.folders.add(foldersItem); + return this; + } + + /** + * Get folders + * @return folders + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFolders() { + return folders; + } + + + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolders(List folders) { + this.folders = folders; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionDataRetentionConfig eventActionDataRetentionConfig = (EventActionDataRetentionConfig) o; + return Objects.equals(this.folders, eventActionDataRetentionConfig.folders); + } + + @Override + public int hashCode() { + return Objects.hash(folders); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionDataRetentionConfig {\n"); + sb.append(" folders: ").append(toIndentedString(folders)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionEmailConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionEmailConfig.java new file mode 100644 index 00000000..bd2310bf --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionEmailConfig.java @@ -0,0 +1,320 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionEmailConfig + */ +@JsonPropertyOrder({ + EventActionEmailConfig.JSON_PROPERTY_RECIPIENTS, + EventActionEmailConfig.JSON_PROPERTY_BCC, + EventActionEmailConfig.JSON_PROPERTY_SUBJECT, + EventActionEmailConfig.JSON_PROPERTY_BODY, + EventActionEmailConfig.JSON_PROPERTY_CONTENT_TYPE, + EventActionEmailConfig.JSON_PROPERTY_ATTACHMENTS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionEmailConfig { + public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; + private List recipients = new ArrayList<>(); + + public static final String JSON_PROPERTY_BCC = "bcc"; + private List bcc = new ArrayList<>(); + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + /** + * Content type: * `0` text/plain * `1` text/html + */ + public enum ContentTypeEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + ContentTypeEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ContentTypeEnum fromValue(Integer value) { + for (ContentTypeEnum b : ContentTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; + private ContentTypeEnum contentType; + + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; + private List attachments = new ArrayList<>(); + + public EventActionEmailConfig() { + } + + public EventActionEmailConfig recipients(List recipients) { + + this.recipients = recipients; + return this; + } + + public EventActionEmailConfig addRecipientsItem(String recipientsItem) { + if (this.recipients == null) { + this.recipients = new ArrayList<>(); + } + this.recipients.add(recipientsItem); + return this; + } + + /** + * Get recipients + * @return recipients + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRecipients() { + return recipients; + } + + + @JsonProperty(JSON_PROPERTY_RECIPIENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecipients(List recipients) { + this.recipients = recipients; + } + + public EventActionEmailConfig bcc(List bcc) { + + this.bcc = bcc; + return this; + } + + public EventActionEmailConfig addBccItem(String bccItem) { + if (this.bcc == null) { + this.bcc = new ArrayList<>(); + } + this.bcc.add(bccItem); + return this; + } + + /** + * Get bcc + * @return bcc + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBcc() { + return bcc; + } + + + @JsonProperty(JSON_PROPERTY_BCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBcc(List bcc) { + this.bcc = bcc; + } + + public EventActionEmailConfig subject(String subject) { + + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSubject() { + return subject; + } + + + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubject(String subject) { + this.subject = subject; + } + + public EventActionEmailConfig body(String body) { + + this.body = body; + return this; + } + + /** + * Get body + * @return body + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(String body) { + this.body = body; + } + + public EventActionEmailConfig contentType(ContentTypeEnum contentType) { + + this.contentType = contentType; + return this; + } + + /** + * Content type: * `0` text/plain * `1` text/html + * @return contentType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ContentTypeEnum getContentType() { + return contentType; + } + + + @JsonProperty(JSON_PROPERTY_CONTENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContentType(ContentTypeEnum contentType) { + this.contentType = contentType; + } + + public EventActionEmailConfig attachments(List attachments) { + + this.attachments = attachments; + return this; + } + + public EventActionEmailConfig addAttachmentsItem(String attachmentsItem) { + if (this.attachments == null) { + this.attachments = new ArrayList<>(); + } + this.attachments.add(attachmentsItem); + return this; + } + + /** + * list of file paths to attach. The total size is limited to 10 MB + * @return attachments + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAttachments() { + return attachments; + } + + + @JsonProperty(JSON_PROPERTY_ATTACHMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttachments(List attachments) { + this.attachments = attachments; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionEmailConfig eventActionEmailConfig = (EventActionEmailConfig) o; + return Objects.equals(this.recipients, eventActionEmailConfig.recipients) && + Objects.equals(this.bcc, eventActionEmailConfig.bcc) && + Objects.equals(this.subject, eventActionEmailConfig.subject) && + Objects.equals(this.body, eventActionEmailConfig.body) && + Objects.equals(this.contentType, eventActionEmailConfig.contentType) && + Objects.equals(this.attachments, eventActionEmailConfig.attachments); + } + + @Override + public int hashCode() { + return Objects.hash(recipients, bcc, subject, body, contentType, attachments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionEmailConfig {\n"); + sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" bcc: ").append(toIndentedString(bcc)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); + sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFilesystemConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFilesystemConfig.java new file mode 100644 index 00000000..18949bc3 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFilesystemConfig.java @@ -0,0 +1,335 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionFsCompress; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FilesystemActionTypes; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.KeyValue; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionFilesystemConfig + */ +@JsonPropertyOrder({ + EventActionFilesystemConfig.JSON_PROPERTY_TYPE, + EventActionFilesystemConfig.JSON_PROPERTY_RENAMES, + EventActionFilesystemConfig.JSON_PROPERTY_MKDIRS, + EventActionFilesystemConfig.JSON_PROPERTY_DELETES, + EventActionFilesystemConfig.JSON_PROPERTY_EXIST, + EventActionFilesystemConfig.JSON_PROPERTY_COPY, + EventActionFilesystemConfig.JSON_PROPERTY_COMPRESS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionFilesystemConfig { + public static final String JSON_PROPERTY_TYPE = "type"; + private FilesystemActionTypes type; + + public static final String JSON_PROPERTY_RENAMES = "renames"; + private List renames = new ArrayList<>(); + + public static final String JSON_PROPERTY_MKDIRS = "mkdirs"; + private List mkdirs = new ArrayList<>(); + + public static final String JSON_PROPERTY_DELETES = "deletes"; + private List deletes = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXIST = "exist"; + private List exist = new ArrayList<>(); + + public static final String JSON_PROPERTY_COPY = "copy"; + private List copy = new ArrayList<>(); + + public static final String JSON_PROPERTY_COMPRESS = "compress"; + private EventActionFsCompress compress; + + public EventActionFilesystemConfig() { + } + + public EventActionFilesystemConfig type(FilesystemActionTypes type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FilesystemActionTypes getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(FilesystemActionTypes type) { + this.type = type; + } + + public EventActionFilesystemConfig renames(List renames) { + + this.renames = renames; + return this; + } + + public EventActionFilesystemConfig addRenamesItem(KeyValue renamesItem) { + if (this.renames == null) { + this.renames = new ArrayList<>(); + } + this.renames.add(renamesItem); + return this; + } + + /** + * Get renames + * @return renames + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RENAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRenames() { + return renames; + } + + + @JsonProperty(JSON_PROPERTY_RENAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRenames(List renames) { + this.renames = renames; + } + + public EventActionFilesystemConfig mkdirs(List mkdirs) { + + this.mkdirs = mkdirs; + return this; + } + + public EventActionFilesystemConfig addMkdirsItem(String mkdirsItem) { + if (this.mkdirs == null) { + this.mkdirs = new ArrayList<>(); + } + this.mkdirs.add(mkdirsItem); + return this; + } + + /** + * Get mkdirs + * @return mkdirs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MKDIRS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMkdirs() { + return mkdirs; + } + + + @JsonProperty(JSON_PROPERTY_MKDIRS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMkdirs(List mkdirs) { + this.mkdirs = mkdirs; + } + + public EventActionFilesystemConfig deletes(List deletes) { + + this.deletes = deletes; + return this; + } + + public EventActionFilesystemConfig addDeletesItem(String deletesItem) { + if (this.deletes == null) { + this.deletes = new ArrayList<>(); + } + this.deletes.add(deletesItem); + return this; + } + + /** + * Get deletes + * @return deletes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeletes() { + return deletes; + } + + + @JsonProperty(JSON_PROPERTY_DELETES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeletes(List deletes) { + this.deletes = deletes; + } + + public EventActionFilesystemConfig exist(List exist) { + + this.exist = exist; + return this; + } + + public EventActionFilesystemConfig addExistItem(String existItem) { + if (this.exist == null) { + this.exist = new ArrayList<>(); + } + this.exist.add(existItem); + return this; + } + + /** + * Get exist + * @return exist + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getExist() { + return exist; + } + + + @JsonProperty(JSON_PROPERTY_EXIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExist(List exist) { + this.exist = exist; + } + + public EventActionFilesystemConfig copy(List copy) { + + this.copy = copy; + return this; + } + + public EventActionFilesystemConfig addCopyItem(KeyValue copyItem) { + if (this.copy == null) { + this.copy = new ArrayList<>(); + } + this.copy.add(copyItem); + return this; + } + + /** + * Get copy + * @return copy + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCopy() { + return copy; + } + + + @JsonProperty(JSON_PROPERTY_COPY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCopy(List copy) { + this.copy = copy; + } + + public EventActionFilesystemConfig compress(EventActionFsCompress compress) { + + this.compress = compress; + return this; + } + + /** + * Get compress + * @return compress + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionFsCompress getCompress() { + return compress; + } + + + @JsonProperty(JSON_PROPERTY_COMPRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCompress(EventActionFsCompress compress) { + this.compress = compress; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionFilesystemConfig eventActionFilesystemConfig = (EventActionFilesystemConfig) o; + return Objects.equals(this.type, eventActionFilesystemConfig.type) && + Objects.equals(this.renames, eventActionFilesystemConfig.renames) && + Objects.equals(this.mkdirs, eventActionFilesystemConfig.mkdirs) && + Objects.equals(this.deletes, eventActionFilesystemConfig.deletes) && + Objects.equals(this.exist, eventActionFilesystemConfig.exist) && + Objects.equals(this.copy, eventActionFilesystemConfig.copy) && + Objects.equals(this.compress, eventActionFilesystemConfig.compress); + } + + @Override + public int hashCode() { + return Objects.hash(type, renames, mkdirs, deletes, exist, copy, compress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionFilesystemConfig {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" renames: ").append(toIndentedString(renames)).append("\n"); + sb.append(" mkdirs: ").append(toIndentedString(mkdirs)).append("\n"); + sb.append(" deletes: ").append(toIndentedString(deletes)).append("\n"); + sb.append(" exist: ").append(toIndentedString(exist)).append("\n"); + sb.append(" copy: ").append(toIndentedString(copy)).append("\n"); + sb.append(" compress: ").append(toIndentedString(compress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFsCompress.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFsCompress.java new file mode 100644 index 00000000..4642414e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionFsCompress.java @@ -0,0 +1,145 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionFsCompress + */ +@JsonPropertyOrder({ + EventActionFsCompress.JSON_PROPERTY_NAME, + EventActionFsCompress.JSON_PROPERTY_PATHS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionFsCompress { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PATHS = "paths"; + private List paths = new ArrayList<>(); + + public EventActionFsCompress() { + } + + public EventActionFsCompress name(String name) { + + this.name = name; + return this; + } + + /** + * Full path to the (zip) archive to create. The parent dir must exist + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public EventActionFsCompress paths(List paths) { + + this.paths = paths; + return this; + } + + public EventActionFsCompress addPathsItem(String pathsItem) { + if (this.paths == null) { + this.paths = new ArrayList<>(); + } + this.paths.add(pathsItem); + return this; + } + + /** + * paths to add the archive + * @return paths + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPaths() { + return paths; + } + + + @JsonProperty(JSON_PROPERTY_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaths(List paths) { + this.paths = paths; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionFsCompress eventActionFsCompress = (EventActionFsCompress) o; + return Objects.equals(this.name, eventActionFsCompress.name) && + Objects.equals(this.paths, eventActionFsCompress.paths); + } + + @Override + public int hashCode() { + return Objects.hash(name, paths); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionFsCompress {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionHTTPConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionHTTPConfig.java new file mode 100644 index 00000000..2655dd0e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionHTTPConfig.java @@ -0,0 +1,453 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.HTTPPart; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.KeyValue; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionHTTPConfig + */ +@JsonPropertyOrder({ + EventActionHTTPConfig.JSON_PROPERTY_ENDPOINT, + EventActionHTTPConfig.JSON_PROPERTY_USERNAME, + EventActionHTTPConfig.JSON_PROPERTY_PASSWORD, + EventActionHTTPConfig.JSON_PROPERTY_HEADERS, + EventActionHTTPConfig.JSON_PROPERTY_TIMEOUT, + EventActionHTTPConfig.JSON_PROPERTY_SKIP_TLS_VERIFY, + EventActionHTTPConfig.JSON_PROPERTY_METHOD, + EventActionHTTPConfig.JSON_PROPERTY_QUERY_PARAMETERS, + EventActionHTTPConfig.JSON_PROPERTY_BODY, + EventActionHTTPConfig.JSON_PROPERTY_PARTS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionHTTPConfig { + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private Secret password; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers = new ArrayList<>(); + + public static final String JSON_PROPERTY_TIMEOUT = "timeout"; + private Integer timeout; + + public static final String JSON_PROPERTY_SKIP_TLS_VERIFY = "skip_tls_verify"; + private Boolean skipTlsVerify; + + /** + * Gets or Sets method + */ + public enum MethodEnum { + GET("GET"), + + POST("POST"), + + PUT("PUT"), + + DELETE("DELETE"); + + private String value; + + MethodEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MethodEnum fromValue(String value) { + for (MethodEnum b : MethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_METHOD = "method"; + private MethodEnum method; + + public static final String JSON_PROPERTY_QUERY_PARAMETERS = "query_parameters"; + private List queryParameters = new ArrayList<>(); + + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + public static final String JSON_PROPERTY_PARTS = "parts"; + private List parts = new ArrayList<>(); + + public EventActionHTTPConfig() { + } + + public EventActionHTTPConfig endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * HTTP endpoint + * @return endpoint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public EventActionHTTPConfig username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public EventActionHTTPConfig password(Secret password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(Secret password) { + this.password = password; + } + + public EventActionHTTPConfig headers(List headers) { + + this.headers = headers; + return this; + } + + public EventActionHTTPConfig addHeadersItem(KeyValue headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * headers to add + * @return headers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + public EventActionHTTPConfig timeout(Integer timeout) { + + this.timeout = timeout; + return this; + } + + /** + * Ignored for multipart requests with files as attachments + * minimum: 1 + * maximum: 180 + * @return timeout + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTimeout() { + return timeout; + } + + + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public EventActionHTTPConfig skipTlsVerify(Boolean skipTlsVerify) { + + this.skipTlsVerify = skipTlsVerify; + return this; + } + + /** + * if enabled the HTTP client accepts any TLS certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. This should be used only for testing. + * @return skipTlsVerify + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKIP_TLS_VERIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSkipTlsVerify() { + return skipTlsVerify; + } + + + @JsonProperty(JSON_PROPERTY_SKIP_TLS_VERIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipTlsVerify(Boolean skipTlsVerify) { + this.skipTlsVerify = skipTlsVerify; + } + + public EventActionHTTPConfig method(MethodEnum method) { + + this.method = method; + return this; + } + + /** + * Get method + * @return method + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MethodEnum getMethod() { + return method; + } + + + @JsonProperty(JSON_PROPERTY_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMethod(MethodEnum method) { + this.method = method; + } + + public EventActionHTTPConfig queryParameters(List queryParameters) { + + this.queryParameters = queryParameters; + return this; + } + + public EventActionHTTPConfig addQueryParametersItem(KeyValue queryParametersItem) { + if (this.queryParameters == null) { + this.queryParameters = new ArrayList<>(); + } + this.queryParameters.add(queryParametersItem); + return this; + } + + /** + * Get queryParameters + * @return queryParameters + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getQueryParameters() { + return queryParameters; + } + + + @JsonProperty(JSON_PROPERTY_QUERY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQueryParameters(List queryParameters) { + this.queryParameters = queryParameters; + } + + public EventActionHTTPConfig body(String body) { + + this.body = body; + return this; + } + + /** + * HTTP POST/PUT body + * @return body + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(String body) { + this.body = body; + } + + public EventActionHTTPConfig parts(List parts) { + + this.parts = parts; + return this; + } + + public EventActionHTTPConfig addPartsItem(HTTPPart partsItem) { + if (this.parts == null) { + this.parts = new ArrayList<>(); + } + this.parts.add(partsItem); + return this; + } + + /** + * Multipart requests allow to combine one or more sets of data into a single body. For each part, you can set a file path or a body as text. Placeholders are supported in file path, body, header values. + * @return parts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getParts() { + return parts; + } + + + @JsonProperty(JSON_PROPERTY_PARTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setParts(List parts) { + this.parts = parts; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionHTTPConfig eventActionHTTPConfig = (EventActionHTTPConfig) o; + return Objects.equals(this.endpoint, eventActionHTTPConfig.endpoint) && + Objects.equals(this.username, eventActionHTTPConfig.username) && + Objects.equals(this.password, eventActionHTTPConfig.password) && + Objects.equals(this.headers, eventActionHTTPConfig.headers) && + Objects.equals(this.timeout, eventActionHTTPConfig.timeout) && + Objects.equals(this.skipTlsVerify, eventActionHTTPConfig.skipTlsVerify) && + Objects.equals(this.method, eventActionHTTPConfig.method) && + Objects.equals(this.queryParameters, eventActionHTTPConfig.queryParameters) && + Objects.equals(this.body, eventActionHTTPConfig.body) && + Objects.equals(this.parts, eventActionHTTPConfig.parts); + } + + @Override + public int hashCode() { + return Objects.hash(endpoint, username, password, headers, timeout, skipTlsVerify, method, queryParameters, body, parts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionHTTPConfig {\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" skipTlsVerify: ").append(toIndentedString(skipTlsVerify)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" queryParameters: ").append(toIndentedString(queryParameters)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" parts: ").append(toIndentedString(parts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionIDPAccountCheck.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionIDPAccountCheck.java new file mode 100644 index 00000000..662ab2e1 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionIDPAccountCheck.java @@ -0,0 +1,200 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionIDPAccountCheck + */ +@JsonPropertyOrder({ + EventActionIDPAccountCheck.JSON_PROPERTY_MODE, + EventActionIDPAccountCheck.JSON_PROPERTY_TEMPLATE_USER, + EventActionIDPAccountCheck.JSON_PROPERTY_TEMPLATE_ADMIN +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionIDPAccountCheck { + /** + * Account check mode: * `0` Create or update the account * `1` Create the account if it doesn't exist + */ + public enum ModeEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + ModeEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModeEnum fromValue(Integer value) { + for (ModeEnum b : ModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MODE = "mode"; + private ModeEnum mode; + + public static final String JSON_PROPERTY_TEMPLATE_USER = "template_user"; + private String templateUser; + + public static final String JSON_PROPERTY_TEMPLATE_ADMIN = "template_admin"; + private String templateAdmin; + + public EventActionIDPAccountCheck() { + } + + public EventActionIDPAccountCheck mode(ModeEnum mode) { + + this.mode = mode; + return this; + } + + /** + * Account check mode: * `0` Create or update the account * `1` Create the account if it doesn't exist + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ModeEnum getMode() { + return mode; + } + + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(ModeEnum mode) { + this.mode = mode; + } + + public EventActionIDPAccountCheck templateUser(String templateUser) { + + this.templateUser = templateUser; + return this; + } + + /** + * SFTPGo user template in JSON format + * @return templateUser + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateUser() { + return templateUser; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateUser(String templateUser) { + this.templateUser = templateUser; + } + + public EventActionIDPAccountCheck templateAdmin(String templateAdmin) { + + this.templateAdmin = templateAdmin; + return this; + } + + /** + * SFTPGo admin template in JSON format + * @return templateAdmin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ADMIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTemplateAdmin() { + return templateAdmin; + } + + + @JsonProperty(JSON_PROPERTY_TEMPLATE_ADMIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemplateAdmin(String templateAdmin) { + this.templateAdmin = templateAdmin; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionIDPAccountCheck eventActionIDPAccountCheck = (EventActionIDPAccountCheck) o; + return Objects.equals(this.mode, eventActionIDPAccountCheck.mode) && + Objects.equals(this.templateUser, eventActionIDPAccountCheck.templateUser) && + Objects.equals(this.templateAdmin, eventActionIDPAccountCheck.templateAdmin); + } + + @Override + public int hashCode() { + return Objects.hash(mode, templateUser, templateAdmin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionIDPAccountCheck {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" templateUser: ").append(toIndentedString(templateUser)).append("\n"); + sb.append(" templateAdmin: ").append(toIndentedString(templateAdmin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionMinimal.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionMinimal.java new file mode 100644 index 00000000..a8fff658 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionMinimal.java @@ -0,0 +1,166 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionMinimal + */ +@JsonPropertyOrder({ + EventActionMinimal.JSON_PROPERTY_NAME, + EventActionMinimal.JSON_PROPERTY_ORDER, + EventActionMinimal.JSON_PROPERTY_RELATION_OPTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionMinimal { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORDER = "order"; + private Integer order; + + public static final String JSON_PROPERTY_RELATION_OPTIONS = "relation_options"; + private EventActionOptions relationOptions; + + public EventActionMinimal() { + } + + public EventActionMinimal name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public EventActionMinimal order(Integer order) { + + this.order = order; + return this; + } + + /** + * execution order + * @return order + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOrder() { + return order; + } + + + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrder(Integer order) { + this.order = order; + } + + public EventActionMinimal relationOptions(EventActionOptions relationOptions) { + + this.relationOptions = relationOptions; + return this; + } + + /** + * Get relationOptions + * @return relationOptions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATION_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventActionOptions getRelationOptions() { + return relationOptions; + } + + + @JsonProperty(JSON_PROPERTY_RELATION_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRelationOptions(EventActionOptions relationOptions) { + this.relationOptions = relationOptions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionMinimal eventActionMinimal = (EventActionMinimal) o; + return Objects.equals(this.name, eventActionMinimal.name) && + Objects.equals(this.order, eventActionMinimal.order) && + Objects.equals(this.relationOptions, eventActionMinimal.relationOptions); + } + + @Override + public int hashCode() { + return Objects.hash(name, order, relationOptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionMinimal {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" relationOptions: ").append(toIndentedString(relationOptions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionOptions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionOptions.java new file mode 100644 index 00000000..f5eada91 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionOptions.java @@ -0,0 +1,165 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionOptions + */ +@JsonPropertyOrder({ + EventActionOptions.JSON_PROPERTY_IS_FAILURE_ACTION, + EventActionOptions.JSON_PROPERTY_STOP_ON_FAILURE, + EventActionOptions.JSON_PROPERTY_EXECUTE_SYNC +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionOptions { + public static final String JSON_PROPERTY_IS_FAILURE_ACTION = "is_failure_action"; + private Boolean isFailureAction; + + public static final String JSON_PROPERTY_STOP_ON_FAILURE = "stop_on_failure"; + private Boolean stopOnFailure; + + public static final String JSON_PROPERTY_EXECUTE_SYNC = "execute_sync"; + private Boolean executeSync; + + public EventActionOptions() { + } + + public EventActionOptions isFailureAction(Boolean isFailureAction) { + + this.isFailureAction = isFailureAction; + return this; + } + + /** + * Get isFailureAction + * @return isFailureAction + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_FAILURE_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsFailureAction() { + return isFailureAction; + } + + + @JsonProperty(JSON_PROPERTY_IS_FAILURE_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFailureAction(Boolean isFailureAction) { + this.isFailureAction = isFailureAction; + } + + public EventActionOptions stopOnFailure(Boolean stopOnFailure) { + + this.stopOnFailure = stopOnFailure; + return this; + } + + /** + * Get stopOnFailure + * @return stopOnFailure + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STOP_ON_FAILURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getStopOnFailure() { + return stopOnFailure; + } + + + @JsonProperty(JSON_PROPERTY_STOP_ON_FAILURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStopOnFailure(Boolean stopOnFailure) { + this.stopOnFailure = stopOnFailure; + } + + public EventActionOptions executeSync(Boolean executeSync) { + + this.executeSync = executeSync; + return this; + } + + /** + * Get executeSync + * @return executeSync + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXECUTE_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getExecuteSync() { + return executeSync; + } + + + @JsonProperty(JSON_PROPERTY_EXECUTE_SYNC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExecuteSync(Boolean executeSync) { + this.executeSync = executeSync; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionOptions eventActionOptions = (EventActionOptions) o; + return Objects.equals(this.isFailureAction, eventActionOptions.isFailureAction) && + Objects.equals(this.stopOnFailure, eventActionOptions.stopOnFailure) && + Objects.equals(this.executeSync, eventActionOptions.executeSync); + } + + @Override + public int hashCode() { + return Objects.hash(isFailureAction, stopOnFailure, executeSync); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionOptions {\n"); + sb.append(" isFailureAction: ").append(toIndentedString(isFailureAction)).append("\n"); + sb.append(" stopOnFailure: ").append(toIndentedString(stopOnFailure)).append("\n"); + sb.append(" executeSync: ").append(toIndentedString(executeSync)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionPasswordExpiration.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionPasswordExpiration.java new file mode 100644 index 00000000..f6e044ea --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionPasswordExpiration.java @@ -0,0 +1,103 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionPasswordExpiration + */ +@JsonPropertyOrder({ + EventActionPasswordExpiration.JSON_PROPERTY_THRESHOLD +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionPasswordExpiration { + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; + private Integer threshold; + + public EventActionPasswordExpiration() { + } + + public EventActionPasswordExpiration threshold(Integer threshold) { + + this.threshold = threshold; + return this; + } + + /** + * An email notification will be generated for users whose password expires in a number of days less than or equal to this threshold + * @return threshold + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getThreshold() { + return threshold; + } + + + @JsonProperty(JSON_PROPERTY_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThreshold(Integer threshold) { + this.threshold = threshold; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionPasswordExpiration eventActionPasswordExpiration = (EventActionPasswordExpiration) o; + return Objects.equals(this.threshold, eventActionPasswordExpiration.threshold); + } + + @Override + public int hashCode() { + return Objects.hash(threshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionPasswordExpiration {\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionTypes.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionTypes.java new file mode 100644 index 00000000..004e71ae --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionTypes.java @@ -0,0 +1,83 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Supported event action types: * `1` - HTTP * `2` - Command * `3` - Email * `4` - Backup * `5` - User quota reset * `6` - Folder quota reset * `7` - Transfer quota reset * `8` - Data retention check * `9` - Filesystem * `11` - Password expiration check * `12` - User expiration check * `13` - Identity Provider account check * `14` - User inactivity check * `15` - Rotate log file + */ +public enum EventActionTypes { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7), + + NUMBER_8(8), + + NUMBER_9(9), + + NUMBER_11(11), + + NUMBER_12(12), + + NUMBER_13(13), + + NUMBER_14(14), + + NUMBER_15(15); + + private Integer value; + + EventActionTypes(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventActionTypes fromValue(Integer value) { + for (EventActionTypes b : EventActionTypes.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionUserInactivity.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionUserInactivity.java new file mode 100644 index 00000000..82c37672 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventActionUserInactivity.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventActionUserInactivity + */ +@JsonPropertyOrder({ + EventActionUserInactivity.JSON_PROPERTY_DISABLE_THRESHOLD, + EventActionUserInactivity.JSON_PROPERTY_DELETE_THRESHOLD +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventActionUserInactivity { + public static final String JSON_PROPERTY_DISABLE_THRESHOLD = "disable_threshold"; + private Integer disableThreshold; + + public static final String JSON_PROPERTY_DELETE_THRESHOLD = "delete_threshold"; + private Integer deleteThreshold; + + public EventActionUserInactivity() { + } + + public EventActionUserInactivity disableThreshold(Integer disableThreshold) { + + this.disableThreshold = disableThreshold; + return this; + } + + /** + * Inactivity threshold, in days, before disabling the account + * @return disableThreshold + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLE_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDisableThreshold() { + return disableThreshold; + } + + + @JsonProperty(JSON_PROPERTY_DISABLE_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableThreshold(Integer disableThreshold) { + this.disableThreshold = disableThreshold; + } + + public EventActionUserInactivity deleteThreshold(Integer deleteThreshold) { + + this.deleteThreshold = deleteThreshold; + return this; + } + + /** + * Inactivity threshold, in days, before deleting the account + * @return deleteThreshold + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETE_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDeleteThreshold() { + return deleteThreshold; + } + + + @JsonProperty(JSON_PROPERTY_DELETE_THRESHOLD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeleteThreshold(Integer deleteThreshold) { + this.deleteThreshold = deleteThreshold; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventActionUserInactivity eventActionUserInactivity = (EventActionUserInactivity) o; + return Objects.equals(this.disableThreshold, eventActionUserInactivity.disableThreshold) && + Objects.equals(this.deleteThreshold, eventActionUserInactivity.deleteThreshold); + } + + @Override + public int hashCode() { + return Objects.hash(disableThreshold, deleteThreshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventActionUserInactivity {\n"); + sb.append(" disableThreshold: ").append(toIndentedString(disableThreshold)).append("\n"); + sb.append(" deleteThreshold: ").append(toIndentedString(deleteThreshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventConditions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventConditions.java new file mode 100644 index 00000000..aa54685f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventConditions.java @@ -0,0 +1,387 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ConditionOptions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Schedule; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventConditions + */ +@JsonPropertyOrder({ + EventConditions.JSON_PROPERTY_FS_EVENTS, + EventConditions.JSON_PROPERTY_PROVIDER_EVENTS, + EventConditions.JSON_PROPERTY_SCHEDULES, + EventConditions.JSON_PROPERTY_IDP_LOGIN_EVENT, + EventConditions.JSON_PROPERTY_OPTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventConditions { + /** + * Gets or Sets fsEvents + */ + public enum FsEventsEnum { + UPLOAD("upload"), + + DOWNLOAD("download"), + + DELETE("delete"), + + RENAME("rename"), + + MKDIR("mkdir"), + + RMDIR("rmdir"), + + COPY("copy"), + + SSH_CMD("ssh_cmd"), + + PRE_UPLOAD("pre-upload"), + + PRE_DOWNLOAD("pre-download"), + + PRE_DELETE("pre-delete"), + + FIRST_UPLOAD("first-upload"), + + FIRST_DOWNLOAD("first-download"); + + private String value; + + FsEventsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FsEventsEnum fromValue(String value) { + for (FsEventsEnum b : FsEventsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FS_EVENTS = "fs_events"; + private List fsEvents = new ArrayList<>(); + + /** + * Gets or Sets providerEvents + */ + public enum ProviderEventsEnum { + ADD("add"), + + UPDATE("update"), + + DELETE("delete"); + + private String value; + + ProviderEventsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProviderEventsEnum fromValue(String value) { + for (ProviderEventsEnum b : ProviderEventsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PROVIDER_EVENTS = "provider_events"; + private List providerEvents = new ArrayList<>(); + + public static final String JSON_PROPERTY_SCHEDULES = "schedules"; + private List schedules = new ArrayList<>(); + + /** + * IDP login events: - `0` any login event - `1` user login event - `2` admin login event + */ + public enum IdpLoginEventEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + IdpLoginEventEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IdpLoginEventEnum fromValue(Integer value) { + for (IdpLoginEventEnum b : IdpLoginEventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_IDP_LOGIN_EVENT = "idp_login_event"; + private IdpLoginEventEnum idpLoginEvent; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private ConditionOptions options; + + public EventConditions() { + } + + public EventConditions fsEvents(List fsEvents) { + + this.fsEvents = fsEvents; + return this; + } + + public EventConditions addFsEventsItem(FsEventsEnum fsEventsItem) { + if (this.fsEvents == null) { + this.fsEvents = new ArrayList<>(); + } + this.fsEvents.add(fsEventsItem); + return this; + } + + /** + * Get fsEvents + * @return fsEvents + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFsEvents() { + return fsEvents; + } + + + @JsonProperty(JSON_PROPERTY_FS_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsEvents(List fsEvents) { + this.fsEvents = fsEvents; + } + + public EventConditions providerEvents(List providerEvents) { + + this.providerEvents = providerEvents; + return this; + } + + public EventConditions addProviderEventsItem(ProviderEventsEnum providerEventsItem) { + if (this.providerEvents == null) { + this.providerEvents = new ArrayList<>(); + } + this.providerEvents.add(providerEventsItem); + return this; + } + + /** + * Get providerEvents + * @return providerEvents + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProviderEvents() { + return providerEvents; + } + + + @JsonProperty(JSON_PROPERTY_PROVIDER_EVENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProviderEvents(List providerEvents) { + this.providerEvents = providerEvents; + } + + public EventConditions schedules(List schedules) { + + this.schedules = schedules; + return this; + } + + public EventConditions addSchedulesItem(Schedule schedulesItem) { + if (this.schedules == null) { + this.schedules = new ArrayList<>(); + } + this.schedules.add(schedulesItem); + return this; + } + + /** + * Get schedules + * @return schedules + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSchedules() { + return schedules; + } + + + @JsonProperty(JSON_PROPERTY_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSchedules(List schedules) { + this.schedules = schedules; + } + + public EventConditions idpLoginEvent(IdpLoginEventEnum idpLoginEvent) { + + this.idpLoginEvent = idpLoginEvent; + return this; + } + + /** + * IDP login events: - `0` any login event - `1` user login event - `2` admin login event + * @return idpLoginEvent + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IDP_LOGIN_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public IdpLoginEventEnum getIdpLoginEvent() { + return idpLoginEvent; + } + + + @JsonProperty(JSON_PROPERTY_IDP_LOGIN_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIdpLoginEvent(IdpLoginEventEnum idpLoginEvent) { + this.idpLoginEvent = idpLoginEvent; + } + + public EventConditions options(ConditionOptions options) { + + this.options = options; + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ConditionOptions getOptions() { + return options; + } + + + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(ConditionOptions options) { + this.options = options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventConditions eventConditions = (EventConditions) o; + return Objects.equals(this.fsEvents, eventConditions.fsEvents) && + Objects.equals(this.providerEvents, eventConditions.providerEvents) && + Objects.equals(this.schedules, eventConditions.schedules) && + Objects.equals(this.idpLoginEvent, eventConditions.idpLoginEvent) && + Objects.equals(this.options, eventConditions.options); + } + + @Override + public int hashCode() { + return Objects.hash(fsEvents, providerEvents, schedules, idpLoginEvent, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventConditions {\n"); + sb.append(" fsEvents: ").append(toIndentedString(fsEvents)).append("\n"); + sb.append(" providerEvents: ").append(toIndentedString(providerEvents)).append("\n"); + sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); + sb.append(" idpLoginEvent: ").append(toIndentedString(idpLoginEvent)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventProtocols.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventProtocols.java new file mode 100644 index 00000000..df6f7c2d --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventProtocols.java @@ -0,0 +1,75 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Protocols: * `SSH` - SSH commands * `SFTP` - SFTP protocol * `SCP` - SCP protocol * `FTP` - plain FTP and FTPES/FTPS * `DAV` - WebDAV * `HTTP` - WebClient/REST API * `HTTPShare` - the event is generated in a public share * `DataRetention` - the event is generated by a data retention check * `EventAction` - the event is generated by an EventManager action * `OIDC` - OpenID Connect + */ +public enum EventProtocols { + + SSH("SSH"), + + SFTP("SFTP"), + + SCP("SCP"), + + FTP("FTP"), + + DAV("DAV"), + + HTTP("HTTP"), + + HTTP_SHARE("HTTPShare"), + + DATA_RETENTION("DataRetention"), + + EVENT_ACTION("EventAction"), + + OIDC("OIDC"); + + private String value; + + EventProtocols(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventProtocols fromValue(String value) { + for (EventProtocols b : EventProtocols.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRule.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRule.java new file mode 100644 index 00000000..98a042ff --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRule.java @@ -0,0 +1,401 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventConditions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventTriggerTypes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventRule + */ +@JsonPropertyOrder({ + EventRule.JSON_PROPERTY_ID, + EventRule.JSON_PROPERTY_NAME, + EventRule.JSON_PROPERTY_STATUS, + EventRule.JSON_PROPERTY_DESCRIPTION, + EventRule.JSON_PROPERTY_CREATED_AT, + EventRule.JSON_PROPERTY_UPDATED_AT, + EventRule.JSON_PROPERTY_TRIGGER, + EventRule.JSON_PROPERTY_CONDITIONS, + EventRule.JSON_PROPERTY_ACTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventRule { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * status: * `0` disabled * `1` enabled + */ + public enum StatusEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + StatusEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(Integer value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private EventTriggerTypes trigger; + + public static final String JSON_PROPERTY_CONDITIONS = "conditions"; + private EventConditions conditions; + + public static final String JSON_PROPERTY_ACTIONS = "actions"; + private List actions = new ArrayList<>(); + + public EventRule() { + } + + public EventRule id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public EventRule name(String name) { + + this.name = name; + return this; + } + + /** + * unique name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public EventRule status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * status: * `0` disabled * `1` enabled + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public EventRule description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public EventRule createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public EventRule updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in millisecond + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public EventRule trigger(EventTriggerTypes trigger) { + + this.trigger = trigger; + return this; + } + + /** + * Get trigger + * @return trigger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventTriggerTypes getTrigger() { + return trigger; + } + + + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(EventTriggerTypes trigger) { + this.trigger = trigger; + } + + public EventRule conditions(EventConditions conditions) { + + this.conditions = conditions; + return this; + } + + /** + * Get conditions + * @return conditions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventConditions getConditions() { + return conditions; + } + + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(EventConditions conditions) { + this.conditions = conditions; + } + + public EventRule actions(List actions) { + + this.actions = actions; + return this; + } + + public EventRule addActionsItem(EventAction actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + + /** + * Get actions + * @return actions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getActions() { + return actions; + } + + + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActions(List actions) { + this.actions = actions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventRule eventRule = (EventRule) o; + return Objects.equals(this.id, eventRule.id) && + Objects.equals(this.name, eventRule.name) && + Objects.equals(this.status, eventRule.status) && + Objects.equals(this.description, eventRule.description) && + Objects.equals(this.createdAt, eventRule.createdAt) && + Objects.equals(this.updatedAt, eventRule.updatedAt) && + Objects.equals(this.trigger, eventRule.trigger) && + Objects.equals(this.conditions, eventRule.conditions) && + Objects.equals(this.actions, eventRule.actions); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, description, createdAt, updatedAt, trigger, conditions, actions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventRule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRuleMinimal.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRuleMinimal.java new file mode 100644 index 00000000..2e24e966 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventRuleMinimal.java @@ -0,0 +1,401 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventActionMinimal; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventConditions; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventTriggerTypes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EventRuleMinimal + */ +@JsonPropertyOrder({ + EventRuleMinimal.JSON_PROPERTY_ID, + EventRuleMinimal.JSON_PROPERTY_NAME, + EventRuleMinimal.JSON_PROPERTY_STATUS, + EventRuleMinimal.JSON_PROPERTY_DESCRIPTION, + EventRuleMinimal.JSON_PROPERTY_CREATED_AT, + EventRuleMinimal.JSON_PROPERTY_UPDATED_AT, + EventRuleMinimal.JSON_PROPERTY_TRIGGER, + EventRuleMinimal.JSON_PROPERTY_CONDITIONS, + EventRuleMinimal.JSON_PROPERTY_ACTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class EventRuleMinimal { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * status: * `0` disabled * `1` enabled + */ + public enum StatusEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + StatusEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(Integer value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private EventTriggerTypes trigger; + + public static final String JSON_PROPERTY_CONDITIONS = "conditions"; + private EventConditions conditions; + + public static final String JSON_PROPERTY_ACTIONS = "actions"; + private List actions = new ArrayList<>(); + + public EventRuleMinimal() { + } + + public EventRuleMinimal id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public EventRuleMinimal name(String name) { + + this.name = name; + return this; + } + + /** + * unique name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public EventRuleMinimal status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * status: * `0` disabled * `1` enabled + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public EventRuleMinimal description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public EventRuleMinimal createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public EventRuleMinimal updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in millisecond + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public EventRuleMinimal trigger(EventTriggerTypes trigger) { + + this.trigger = trigger; + return this; + } + + /** + * Get trigger + * @return trigger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventTriggerTypes getTrigger() { + return trigger; + } + + + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(EventTriggerTypes trigger) { + this.trigger = trigger; + } + + public EventRuleMinimal conditions(EventConditions conditions) { + + this.conditions = conditions; + return this; + } + + /** + * Get conditions + * @return conditions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventConditions getConditions() { + return conditions; + } + + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConditions(EventConditions conditions) { + this.conditions = conditions; + } + + public EventRuleMinimal actions(List actions) { + + this.actions = actions; + return this; + } + + public EventRuleMinimal addActionsItem(EventActionMinimal actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + + /** + * Get actions + * @return actions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getActions() { + return actions; + } + + + @JsonProperty(JSON_PROPERTY_ACTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActions(List actions) { + this.actions = actions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventRuleMinimal eventRuleMinimal = (EventRuleMinimal) o; + return Objects.equals(this.id, eventRuleMinimal.id) && + Objects.equals(this.name, eventRuleMinimal.name) && + Objects.equals(this.status, eventRuleMinimal.status) && + Objects.equals(this.description, eventRuleMinimal.description) && + Objects.equals(this.createdAt, eventRuleMinimal.createdAt) && + Objects.equals(this.updatedAt, eventRuleMinimal.updatedAt) && + Objects.equals(this.trigger, eventRuleMinimal.trigger) && + Objects.equals(this.conditions, eventRuleMinimal.conditions) && + Objects.equals(this.actions, eventRuleMinimal.actions); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, status, description, createdAt, updatedAt, trigger, conditions, actions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventRuleMinimal {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventTriggerTypes.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventTriggerTypes.java new file mode 100644 index 00000000..4824a015 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/EventTriggerTypes.java @@ -0,0 +1,69 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Supported event trigger types: * `1` - Filesystem event * `2` - Provider event * `3` - Schedule * `4` - IP blocked * `5` - Certificate renewal * `6` - On demand, like schedule but executed on demand * `7` - Identity provider login + */ +public enum EventTriggerTypes { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7); + + private Integer value; + + EventTriggerTypes(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EventTriggerTypes fromValue(Integer value) { + for (EventTriggerTypes b : EventTriggerTypes.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPDBinding.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPDBinding.java new file mode 100644 index 00000000..6d265714 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPDBinding.java @@ -0,0 +1,638 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.PassiveIPOverride; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TLSVersions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FTPDBinding + */ +@JsonPropertyOrder({ + FTPDBinding.JSON_PROPERTY_ADDRESS, + FTPDBinding.JSON_PROPERTY_PORT, + FTPDBinding.JSON_PROPERTY_APPLY_PROXY_CONFIG, + FTPDBinding.JSON_PROPERTY_TLS_MODE, + FTPDBinding.JSON_PROPERTY_MIN_TLS_VERSION, + FTPDBinding.JSON_PROPERTY_FORCE_PASSIVE_IP, + FTPDBinding.JSON_PROPERTY_PASSIVE_IP_OVERRIDES, + FTPDBinding.JSON_PROPERTY_CLIENT_AUTH_TYPE, + FTPDBinding.JSON_PROPERTY_TLS_CIPHER_SUITES, + FTPDBinding.JSON_PROPERTY_PASSIVE_CONNECTIONS_SECURITY, + FTPDBinding.JSON_PROPERTY_ACTIVE_CONNECTIONS_SECURITY, + FTPDBinding.JSON_PROPERTY_IGNORE_ASCII_TRANSFER_TYPE, + FTPDBinding.JSON_PROPERTY_DEBUG +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FTPDBinding { + public static final String JSON_PROPERTY_ADDRESS = "address"; + private String address; + + public static final String JSON_PROPERTY_PORT = "port"; + private Integer port; + + public static final String JSON_PROPERTY_APPLY_PROXY_CONFIG = "apply_proxy_config"; + private Boolean applyProxyConfig; + + /** + * TLS mode: * `0` - clear or explicit TLS * `1` - explicit TLS required * `2` - implicit TLS + */ + public enum TlsModeEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + TlsModeEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TlsModeEnum fromValue(Integer value) { + for (TlsModeEnum b : TlsModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TLS_MODE = "tls_mode"; + private TlsModeEnum tlsMode; + + public static final String JSON_PROPERTY_MIN_TLS_VERSION = "min_tls_version"; + private TLSVersions minTlsVersion; + + public static final String JSON_PROPERTY_FORCE_PASSIVE_IP = "force_passive_ip"; + private String forcePassiveIp; + + public static final String JSON_PROPERTY_PASSIVE_IP_OVERRIDES = "passive_ip_overrides"; + private List passiveIpOverrides = new ArrayList<>(); + + public static final String JSON_PROPERTY_CLIENT_AUTH_TYPE = "client_auth_type"; + private Integer clientAuthType; + + public static final String JSON_PROPERTY_TLS_CIPHER_SUITES = "tls_cipher_suites"; + private List tlsCipherSuites = new ArrayList<>(); + + /** + * Active connections security: * `0` - require matching peer IP addresses of control and data connection * `1` - disable any checks + */ + public enum PassiveConnectionsSecurityEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + PassiveConnectionsSecurityEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PassiveConnectionsSecurityEnum fromValue(Integer value) { + for (PassiveConnectionsSecurityEnum b : PassiveConnectionsSecurityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_PASSIVE_CONNECTIONS_SECURITY = "passive_connections_security"; + private PassiveConnectionsSecurityEnum passiveConnectionsSecurity; + + /** + * Active connections security: * `0` - require matching peer IP addresses of control and data connection * `1` - disable any checks + */ + public enum ActiveConnectionsSecurityEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + ActiveConnectionsSecurityEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ActiveConnectionsSecurityEnum fromValue(Integer value) { + for (ActiveConnectionsSecurityEnum b : ActiveConnectionsSecurityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ACTIVE_CONNECTIONS_SECURITY = "active_connections_security"; + private ActiveConnectionsSecurityEnum activeConnectionsSecurity; + + /** + * Ignore client requests to perform ASCII translations: * `0` - ASCII translations are enabled * `1` - ASCII translations are silently ignored + */ + public enum IgnoreAsciiTransferTypeEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + IgnoreAsciiTransferTypeEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IgnoreAsciiTransferTypeEnum fromValue(Integer value) { + for (IgnoreAsciiTransferTypeEnum b : IgnoreAsciiTransferTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_IGNORE_ASCII_TRANSFER_TYPE = "ignore_ascii_transfer_type"; + private IgnoreAsciiTransferTypeEnum ignoreAsciiTransferType; + + public static final String JSON_PROPERTY_DEBUG = "debug"; + private Boolean debug; + + public FTPDBinding() { + } + + public FTPDBinding address(String address) { + + this.address = address; + return this; + } + + /** + * TCP address the server listen on + * @return address + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(String address) { + this.address = address; + } + + public FTPDBinding port(Integer port) { + + this.port = port; + return this; + } + + /** + * the port used for serving requests + * @return port + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPort() { + return port; + } + + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(Integer port) { + this.port = port; + } + + public FTPDBinding applyProxyConfig(Boolean applyProxyConfig) { + + this.applyProxyConfig = applyProxyConfig; + return this; + } + + /** + * apply the proxy configuration, if any + * @return applyProxyConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPLY_PROXY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getApplyProxyConfig() { + return applyProxyConfig; + } + + + @JsonProperty(JSON_PROPERTY_APPLY_PROXY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplyProxyConfig(Boolean applyProxyConfig) { + this.applyProxyConfig = applyProxyConfig; + } + + public FTPDBinding tlsMode(TlsModeEnum tlsMode) { + + this.tlsMode = tlsMode; + return this; + } + + /** + * TLS mode: * `0` - clear or explicit TLS * `1` - explicit TLS required * `2` - implicit TLS + * @return tlsMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TlsModeEnum getTlsMode() { + return tlsMode; + } + + + @JsonProperty(JSON_PROPERTY_TLS_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsMode(TlsModeEnum tlsMode) { + this.tlsMode = tlsMode; + } + + public FTPDBinding minTlsVersion(TLSVersions minTlsVersion) { + + this.minTlsVersion = minTlsVersion; + return this; + } + + /** + * Get minTlsVersion + * @return minTlsVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_TLS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TLSVersions getMinTlsVersion() { + return minTlsVersion; + } + + + @JsonProperty(JSON_PROPERTY_MIN_TLS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinTlsVersion(TLSVersions minTlsVersion) { + this.minTlsVersion = minTlsVersion; + } + + public FTPDBinding forcePassiveIp(String forcePassiveIp) { + + this.forcePassiveIp = forcePassiveIp; + return this; + } + + /** + * External IP address for passive connections + * @return forcePassiveIp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_PASSIVE_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getForcePassiveIp() { + return forcePassiveIp; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_PASSIVE_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForcePassiveIp(String forcePassiveIp) { + this.forcePassiveIp = forcePassiveIp; + } + + public FTPDBinding passiveIpOverrides(List passiveIpOverrides) { + + this.passiveIpOverrides = passiveIpOverrides; + return this; + } + + public FTPDBinding addPassiveIpOverridesItem(PassiveIPOverride passiveIpOverridesItem) { + if (this.passiveIpOverrides == null) { + this.passiveIpOverrides = new ArrayList<>(); + } + this.passiveIpOverrides.add(passiveIpOverridesItem); + return this; + } + + /** + * Get passiveIpOverrides + * @return passiveIpOverrides + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSIVE_IP_OVERRIDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPassiveIpOverrides() { + return passiveIpOverrides; + } + + + @JsonProperty(JSON_PROPERTY_PASSIVE_IP_OVERRIDES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassiveIpOverrides(List passiveIpOverrides) { + this.passiveIpOverrides = passiveIpOverrides; + } + + public FTPDBinding clientAuthType(Integer clientAuthType) { + + this.clientAuthType = clientAuthType; + return this; + } + + /** + * 1 means that client certificate authentication is required in addition to FTP authentication + * @return clientAuthType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getClientAuthType() { + return clientAuthType; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientAuthType(Integer clientAuthType) { + this.clientAuthType = clientAuthType; + } + + public FTPDBinding tlsCipherSuites(List tlsCipherSuites) { + + this.tlsCipherSuites = tlsCipherSuites; + return this; + } + + public FTPDBinding addTlsCipherSuitesItem(String tlsCipherSuitesItem) { + if (this.tlsCipherSuites == null) { + this.tlsCipherSuites = new ArrayList<>(); + } + this.tlsCipherSuites.add(tlsCipherSuitesItem); + return this; + } + + /** + * List of supported cipher suites for TLS version 1.2. If empty a default list of secure cipher suites is used, with a preference order based on hardware performance + * @return tlsCipherSuites + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_CIPHER_SUITES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTlsCipherSuites() { + return tlsCipherSuites; + } + + + @JsonProperty(JSON_PROPERTY_TLS_CIPHER_SUITES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsCipherSuites(List tlsCipherSuites) { + this.tlsCipherSuites = tlsCipherSuites; + } + + public FTPDBinding passiveConnectionsSecurity(PassiveConnectionsSecurityEnum passiveConnectionsSecurity) { + + this.passiveConnectionsSecurity = passiveConnectionsSecurity; + return this; + } + + /** + * Active connections security: * `0` - require matching peer IP addresses of control and data connection * `1` - disable any checks + * @return passiveConnectionsSecurity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSIVE_CONNECTIONS_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public PassiveConnectionsSecurityEnum getPassiveConnectionsSecurity() { + return passiveConnectionsSecurity; + } + + + @JsonProperty(JSON_PROPERTY_PASSIVE_CONNECTIONS_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassiveConnectionsSecurity(PassiveConnectionsSecurityEnum passiveConnectionsSecurity) { + this.passiveConnectionsSecurity = passiveConnectionsSecurity; + } + + public FTPDBinding activeConnectionsSecurity(ActiveConnectionsSecurityEnum activeConnectionsSecurity) { + + this.activeConnectionsSecurity = activeConnectionsSecurity; + return this; + } + + /** + * Active connections security: * `0` - require matching peer IP addresses of control and data connection * `1` - disable any checks + * @return activeConnectionsSecurity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTIVE_CONNECTIONS_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ActiveConnectionsSecurityEnum getActiveConnectionsSecurity() { + return activeConnectionsSecurity; + } + + + @JsonProperty(JSON_PROPERTY_ACTIVE_CONNECTIONS_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setActiveConnectionsSecurity(ActiveConnectionsSecurityEnum activeConnectionsSecurity) { + this.activeConnectionsSecurity = activeConnectionsSecurity; + } + + public FTPDBinding ignoreAsciiTransferType(IgnoreAsciiTransferTypeEnum ignoreAsciiTransferType) { + + this.ignoreAsciiTransferType = ignoreAsciiTransferType; + return this; + } + + /** + * Ignore client requests to perform ASCII translations: * `0` - ASCII translations are enabled * `1` - ASCII translations are silently ignored + * @return ignoreAsciiTransferType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IGNORE_ASCII_TRANSFER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public IgnoreAsciiTransferTypeEnum getIgnoreAsciiTransferType() { + return ignoreAsciiTransferType; + } + + + @JsonProperty(JSON_PROPERTY_IGNORE_ASCII_TRANSFER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreAsciiTransferType(IgnoreAsciiTransferTypeEnum ignoreAsciiTransferType) { + this.ignoreAsciiTransferType = ignoreAsciiTransferType; + } + + public FTPDBinding debug(Boolean debug) { + + this.debug = debug; + return this; + } + + /** + * If enabled any FTP command will be logged + * @return debug + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEBUG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDebug() { + return debug; + } + + + @JsonProperty(JSON_PROPERTY_DEBUG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDebug(Boolean debug) { + this.debug = debug; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FTPDBinding ftPDBinding = (FTPDBinding) o; + return Objects.equals(this.address, ftPDBinding.address) && + Objects.equals(this.port, ftPDBinding.port) && + Objects.equals(this.applyProxyConfig, ftPDBinding.applyProxyConfig) && + Objects.equals(this.tlsMode, ftPDBinding.tlsMode) && + Objects.equals(this.minTlsVersion, ftPDBinding.minTlsVersion) && + Objects.equals(this.forcePassiveIp, ftPDBinding.forcePassiveIp) && + Objects.equals(this.passiveIpOverrides, ftPDBinding.passiveIpOverrides) && + Objects.equals(this.clientAuthType, ftPDBinding.clientAuthType) && + Objects.equals(this.tlsCipherSuites, ftPDBinding.tlsCipherSuites) && + Objects.equals(this.passiveConnectionsSecurity, ftPDBinding.passiveConnectionsSecurity) && + Objects.equals(this.activeConnectionsSecurity, ftPDBinding.activeConnectionsSecurity) && + Objects.equals(this.ignoreAsciiTransferType, ftPDBinding.ignoreAsciiTransferType) && + Objects.equals(this.debug, ftPDBinding.debug); + } + + @Override + public int hashCode() { + return Objects.hash(address, port, applyProxyConfig, tlsMode, minTlsVersion, forcePassiveIp, passiveIpOverrides, clientAuthType, tlsCipherSuites, passiveConnectionsSecurity, activeConnectionsSecurity, ignoreAsciiTransferType, debug); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FTPDBinding {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" applyProxyConfig: ").append(toIndentedString(applyProxyConfig)).append("\n"); + sb.append(" tlsMode: ").append(toIndentedString(tlsMode)).append("\n"); + sb.append(" minTlsVersion: ").append(toIndentedString(minTlsVersion)).append("\n"); + sb.append(" forcePassiveIp: ").append(toIndentedString(forcePassiveIp)).append("\n"); + sb.append(" passiveIpOverrides: ").append(toIndentedString(passiveIpOverrides)).append("\n"); + sb.append(" clientAuthType: ").append(toIndentedString(clientAuthType)).append("\n"); + sb.append(" tlsCipherSuites: ").append(toIndentedString(tlsCipherSuites)).append("\n"); + sb.append(" passiveConnectionsSecurity: ").append(toIndentedString(passiveConnectionsSecurity)).append("\n"); + sb.append(" activeConnectionsSecurity: ").append(toIndentedString(activeConnectionsSecurity)).append("\n"); + sb.append(" ignoreAsciiTransferType: ").append(toIndentedString(ignoreAsciiTransferType)).append("\n"); + sb.append(" debug: ").append(toIndentedString(debug)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPPassivePortRange.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPPassivePortRange.java new file mode 100644 index 00000000..6ebab62f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPPassivePortRange.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FTPPassivePortRange + */ +@JsonPropertyOrder({ + FTPPassivePortRange.JSON_PROPERTY_START, + FTPPassivePortRange.JSON_PROPERTY_END +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FTPPassivePortRange { + public static final String JSON_PROPERTY_START = "start"; + private Integer start; + + public static final String JSON_PROPERTY_END = "end"; + private Integer end; + + public FTPPassivePortRange() { + } + + public FTPPassivePortRange start(Integer start) { + + this.start = start; + return this; + } + + /** + * Get start + * @return start + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getStart() { + return start; + } + + + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStart(Integer start) { + this.start = start; + } + + public FTPPassivePortRange end(Integer end) { + + this.end = end; + return this; + } + + /** + * Get end + * @return end + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getEnd() { + return end; + } + + + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnd(Integer end) { + this.end = end; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FTPPassivePortRange ftPPassivePortRange = (FTPPassivePortRange) o; + return Objects.equals(this.start, ftPPassivePortRange.start) && + Objects.equals(this.end, ftPPassivePortRange.end); + } + + @Override + public int hashCode() { + return Objects.hash(start, end); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FTPPassivePortRange {\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPServiceStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPServiceStatus.java new file mode 100644 index 00000000..48eb3db7 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FTPServiceStatus.java @@ -0,0 +1,193 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.jackson.nullable.JsonNullable; + +import java.util.*; + +/** + * FTPServiceStatus + */ +@JsonPropertyOrder({ + FTPServiceStatus.JSON_PROPERTY_IS_ACTIVE, + FTPServiceStatus.JSON_PROPERTY_BINDINGS, + FTPServiceStatus.JSON_PROPERTY_PASSIVE_PORT_RANGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FTPServiceStatus { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + public static final String JSON_PROPERTY_BINDINGS = "bindings"; + public static final String JSON_PROPERTY_PASSIVE_PORT_RANGE = "passive_port_range"; + private Boolean isActive; + private JsonNullable> bindings = JsonNullable.>undefined(); + private FTPPassivePortRange passivePortRange; + + public FTPServiceStatus() { + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + public FTPServiceStatus isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public FTPServiceStatus bindings(List bindings) { + this.bindings = JsonNullable.>of(bindings); + + return this; + } + + public FTPServiceStatus addBindingsItem(FTPDBinding bindingsItem) { + if (this.bindings == null || !this.bindings.isPresent()) { + this.bindings = JsonNullable.>of(new ArrayList<>()); + } + try { + this.bindings.get().add(bindingsItem); + } catch (NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get bindings + * + * @return bindings + */ + @javax.annotation.Nullable + @JsonIgnore + + public List getBindings() { + return bindings.orElse(null); + } + + public void setBindings(List bindings) { + this.bindings = JsonNullable.>of(bindings); + } + + @JsonProperty(JSON_PROPERTY_BINDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getBindings_JsonNullable() { + return bindings; + } + + @JsonProperty(JSON_PROPERTY_BINDINGS) + public void setBindings_JsonNullable(JsonNullable> bindings) { + this.bindings = bindings; + } + + public FTPServiceStatus passivePortRange(FTPPassivePortRange passivePortRange) { + + this.passivePortRange = passivePortRange; + return this; + } + + /** + * Get passivePortRange + * + * @return passivePortRange + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSIVE_PORT_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FTPPassivePortRange getPassivePortRange() { + return passivePortRange; + } + + @JsonProperty(JSON_PROPERTY_PASSIVE_PORT_RANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassivePortRange(FTPPassivePortRange passivePortRange) { + this.passivePortRange = passivePortRange; + } + + @Override + public int hashCode() { + return Objects.hash(isActive, hashCodeNullable(bindings), passivePortRange); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FTPServiceStatus ftPServiceStatus = (FTPServiceStatus) o; + return Objects.equals(this.isActive, ftPServiceStatus.isActive) && + equalsNullable(this.bindings, ftPServiceStatus.bindings) && + Objects.equals(this.passivePortRange, ftPServiceStatus.passivePortRange); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FTPServiceStatus {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" bindings: ").append(toIndentedString(bindings)).append("\n"); + sb.append(" passivePortRange: ").append(toIndentedString(passivePortRange)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemActionTypes.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemActionTypes.java new file mode 100644 index 00000000..9b5d7930 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemActionTypes.java @@ -0,0 +1,67 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Supported filesystem action types: * `1` - Rename * `2` - Delete * `3` - Mkdis * `4` - Exist * `5` - Compress * `6` - Copy + */ +public enum FilesystemActionTypes { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + FilesystemActionTypes(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FilesystemActionTypes fromValue(Integer value) { + for (FilesystemActionTypes b : FilesystemActionTypes.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemConfig.java new file mode 100644 index 00000000..b0cba816 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FilesystemConfig.java @@ -0,0 +1,328 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.AzureBlobFsConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.CryptFsConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsProviders; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.GCSConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.HTTPFsConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.OSFsConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.S3Config; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.SFTPFsConfig; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Storage filesystem details + */ +@JsonPropertyOrder({ + FilesystemConfig.JSON_PROPERTY_PROVIDER, + FilesystemConfig.JSON_PROPERTY_OSCONFIG, + FilesystemConfig.JSON_PROPERTY_S3CONFIG, + FilesystemConfig.JSON_PROPERTY_GCSCONFIG, + FilesystemConfig.JSON_PROPERTY_AZBLOBCONFIG, + FilesystemConfig.JSON_PROPERTY_CRYPTCONFIG, + FilesystemConfig.JSON_PROPERTY_SFTPCONFIG, + FilesystemConfig.JSON_PROPERTY_HTTPCONFIG +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FilesystemConfig { + public static final String JSON_PROPERTY_PROVIDER = "provider"; + private FsProviders provider; + + public static final String JSON_PROPERTY_OSCONFIG = "osconfig"; + private OSFsConfig osconfig; + + public static final String JSON_PROPERTY_S3CONFIG = "s3config"; + private S3Config s3config; + + public static final String JSON_PROPERTY_GCSCONFIG = "gcsconfig"; + private GCSConfig gcsconfig; + + public static final String JSON_PROPERTY_AZBLOBCONFIG = "azblobconfig"; + private AzureBlobFsConfig azblobconfig; + + public static final String JSON_PROPERTY_CRYPTCONFIG = "cryptconfig"; + private CryptFsConfig cryptconfig; + + public static final String JSON_PROPERTY_SFTPCONFIG = "sftpconfig"; + private SFTPFsConfig sftpconfig; + + public static final String JSON_PROPERTY_HTTPCONFIG = "httpconfig"; + private HTTPFsConfig httpconfig; + + public FilesystemConfig() { + } + + public FilesystemConfig provider(FsProviders provider) { + + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FsProviders getProvider() { + return provider; + } + + + @JsonProperty(JSON_PROPERTY_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProvider(FsProviders provider) { + this.provider = provider; + } + + public FilesystemConfig osconfig(OSFsConfig osconfig) { + + this.osconfig = osconfig; + return this; + } + + /** + * Get osconfig + * @return osconfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OSCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OSFsConfig getOsconfig() { + return osconfig; + } + + + @JsonProperty(JSON_PROPERTY_OSCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOsconfig(OSFsConfig osconfig) { + this.osconfig = osconfig; + } + + public FilesystemConfig s3config(S3Config s3config) { + + this.s3config = s3config; + return this; + } + + /** + * Get s3config + * @return s3config + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_S3CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public S3Config getS3config() { + return s3config; + } + + + @JsonProperty(JSON_PROPERTY_S3CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setS3config(S3Config s3config) { + this.s3config = s3config; + } + + public FilesystemConfig gcsconfig(GCSConfig gcsconfig) { + + this.gcsconfig = gcsconfig; + return this; + } + + /** + * Get gcsconfig + * @return gcsconfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GCSCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GCSConfig getGcsconfig() { + return gcsconfig; + } + + + @JsonProperty(JSON_PROPERTY_GCSCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGcsconfig(GCSConfig gcsconfig) { + this.gcsconfig = gcsconfig; + } + + public FilesystemConfig azblobconfig(AzureBlobFsConfig azblobconfig) { + + this.azblobconfig = azblobconfig; + return this; + } + + /** + * Get azblobconfig + * @return azblobconfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AZBLOBCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AzureBlobFsConfig getAzblobconfig() { + return azblobconfig; + } + + + @JsonProperty(JSON_PROPERTY_AZBLOBCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAzblobconfig(AzureBlobFsConfig azblobconfig) { + this.azblobconfig = azblobconfig; + } + + public FilesystemConfig cryptconfig(CryptFsConfig cryptconfig) { + + this.cryptconfig = cryptconfig; + return this; + } + + /** + * Get cryptconfig + * @return cryptconfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CRYPTCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CryptFsConfig getCryptconfig() { + return cryptconfig; + } + + + @JsonProperty(JSON_PROPERTY_CRYPTCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCryptconfig(CryptFsConfig cryptconfig) { + this.cryptconfig = cryptconfig; + } + + public FilesystemConfig sftpconfig(SFTPFsConfig sftpconfig) { + + this.sftpconfig = sftpconfig; + return this; + } + + /** + * Get sftpconfig + * @return sftpconfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SFTPCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SFTPFsConfig getSftpconfig() { + return sftpconfig; + } + + + @JsonProperty(JSON_PROPERTY_SFTPCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSftpconfig(SFTPFsConfig sftpconfig) { + this.sftpconfig = sftpconfig; + } + + public FilesystemConfig httpconfig(HTTPFsConfig httpconfig) { + + this.httpconfig = httpconfig; + return this; + } + + /** + * Get httpconfig + * @return httpconfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HTTPCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public HTTPFsConfig getHttpconfig() { + return httpconfig; + } + + + @JsonProperty(JSON_PROPERTY_HTTPCONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpconfig(HTTPFsConfig httpconfig) { + this.httpconfig = httpconfig; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FilesystemConfig filesystemConfig = (FilesystemConfig) o; + return Objects.equals(this.provider, filesystemConfig.provider) && + Objects.equals(this.osconfig, filesystemConfig.osconfig) && + Objects.equals(this.s3config, filesystemConfig.s3config) && + Objects.equals(this.gcsconfig, filesystemConfig.gcsconfig) && + Objects.equals(this.azblobconfig, filesystemConfig.azblobconfig) && + Objects.equals(this.cryptconfig, filesystemConfig.cryptconfig) && + Objects.equals(this.sftpconfig, filesystemConfig.sftpconfig) && + Objects.equals(this.httpconfig, filesystemConfig.httpconfig); + } + + @Override + public int hashCode() { + return Objects.hash(provider, osconfig, s3config, gcsconfig, azblobconfig, cryptconfig, sftpconfig, httpconfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FilesystemConfig {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" osconfig: ").append(toIndentedString(osconfig)).append("\n"); + sb.append(" s3config: ").append(toIndentedString(s3config)).append("\n"); + sb.append(" gcsconfig: ").append(toIndentedString(gcsconfig)).append("\n"); + sb.append(" azblobconfig: ").append(toIndentedString(azblobconfig)).append("\n"); + sb.append(" cryptconfig: ").append(toIndentedString(cryptconfig)).append("\n"); + sb.append(" sftpconfig: ").append(toIndentedString(sftpconfig)).append("\n"); + sb.append(" httpconfig: ").append(toIndentedString(httpconfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderQuotaScan.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderQuotaScan.java new file mode 100644 index 00000000..116bec72 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderQuotaScan.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FolderQuotaScan + */ +@JsonPropertyOrder({ + FolderQuotaScan.JSON_PROPERTY_NAME, + FolderQuotaScan.JSON_PROPERTY_START_TIME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FolderQuotaScan { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_START_TIME = "start_time"; + private Long startTime; + + public FolderQuotaScan() { + } + + public FolderQuotaScan name(String name) { + + this.name = name; + return this; + } + + /** + * folder name to which the quota scan refers + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public FolderQuotaScan startTime(Long startTime) { + + this.startTime = startTime; + return this; + } + + /** + * scan start time as unix timestamp in milliseconds + * @return startTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getStartTime() { + return startTime; + } + + + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderQuotaScan folderQuotaScan = (FolderQuotaScan) o; + return Objects.equals(this.name, folderQuotaScan.name) && + Objects.equals(this.startTime, folderQuotaScan.startTime); + } + + @Override + public int hashCode() { + return Objects.hash(name, startTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderQuotaScan {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderRetention.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderRetention.java new file mode 100644 index 00000000..7ac4592e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FolderRetention.java @@ -0,0 +1,196 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FolderRetention + */ +@JsonPropertyOrder({ + FolderRetention.JSON_PROPERTY_PATH, + FolderRetention.JSON_PROPERTY_RETENTION, + FolderRetention.JSON_PROPERTY_DELETE_EMPTY_DIRS, + FolderRetention.JSON_PROPERTY_IGNORE_USER_PERMISSIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FolderRetention { + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_RETENTION = "retention"; + private Integer retention; + + public static final String JSON_PROPERTY_DELETE_EMPTY_DIRS = "delete_empty_dirs"; + private Boolean deleteEmptyDirs; + + public static final String JSON_PROPERTY_IGNORE_USER_PERMISSIONS = "ignore_user_permissions"; + private Boolean ignoreUserPermissions; + + public FolderRetention() { + } + + public FolderRetention path(String path) { + + this.path = path; + return this; + } + + /** + * virtual directory path as seen by users, if no other specific retention is defined, the retention applies for sub directories too. For example if retention is defined for the paths \"/\" and \"/sub\" then the retention for \"/\" is applied for any file outside the \"/sub\" directory + * @return path + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(String path) { + this.path = path; + } + + public FolderRetention retention(Integer retention) { + + this.retention = retention; + return this; + } + + /** + * retention time in hours. All the files with a modification time older than the defined value will be deleted. 0 means exclude this path + * @return retention + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getRetention() { + return retention; + } + + + @JsonProperty(JSON_PROPERTY_RETENTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRetention(Integer retention) { + this.retention = retention; + } + + public FolderRetention deleteEmptyDirs(Boolean deleteEmptyDirs) { + + this.deleteEmptyDirs = deleteEmptyDirs; + return this; + } + + /** + * if enabled, empty directories will be deleted + * @return deleteEmptyDirs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETE_EMPTY_DIRS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeleteEmptyDirs() { + return deleteEmptyDirs; + } + + + @JsonProperty(JSON_PROPERTY_DELETE_EMPTY_DIRS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeleteEmptyDirs(Boolean deleteEmptyDirs) { + this.deleteEmptyDirs = deleteEmptyDirs; + } + + public FolderRetention ignoreUserPermissions(Boolean ignoreUserPermissions) { + + this.ignoreUserPermissions = ignoreUserPermissions; + return this; + } + + /** + * if enabled, files will be deleted even if the user does not have the delete permission. The default is \"false\" which means that files will be skipped if the user does not have permission to delete them. File patterns filters will always be silently ignored + * @return ignoreUserPermissions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IGNORE_USER_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIgnoreUserPermissions() { + return ignoreUserPermissions; + } + + + @JsonProperty(JSON_PROPERTY_IGNORE_USER_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIgnoreUserPermissions(Boolean ignoreUserPermissions) { + this.ignoreUserPermissions = ignoreUserPermissions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FolderRetention folderRetention = (FolderRetention) o; + return Objects.equals(this.path, folderRetention.path) && + Objects.equals(this.retention, folderRetention.retention) && + Objects.equals(this.deleteEmptyDirs, folderRetention.deleteEmptyDirs) && + Objects.equals(this.ignoreUserPermissions, folderRetention.ignoreUserPermissions); + } + + @Override + public int hashCode() { + return Objects.hash(path, retention, deleteEmptyDirs, ignoreUserPermissions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FolderRetention {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" retention: ").append(toIndentedString(retention)).append("\n"); + sb.append(" deleteEmptyDirs: ").append(toIndentedString(deleteEmptyDirs)).append("\n"); + sb.append(" ignoreUserPermissions: ").append(toIndentedString(ignoreUserPermissions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEvent.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEvent.java new file mode 100644 index 00000000..8904c32f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEvent.java @@ -0,0 +1,727 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsEventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsEventStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FsProviders; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FsEvent + */ +@JsonPropertyOrder({ + FsEvent.JSON_PROPERTY_ID, + FsEvent.JSON_PROPERTY_TIMESTAMP, + FsEvent.JSON_PROPERTY_ACTION, + FsEvent.JSON_PROPERTY_USERNAME, + FsEvent.JSON_PROPERTY_FS_PATH, + FsEvent.JSON_PROPERTY_FS_TARGET_PATH, + FsEvent.JSON_PROPERTY_VIRTUAL_PATH, + FsEvent.JSON_PROPERTY_VIRTUAL_TARGET_PATH, + FsEvent.JSON_PROPERTY_SSH_CMD, + FsEvent.JSON_PROPERTY_FILE_SIZE, + FsEvent.JSON_PROPERTY_ELAPSED, + FsEvent.JSON_PROPERTY_STATUS, + FsEvent.JSON_PROPERTY_PROTOCOL, + FsEvent.JSON_PROPERTY_IP, + FsEvent.JSON_PROPERTY_SESSION_ID, + FsEvent.JSON_PROPERTY_FS_PROVIDER, + FsEvent.JSON_PROPERTY_BUCKET, + FsEvent.JSON_PROPERTY_ENDPOINT, + FsEvent.JSON_PROPERTY_OPEN_FLAGS, + FsEvent.JSON_PROPERTY_ROLE, + FsEvent.JSON_PROPERTY_INSTANCE_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class FsEvent { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private Long timestamp; + + public static final String JSON_PROPERTY_ACTION = "action"; + private FsEventAction action; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FS_PATH = "fs_path"; + private String fsPath; + + public static final String JSON_PROPERTY_FS_TARGET_PATH = "fs_target_path"; + private String fsTargetPath; + + public static final String JSON_PROPERTY_VIRTUAL_PATH = "virtual_path"; + private String virtualPath; + + public static final String JSON_PROPERTY_VIRTUAL_TARGET_PATH = "virtual_target_path"; + private String virtualTargetPath; + + public static final String JSON_PROPERTY_SSH_CMD = "ssh_cmd"; + private String sshCmd; + + public static final String JSON_PROPERTY_FILE_SIZE = "file_size"; + private Long fileSize; + + public static final String JSON_PROPERTY_ELAPSED = "elapsed"; + private Long elapsed; + + public static final String JSON_PROPERTY_STATUS = "status"; + private FsEventStatus status; + + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private EventProtocols protocol; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_SESSION_ID = "session_id"; + private String sessionId; + + public static final String JSON_PROPERTY_FS_PROVIDER = "fs_provider"; + private FsProviders fsProvider; + + public static final String JSON_PROPERTY_BUCKET = "bucket"; + private String bucket; + + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_OPEN_FLAGS = "open_flags"; + private String openFlags; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private String instanceId; + + public FsEvent() { + } + + public FsEvent id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + public FsEvent timestamp(Long timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * unix timestamp in nanoseconds + * @return timestamp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTimestamp() { + return timestamp; + } + + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + public FsEvent action(FsEventAction action) { + + this.action = action; + return this; + } + + /** + * Get action + * @return action + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FsEventAction getAction() { + return action; + } + + + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAction(FsEventAction action) { + this.action = action; + } + + public FsEvent username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public FsEvent fsPath(String fsPath) { + + this.fsPath = fsPath; + return this; + } + + /** + * Get fsPath + * @return fsPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFsPath() { + return fsPath; + } + + + @JsonProperty(JSON_PROPERTY_FS_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsPath(String fsPath) { + this.fsPath = fsPath; + } + + public FsEvent fsTargetPath(String fsTargetPath) { + + this.fsTargetPath = fsTargetPath; + return this; + } + + /** + * Get fsTargetPath + * @return fsTargetPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_TARGET_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFsTargetPath() { + return fsTargetPath; + } + + + @JsonProperty(JSON_PROPERTY_FS_TARGET_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsTargetPath(String fsTargetPath) { + this.fsTargetPath = fsTargetPath; + } + + public FsEvent virtualPath(String virtualPath) { + + this.virtualPath = virtualPath; + return this; + } + + /** + * Get virtualPath + * @return virtualPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIRTUAL_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getVirtualPath() { + return virtualPath; + } + + + @JsonProperty(JSON_PROPERTY_VIRTUAL_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualPath(String virtualPath) { + this.virtualPath = virtualPath; + } + + public FsEvent virtualTargetPath(String virtualTargetPath) { + + this.virtualTargetPath = virtualTargetPath; + return this; + } + + /** + * Get virtualTargetPath + * @return virtualTargetPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIRTUAL_TARGET_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getVirtualTargetPath() { + return virtualTargetPath; + } + + + @JsonProperty(JSON_PROPERTY_VIRTUAL_TARGET_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualTargetPath(String virtualTargetPath) { + this.virtualTargetPath = virtualTargetPath; + } + + public FsEvent sshCmd(String sshCmd) { + + this.sshCmd = sshCmd; + return this; + } + + /** + * Get sshCmd + * @return sshCmd + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SSH_CMD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSshCmd() { + return sshCmd; + } + + + @JsonProperty(JSON_PROPERTY_SSH_CMD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSshCmd(String sshCmd) { + this.sshCmd = sshCmd; + } + + public FsEvent fileSize(Long fileSize) { + + this.fileSize = fileSize; + return this; + } + + /** + * Get fileSize + * @return fileSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFileSize() { + return fileSize; + } + + + @JsonProperty(JSON_PROPERTY_FILE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileSize(Long fileSize) { + this.fileSize = fileSize; + } + + public FsEvent elapsed(Long elapsed) { + + this.elapsed = elapsed; + return this; + } + + /** + * elapsed time as milliseconds + * @return elapsed + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ELAPSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getElapsed() { + return elapsed; + } + + + @JsonProperty(JSON_PROPERTY_ELAPSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setElapsed(Long elapsed) { + this.elapsed = elapsed; + } + + public FsEvent status(FsEventStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FsEventStatus getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(FsEventStatus status) { + this.status = status; + } + + public FsEvent protocol(EventProtocols protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * @return protocol + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventProtocols getProtocol() { + return protocol; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(EventProtocols protocol) { + this.protocol = protocol; + } + + public FsEvent ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Get ip + * @return ip + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + public FsEvent sessionId(String sessionId) { + + this.sessionId = sessionId; + return this; + } + + /** + * Get sessionId + * @return sessionId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSessionId() { + return sessionId; + } + + + @JsonProperty(JSON_PROPERTY_SESSION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + public FsEvent fsProvider(FsProviders fsProvider) { + + this.fsProvider = fsProvider; + return this; + } + + /** + * Get fsProvider + * @return fsProvider + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FS_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FsProviders getFsProvider() { + return fsProvider; + } + + + @JsonProperty(JSON_PROPERTY_FS_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFsProvider(FsProviders fsProvider) { + this.fsProvider = fsProvider; + } + + public FsEvent bucket(String bucket) { + + this.bucket = bucket; + return this; + } + + /** + * Get bucket + * @return bucket + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBucket() { + return bucket; + } + + + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public FsEvent endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * Get endpoint + * @return endpoint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public FsEvent openFlags(String openFlags) { + + this.openFlags = openFlags; + return this; + } + + /** + * Get openFlags + * @return openFlags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPEN_FLAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOpenFlags() { + return openFlags; + } + + + @JsonProperty(JSON_PROPERTY_OPEN_FLAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpenFlags(String openFlags) { + this.openFlags = openFlags; + } + + public FsEvent role(String role) { + + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; + } + + public FsEvent instanceId(String instanceId) { + + this.instanceId = instanceId; + return this; + } + + /** + * Get instanceId + * @return instanceId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInstanceId() { + return instanceId; + } + + + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FsEvent fsEvent = (FsEvent) o; + return Objects.equals(this.id, fsEvent.id) && + Objects.equals(this.timestamp, fsEvent.timestamp) && + Objects.equals(this.action, fsEvent.action) && + Objects.equals(this.username, fsEvent.username) && + Objects.equals(this.fsPath, fsEvent.fsPath) && + Objects.equals(this.fsTargetPath, fsEvent.fsTargetPath) && + Objects.equals(this.virtualPath, fsEvent.virtualPath) && + Objects.equals(this.virtualTargetPath, fsEvent.virtualTargetPath) && + Objects.equals(this.sshCmd, fsEvent.sshCmd) && + Objects.equals(this.fileSize, fsEvent.fileSize) && + Objects.equals(this.elapsed, fsEvent.elapsed) && + Objects.equals(this.status, fsEvent.status) && + Objects.equals(this.protocol, fsEvent.protocol) && + Objects.equals(this.ip, fsEvent.ip) && + Objects.equals(this.sessionId, fsEvent.sessionId) && + Objects.equals(this.fsProvider, fsEvent.fsProvider) && + Objects.equals(this.bucket, fsEvent.bucket) && + Objects.equals(this.endpoint, fsEvent.endpoint) && + Objects.equals(this.openFlags, fsEvent.openFlags) && + Objects.equals(this.role, fsEvent.role) && + Objects.equals(this.instanceId, fsEvent.instanceId); + } + + @Override + public int hashCode() { + return Objects.hash(id, timestamp, action, username, fsPath, fsTargetPath, virtualPath, virtualTargetPath, sshCmd, fileSize, elapsed, status, protocol, ip, sessionId, fsProvider, bucket, endpoint, openFlags, role, instanceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FsEvent {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" fsPath: ").append(toIndentedString(fsPath)).append("\n"); + sb.append(" fsTargetPath: ").append(toIndentedString(fsTargetPath)).append("\n"); + sb.append(" virtualPath: ").append(toIndentedString(virtualPath)).append("\n"); + sb.append(" virtualTargetPath: ").append(toIndentedString(virtualTargetPath)).append("\n"); + sb.append(" sshCmd: ").append(toIndentedString(sshCmd)).append("\n"); + sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n"); + sb.append(" elapsed: ").append(toIndentedString(elapsed)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" fsProvider: ").append(toIndentedString(fsProvider)).append("\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" openFlags: ").append(toIndentedString(openFlags)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventAction.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventAction.java new file mode 100644 index 00000000..7a56212c --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventAction.java @@ -0,0 +1,73 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FsEventAction + */ +public enum FsEventAction { + + DOWNLOAD("download"), + + UPLOAD("upload"), + + FIRST_UPLOAD("first-upload"), + + FIRST_DOWNLOAD("first-download"), + + DELETE("delete"), + + RENAME("rename"), + + MKDIR("mkdir"), + + RMDIR("rmdir"), + + SSH_CMD("ssh_cmd"); + + private String value; + + FsEventAction(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FsEventAction fromValue(String value) { + for (FsEventAction b : FsEventAction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventStatus.java new file mode 100644 index 00000000..2b2aae09 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsEventStatus.java @@ -0,0 +1,61 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Event status: * `1` - no error * `2` - generic error * `3` - quota exceeded error + */ +public enum FsEventStatus { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3); + + private Integer value; + + FsEventStatus(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FsEventStatus fromValue(Integer value) { + for (FsEventStatus b : FsEventStatus.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsProviders.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsProviders.java new file mode 100644 index 00000000..c534fff4 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/FsProviders.java @@ -0,0 +1,69 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Filesystem providers: * `0` - Local filesystem * `1` - S3 Compatible Object Storage * `2` - Google Cloud Storage * `3` - Azure Blob Storage * `4` - Local filesystem encrypted * `5` - SFTP * `6` - HTTP filesystem + */ +public enum FsProviders { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + FsProviders(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FsProviders fromValue(Integer value) { + for (FsProviders b : FsProviders.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GCSConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GCSConfig.java new file mode 100644 index 00000000..18ff14ad --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GCSConfig.java @@ -0,0 +1,356 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Google Cloud Storage configuration details. The \"credentials\" field must be populated only when adding/updating a user. It will be always omitted, since there are sensitive data, when you search/get users + */ +@JsonPropertyOrder({ + GCSConfig.JSON_PROPERTY_BUCKET, + GCSConfig.JSON_PROPERTY_CREDENTIALS, + GCSConfig.JSON_PROPERTY_AUTOMATIC_CREDENTIALS, + GCSConfig.JSON_PROPERTY_STORAGE_CLASS, + GCSConfig.JSON_PROPERTY_ACL, + GCSConfig.JSON_PROPERTY_KEY_PREFIX, + GCSConfig.JSON_PROPERTY_UPLOAD_PART_SIZE, + GCSConfig.JSON_PROPERTY_UPLOAD_PART_MAX_TIME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GCSConfig { + public static final String JSON_PROPERTY_BUCKET = "bucket"; + private String bucket; + + public static final String JSON_PROPERTY_CREDENTIALS = "credentials"; + private Secret credentials; + + /** + * Automatic credentials: * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials + */ + public enum AutomaticCredentialsEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + AutomaticCredentialsEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AutomaticCredentialsEnum fromValue(Integer value) { + for (AutomaticCredentialsEnum b : AutomaticCredentialsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_AUTOMATIC_CREDENTIALS = "automatic_credentials"; + private AutomaticCredentialsEnum automaticCredentials; + + public static final String JSON_PROPERTY_STORAGE_CLASS = "storage_class"; + private String storageClass; + + public static final String JSON_PROPERTY_ACL = "acl"; + private String acl; + + public static final String JSON_PROPERTY_KEY_PREFIX = "key_prefix"; + private String keyPrefix; + + public static final String JSON_PROPERTY_UPLOAD_PART_SIZE = "upload_part_size"; + private Integer uploadPartSize; + + public static final String JSON_PROPERTY_UPLOAD_PART_MAX_TIME = "upload_part_max_time"; + private Integer uploadPartMaxTime; + + public GCSConfig() { + } + + public GCSConfig bucket(String bucket) { + + this.bucket = bucket; + return this; + } + + /** + * Get bucket + * @return bucket + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBucket() { + return bucket; + } + + + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public GCSConfig credentials(Secret credentials) { + + this.credentials = credentials; + return this; + } + + /** + * Get credentials + * @return credentials + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getCredentials() { + return credentials; + } + + + @JsonProperty(JSON_PROPERTY_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCredentials(Secret credentials) { + this.credentials = credentials; + } + + public GCSConfig automaticCredentials(AutomaticCredentialsEnum automaticCredentials) { + + this.automaticCredentials = automaticCredentials; + return this; + } + + /** + * Automatic credentials: * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials + * @return automaticCredentials + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTOMATIC_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public AutomaticCredentialsEnum getAutomaticCredentials() { + return automaticCredentials; + } + + + @JsonProperty(JSON_PROPERTY_AUTOMATIC_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAutomaticCredentials(AutomaticCredentialsEnum automaticCredentials) { + this.automaticCredentials = automaticCredentials; + } + + public GCSConfig storageClass(String storageClass) { + + this.storageClass = storageClass; + return this; + } + + /** + * Get storageClass + * @return storageClass + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStorageClass() { + return storageClass; + } + + + @JsonProperty(JSON_PROPERTY_STORAGE_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageClass(String storageClass) { + this.storageClass = storageClass; + } + + public GCSConfig acl(String acl) { + + this.acl = acl; + return this; + } + + /** + * The ACL to apply to uploaded objects. Leave empty to use the default ACL. For more information and available ACLs, refer to the JSON API here: https://cloud.google.com/storage/docs/access-control/lists#predefined-acl + * @return acl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAcl() { + return acl; + } + + + @JsonProperty(JSON_PROPERTY_ACL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcl(String acl) { + this.acl = acl; + } + + public GCSConfig keyPrefix(String keyPrefix) { + + this.keyPrefix = keyPrefix; + return this; + } + + /** + * key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with \"/\" and must end with \"/\". If empty the whole bucket contents will be available + * @return keyPrefix + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKeyPrefix() { + return keyPrefix; + } + + + @JsonProperty(JSON_PROPERTY_KEY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyPrefix(String keyPrefix) { + this.keyPrefix = keyPrefix; + } + + public GCSConfig uploadPartSize(Integer uploadPartSize) { + + this.uploadPartSize = uploadPartSize; + return this; + } + + /** + * The buffer size (in MB) to use for multipart uploads. The default value is 16MB. 0 means use the default + * @return uploadPartSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadPartSize() { + return uploadPartSize; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadPartSize(Integer uploadPartSize) { + this.uploadPartSize = uploadPartSize; + } + + public GCSConfig uploadPartMaxTime(Integer uploadPartMaxTime) { + + this.uploadPartMaxTime = uploadPartMaxTime; + return this; + } + + /** + * The maximum time allowed, in seconds, to upload a single chunk. The default value is 32. 0 means use the default + * @return uploadPartMaxTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_MAX_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadPartMaxTime() { + return uploadPartMaxTime; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_MAX_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadPartMaxTime(Integer uploadPartMaxTime) { + this.uploadPartMaxTime = uploadPartMaxTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GCSConfig gcSConfig = (GCSConfig) o; + return Objects.equals(this.bucket, gcSConfig.bucket) && + Objects.equals(this.credentials, gcSConfig.credentials) && + Objects.equals(this.automaticCredentials, gcSConfig.automaticCredentials) && + Objects.equals(this.storageClass, gcSConfig.storageClass) && + Objects.equals(this.acl, gcSConfig.acl) && + Objects.equals(this.keyPrefix, gcSConfig.keyPrefix) && + Objects.equals(this.uploadPartSize, gcSConfig.uploadPartSize) && + Objects.equals(this.uploadPartMaxTime, gcSConfig.uploadPartMaxTime); + } + + @Override + public int hashCode() { + return Objects.hash(bucket, credentials, automaticCredentials, storageClass, acl, keyPrefix, uploadPartSize, uploadPartMaxTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GCSConfig {\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append(" automaticCredentials: ").append(toIndentedString(automaticCredentials)).append("\n"); + sb.append(" storageClass: ").append(toIndentedString(storageClass)).append("\n"); + sb.append(" acl: ").append(toIndentedString(acl)).append("\n"); + sb.append(" keyPrefix: ").append(toIndentedString(keyPrefix)).append("\n"); + sb.append(" uploadPartSize: ").append(toIndentedString(uploadPartSize)).append("\n"); + sb.append(" uploadPartMaxTime: ").append(toIndentedString(uploadPartMaxTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecret200Response.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecret200Response.java new file mode 100644 index 00000000..1978fad0 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecret200Response.java @@ -0,0 +1,228 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * GenerateAdminTotpSecret200Response + */ +@JsonPropertyOrder({ + GenerateAdminTotpSecret200Response.JSON_PROPERTY_CONFIG_NAME, + GenerateAdminTotpSecret200Response.JSON_PROPERTY_ISSUER, + GenerateAdminTotpSecret200Response.JSON_PROPERTY_SECRET, + GenerateAdminTotpSecret200Response.JSON_PROPERTY_URL, + GenerateAdminTotpSecret200Response.JSON_PROPERTY_QR_CODE +}) +@JsonTypeName("generate_admin_totp_secret_200_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GenerateAdminTotpSecret200Response { + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public static final String JSON_PROPERTY_ISSUER = "issuer"; + private String issuer; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private String secret; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public static final String JSON_PROPERTY_QR_CODE = "qr_code"; + private byte[] qrCode; + + public GenerateAdminTotpSecret200Response() { + } + + public GenerateAdminTotpSecret200Response configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * Get configName + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + public GenerateAdminTotpSecret200Response issuer(String issuer) { + + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIssuer() { + return issuer; + } + + + @JsonProperty(JSON_PROPERTY_ISSUER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + public GenerateAdminTotpSecret200Response secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(String secret) { + this.secret = secret; + } + + public GenerateAdminTotpSecret200Response url(String url) { + + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(String url) { + this.url = url; + } + + public GenerateAdminTotpSecret200Response qrCode(byte[] qrCode) { + + this.qrCode = qrCode; + return this; + } + + /** + * QR code png encoded as BASE64 + * @return qrCode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public byte[] getQrCode() { + return qrCode; + } + + + @JsonProperty(JSON_PROPERTY_QR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQrCode(byte[] qrCode) { + this.qrCode = qrCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateAdminTotpSecret200Response generateAdminTotpSecret200Response = (GenerateAdminTotpSecret200Response) o; + return Objects.equals(this.configName, generateAdminTotpSecret200Response.configName) && + Objects.equals(this.issuer, generateAdminTotpSecret200Response.issuer) && + Objects.equals(this.secret, generateAdminTotpSecret200Response.secret) && + Objects.equals(this.url, generateAdminTotpSecret200Response.url) && + Arrays.equals(this.qrCode, generateAdminTotpSecret200Response.qrCode); + } + + @Override + public int hashCode() { + return Objects.hash(configName, issuer, secret, url, Arrays.hashCode(qrCode)); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateAdminTotpSecret200Response {\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" qrCode: ").append(toIndentedString(qrCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecretRequest.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecretRequest.java new file mode 100644 index 00000000..fb7edc9e --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateAdminTotpSecretRequest.java @@ -0,0 +1,104 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * GenerateAdminTotpSecretRequest + */ +@JsonPropertyOrder({ + GenerateAdminTotpSecretRequest.JSON_PROPERTY_CONFIG_NAME +}) +@JsonTypeName("generate_admin_totp_secret_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GenerateAdminTotpSecretRequest { + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public GenerateAdminTotpSecretRequest() { + } + + public GenerateAdminTotpSecretRequest configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * name of the configuration to use to generate the secret + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateAdminTotpSecretRequest generateAdminTotpSecretRequest = (GenerateAdminTotpSecretRequest) o; + return Objects.equals(this.configName, generateAdminTotpSecretRequest.configName); + } + + @Override + public int hashCode() { + return Objects.hash(configName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateAdminTotpSecretRequest {\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateUserTotpSecret200Response.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateUserTotpSecret200Response.java new file mode 100644 index 00000000..d43fade7 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GenerateUserTotpSecret200Response.java @@ -0,0 +1,197 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * GenerateUserTotpSecret200Response + */ +@JsonPropertyOrder({ + GenerateUserTotpSecret200Response.JSON_PROPERTY_CONFIG_NAME, + GenerateUserTotpSecret200Response.JSON_PROPERTY_ISSUER, + GenerateUserTotpSecret200Response.JSON_PROPERTY_SECRET, + GenerateUserTotpSecret200Response.JSON_PROPERTY_QR_CODE +}) +@JsonTypeName("generate_user_totp_secret_200_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GenerateUserTotpSecret200Response { + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public static final String JSON_PROPERTY_ISSUER = "issuer"; + private String issuer; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private String secret; + + public static final String JSON_PROPERTY_QR_CODE = "qr_code"; + private byte[] qrCode; + + public GenerateUserTotpSecret200Response() { + } + + public GenerateUserTotpSecret200Response configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * Get configName + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + public GenerateUserTotpSecret200Response issuer(String issuer) { + + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIssuer() { + return issuer; + } + + + @JsonProperty(JSON_PROPERTY_ISSUER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + public GenerateUserTotpSecret200Response secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(String secret) { + this.secret = secret; + } + + public GenerateUserTotpSecret200Response qrCode(byte[] qrCode) { + + this.qrCode = qrCode; + return this; + } + + /** + * QR code png encoded as BASE64 + * @return qrCode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public byte[] getQrCode() { + return qrCode; + } + + + @JsonProperty(JSON_PROPERTY_QR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQrCode(byte[] qrCode) { + this.qrCode = qrCode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateUserTotpSecret200Response generateUserTotpSecret200Response = (GenerateUserTotpSecret200Response) o; + return Objects.equals(this.configName, generateUserTotpSecret200Response.configName) && + Objects.equals(this.issuer, generateUserTotpSecret200Response.issuer) && + Objects.equals(this.secret, generateUserTotpSecret200Response.secret) && + Arrays.equals(this.qrCode, generateUserTotpSecret200Response.qrCode); + } + + @Override + public int hashCode() { + return Objects.hash(configName, issuer, secret, Arrays.hashCode(qrCode)); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateUserTotpSecret200Response {\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" qrCode: ").append(toIndentedString(qrCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Group.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Group.java new file mode 100644 index 00000000..b0d84f6b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Group.java @@ -0,0 +1,381 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.GroupUserSettings; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.VirtualFolder; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Group + */ +@JsonPropertyOrder({ + Group.JSON_PROPERTY_ID, + Group.JSON_PROPERTY_NAME, + Group.JSON_PROPERTY_DESCRIPTION, + Group.JSON_PROPERTY_CREATED_AT, + Group.JSON_PROPERTY_UPDATED_AT, + Group.JSON_PROPERTY_USER_SETTINGS, + Group.JSON_PROPERTY_VIRTUAL_FOLDERS, + Group.JSON_PROPERTY_USERS, + Group.JSON_PROPERTY_ADMINS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Group { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_USER_SETTINGS = "user_settings"; + private GroupUserSettings userSettings; + + public static final String JSON_PROPERTY_VIRTUAL_FOLDERS = "virtual_folders"; + private List virtualFolders = new ArrayList<>(); + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_ADMINS = "admins"; + private List admins = new ArrayList<>(); + + public Group() { + } + + public Group id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public Group name(String name) { + + this.name = name; + return this; + } + + /** + * name is unique + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public Group description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public Group createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public Group updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in milliseconds + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public Group userSettings(GroupUserSettings userSettings) { + + this.userSettings = userSettings; + return this; + } + + /** + * Get userSettings + * @return userSettings + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GroupUserSettings getUserSettings() { + return userSettings; + } + + + @JsonProperty(JSON_PROPERTY_USER_SETTINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserSettings(GroupUserSettings userSettings) { + this.userSettings = userSettings; + } + + public Group virtualFolders(List virtualFolders) { + + this.virtualFolders = virtualFolders; + return this; + } + + public Group addVirtualFoldersItem(VirtualFolder virtualFoldersItem) { + if (this.virtualFolders == null) { + this.virtualFolders = new ArrayList<>(); + } + this.virtualFolders.add(virtualFoldersItem); + return this; + } + + /** + * mapping between virtual SFTPGo paths and folders + * @return virtualFolders + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIRTUAL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getVirtualFolders() { + return virtualFolders; + } + + + @JsonProperty(JSON_PROPERTY_VIRTUAL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualFolders(List virtualFolders) { + this.virtualFolders = virtualFolders; + } + + public Group users(List users) { + + this.users = users; + return this; + } + + public Group addUsersItem(String usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * list of usernames associated with this group + * @return users + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + public Group admins(List admins) { + + this.admins = admins; + return this; + } + + public Group addAdminsItem(String adminsItem) { + if (this.admins == null) { + this.admins = new ArrayList<>(); + } + this.admins.add(adminsItem); + return this; + } + + /** + * list of admins usernames associated with this group + * @return admins + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAdmins() { + return admins; + } + + + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdmins(List admins) { + this.admins = admins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Group group = (Group) o; + return Objects.equals(this.id, group.id) && + Objects.equals(this.name, group.name) && + Objects.equals(this.description, group.description) && + Objects.equals(this.createdAt, group.createdAt) && + Objects.equals(this.updatedAt, group.updatedAt) && + Objects.equals(this.userSettings, group.userSettings) && + Objects.equals(this.virtualFolders, group.virtualFolders) && + Objects.equals(this.users, group.users) && + Objects.equals(this.admins, group.admins); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, createdAt, updatedAt, userSettings, virtualFolders, users, admins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Group {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" userSettings: ").append(toIndentedString(userSettings)).append("\n"); + sb.append(" virtualFolders: ").append(toIndentedString(virtualFolders)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" admins: ").append(toIndentedString(admins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupMapping.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupMapping.java new file mode 100644 index 00000000..76479a4b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupMapping.java @@ -0,0 +1,172 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * GroupMapping + */ +@JsonPropertyOrder({ + GroupMapping.JSON_PROPERTY_NAME, + GroupMapping.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GroupMapping { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** + * Group type: * `1` - Primary group * `2` - Secondary group * `3` - Membership only, no settings are inherited from this group type + */ + public enum TypeEnum { + NUMBER_1(new BigDecimal("1")), + + NUMBER_2(new BigDecimal("2")), + + NUMBER_3(new BigDecimal("3")); + + private BigDecimal value; + + TypeEnum(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(BigDecimal value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public GroupMapping() { + } + + public GroupMapping name(String name) { + + this.name = name; + return this; + } + + /** + * group name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public GroupMapping type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Group type: * `1` - Primary group * `2` - Secondary group * `3` - Membership only, no settings are inherited from this group type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupMapping groupMapping = (GroupMapping) o; + return Objects.equals(this.name, groupMapping.name) && + Objects.equals(this.type, groupMapping.type); + } + + @Override + public int hashCode() { + return Objects.hash(name, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupMapping {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupUserSettings.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupUserSettings.java new file mode 100644 index 00000000..5690afbb --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/GroupUserSettings.java @@ -0,0 +1,489 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BaseUserFilters; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FilesystemConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Permission; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * GroupUserSettings + */ +@JsonPropertyOrder({ + GroupUserSettings.JSON_PROPERTY_HOME_DIR, + GroupUserSettings.JSON_PROPERTY_MAX_SESSIONS, + GroupUserSettings.JSON_PROPERTY_QUOTA_SIZE, + GroupUserSettings.JSON_PROPERTY_QUOTA_FILES, + GroupUserSettings.JSON_PROPERTY_PERMISSIONS, + GroupUserSettings.JSON_PROPERTY_UPLOAD_BANDWIDTH, + GroupUserSettings.JSON_PROPERTY_DOWNLOAD_BANDWIDTH, + GroupUserSettings.JSON_PROPERTY_UPLOAD_DATA_TRANSFER, + GroupUserSettings.JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER, + GroupUserSettings.JSON_PROPERTY_TOTAL_DATA_TRANSFER, + GroupUserSettings.JSON_PROPERTY_EXPIRES_IN, + GroupUserSettings.JSON_PROPERTY_FILTERS, + GroupUserSettings.JSON_PROPERTY_FILESYSTEM +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class GroupUserSettings { + public static final String JSON_PROPERTY_HOME_DIR = "home_dir"; + private String homeDir; + + public static final String JSON_PROPERTY_MAX_SESSIONS = "max_sessions"; + private Integer maxSessions; + + public static final String JSON_PROPERTY_QUOTA_SIZE = "quota_size"; + private Long quotaSize; + + public static final String JSON_PROPERTY_QUOTA_FILES = "quota_files"; + private Integer quotaFiles; + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private Map> permissions = new HashMap<>(); + + public static final String JSON_PROPERTY_UPLOAD_BANDWIDTH = "upload_bandwidth"; + private Integer uploadBandwidth; + + public static final String JSON_PROPERTY_DOWNLOAD_BANDWIDTH = "download_bandwidth"; + private Integer downloadBandwidth; + + public static final String JSON_PROPERTY_UPLOAD_DATA_TRANSFER = "upload_data_transfer"; + private Integer uploadDataTransfer; + + public static final String JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER = "download_data_transfer"; + private Integer downloadDataTransfer; + + public static final String JSON_PROPERTY_TOTAL_DATA_TRANSFER = "total_data_transfer"; + private Integer totalDataTransfer; + + public static final String JSON_PROPERTY_EXPIRES_IN = "expires_in"; + private Integer expiresIn; + + public static final String JSON_PROPERTY_FILTERS = "filters"; + private BaseUserFilters filters; + + public static final String JSON_PROPERTY_FILESYSTEM = "filesystem"; + private FilesystemConfig filesystem; + + public GroupUserSettings() { + } + + public GroupUserSettings homeDir(String homeDir) { + + this.homeDir = homeDir; + return this; + } + + /** + * Get homeDir + * @return homeDir + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOME_DIR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHomeDir() { + return homeDir; + } + + + @JsonProperty(JSON_PROPERTY_HOME_DIR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHomeDir(String homeDir) { + this.homeDir = homeDir; + } + + public GroupUserSettings maxSessions(Integer maxSessions) { + + this.maxSessions = maxSessions; + return this; + } + + /** + * Get maxSessions + * @return maxSessions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxSessions() { + return maxSessions; + } + + + @JsonProperty(JSON_PROPERTY_MAX_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxSessions(Integer maxSessions) { + this.maxSessions = maxSessions; + } + + public GroupUserSettings quotaSize(Long quotaSize) { + + this.quotaSize = quotaSize; + return this; + } + + /** + * Get quotaSize + * @return quotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuotaSize() { + return quotaSize; + } + + + @JsonProperty(JSON_PROPERTY_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotaSize(Long quotaSize) { + this.quotaSize = quotaSize; + } + + public GroupUserSettings quotaFiles(Integer quotaFiles) { + + this.quotaFiles = quotaFiles; + return this; + } + + /** + * Get quotaFiles + * @return quotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuotaFiles() { + return quotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotaFiles(Integer quotaFiles) { + this.quotaFiles = quotaFiles; + } + + public GroupUserSettings permissions(Map> permissions) { + + this.permissions = permissions; + return this; + } + + public GroupUserSettings putPermissionsItem(String key, List permissionsItem) { + if (this.permissions == null) { + this.permissions = new HashMap<>(); + } + this.permissions.put(key, permissionsItem); + return this; + } + + /** + * hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory (\"/\") are required + * @return permissions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getPermissions() { + return permissions; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPermissions(Map> permissions) { + this.permissions = permissions; + } + + public GroupUserSettings uploadBandwidth(Integer uploadBandwidth) { + + this.uploadBandwidth = uploadBandwidth; + return this; + } + + /** + * Maximum upload bandwidth as KB/s + * @return uploadBandwidth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadBandwidth() { + return uploadBandwidth; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadBandwidth(Integer uploadBandwidth) { + this.uploadBandwidth = uploadBandwidth; + } + + public GroupUserSettings downloadBandwidth(Integer downloadBandwidth) { + + this.downloadBandwidth = downloadBandwidth; + return this; + } + + /** + * Maximum download bandwidth as KB/s + * @return downloadBandwidth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadBandwidth() { + return downloadBandwidth; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadBandwidth(Integer downloadBandwidth) { + this.downloadBandwidth = downloadBandwidth; + } + + public GroupUserSettings uploadDataTransfer(Integer uploadDataTransfer) { + + this.uploadDataTransfer = uploadDataTransfer; + return this; + } + + /** + * Maximum data transfer allowed for uploads as MB + * @return uploadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadDataTransfer() { + return uploadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadDataTransfer(Integer uploadDataTransfer) { + this.uploadDataTransfer = uploadDataTransfer; + } + + public GroupUserSettings downloadDataTransfer(Integer downloadDataTransfer) { + + this.downloadDataTransfer = downloadDataTransfer; + return this; + } + + /** + * Maximum data transfer allowed for downloads as MB + * @return downloadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadDataTransfer() { + return downloadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadDataTransfer(Integer downloadDataTransfer) { + this.downloadDataTransfer = downloadDataTransfer; + } + + public GroupUserSettings totalDataTransfer(Integer totalDataTransfer) { + + this.totalDataTransfer = totalDataTransfer; + return this; + } + + /** + * Maximum total data transfer as MB + * @return totalDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTotalDataTransfer() { + return totalDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalDataTransfer(Integer totalDataTransfer) { + this.totalDataTransfer = totalDataTransfer; + } + + public GroupUserSettings expiresIn(Integer expiresIn) { + + this.expiresIn = expiresIn; + return this; + } + + /** + * Account expiration in number of days from creation. 0 means no expiration + * @return expiresIn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExpiresIn() { + return expiresIn; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_IN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + } + + public GroupUserSettings filters(BaseUserFilters filters) { + + this.filters = filters; + return this; + } + + /** + * Get filters + * @return filters + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BaseUserFilters getFilters() { + return filters; + } + + + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilters(BaseUserFilters filters) { + this.filters = filters; + } + + public GroupUserSettings filesystem(FilesystemConfig filesystem) { + + this.filesystem = filesystem; + return this; + } + + /** + * Get filesystem + * @return filesystem + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FilesystemConfig getFilesystem() { + return filesystem; + } + + + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesystem(FilesystemConfig filesystem) { + this.filesystem = filesystem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GroupUserSettings groupUserSettings = (GroupUserSettings) o; + return Objects.equals(this.homeDir, groupUserSettings.homeDir) && + Objects.equals(this.maxSessions, groupUserSettings.maxSessions) && + Objects.equals(this.quotaSize, groupUserSettings.quotaSize) && + Objects.equals(this.quotaFiles, groupUserSettings.quotaFiles) && + Objects.equals(this.permissions, groupUserSettings.permissions) && + Objects.equals(this.uploadBandwidth, groupUserSettings.uploadBandwidth) && + Objects.equals(this.downloadBandwidth, groupUserSettings.downloadBandwidth) && + Objects.equals(this.uploadDataTransfer, groupUserSettings.uploadDataTransfer) && + Objects.equals(this.downloadDataTransfer, groupUserSettings.downloadDataTransfer) && + Objects.equals(this.totalDataTransfer, groupUserSettings.totalDataTransfer) && + Objects.equals(this.expiresIn, groupUserSettings.expiresIn) && + Objects.equals(this.filters, groupUserSettings.filters) && + Objects.equals(this.filesystem, groupUserSettings.filesystem); + } + + @Override + public int hashCode() { + return Objects.hash(homeDir, maxSessions, quotaSize, quotaFiles, permissions, uploadBandwidth, downloadBandwidth, uploadDataTransfer, downloadDataTransfer, totalDataTransfer, expiresIn, filters, filesystem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GroupUserSettings {\n"); + sb.append(" homeDir: ").append(toIndentedString(homeDir)).append("\n"); + sb.append(" maxSessions: ").append(toIndentedString(maxSessions)).append("\n"); + sb.append(" quotaSize: ").append(toIndentedString(quotaSize)).append("\n"); + sb.append(" quotaFiles: ").append(toIndentedString(quotaFiles)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" uploadBandwidth: ").append(toIndentedString(uploadBandwidth)).append("\n"); + sb.append(" downloadBandwidth: ").append(toIndentedString(downloadBandwidth)).append("\n"); + sb.append(" uploadDataTransfer: ").append(toIndentedString(uploadDataTransfer)).append("\n"); + sb.append(" downloadDataTransfer: ").append(toIndentedString(downloadDataTransfer)).append("\n"); + sb.append(" totalDataTransfer: ").append(toIndentedString(totalDataTransfer)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" filesystem: ").append(toIndentedString(filesystem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPFsConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPFsConfig.java new file mode 100644 index 00000000..746c15c9 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPFsConfig.java @@ -0,0 +1,294 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * HTTPFsConfig + */ +@JsonPropertyOrder({ + HTTPFsConfig.JSON_PROPERTY_ENDPOINT, + HTTPFsConfig.JSON_PROPERTY_USERNAME, + HTTPFsConfig.JSON_PROPERTY_PASSWORD, + HTTPFsConfig.JSON_PROPERTY_API_KEY, + HTTPFsConfig.JSON_PROPERTY_SKIP_TLS_VERIFY, + HTTPFsConfig.JSON_PROPERTY_EQUALITY_CHECK_MODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class HTTPFsConfig { + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private Secret password; + + public static final String JSON_PROPERTY_API_KEY = "api_key"; + private Secret apiKey; + + public static final String JSON_PROPERTY_SKIP_TLS_VERIFY = "skip_tls_verify"; + private Boolean skipTlsVerify; + + /** + * Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed: * `0` username and endpoint must match. This is the default * `1` only the endpoint must match + */ + public enum EqualityCheckModeEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + EqualityCheckModeEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EqualityCheckModeEnum fromValue(Integer value) { + for (EqualityCheckModeEnum b : EqualityCheckModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EQUALITY_CHECK_MODE = "equality_check_mode"; + private EqualityCheckModeEnum equalityCheckMode; + + public HTTPFsConfig() { + } + + public HTTPFsConfig endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * HTTP/S endpoint URL. SFTPGo will use this URL as base, for example for the `stat` API, SFTPGo will add `/stat/{name}` + * @return endpoint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public HTTPFsConfig username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public HTTPFsConfig password(Secret password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(Secret password) { + this.password = password; + } + + public HTTPFsConfig apiKey(Secret apiKey) { + + this.apiKey = apiKey; + return this; + } + + /** + * Get apiKey + * @return apiKey + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_API_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getApiKey() { + return apiKey; + } + + + @JsonProperty(JSON_PROPERTY_API_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApiKey(Secret apiKey) { + this.apiKey = apiKey; + } + + public HTTPFsConfig skipTlsVerify(Boolean skipTlsVerify) { + + this.skipTlsVerify = skipTlsVerify; + return this; + } + + /** + * Get skipTlsVerify + * @return skipTlsVerify + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SKIP_TLS_VERIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSkipTlsVerify() { + return skipTlsVerify; + } + + + @JsonProperty(JSON_PROPERTY_SKIP_TLS_VERIFY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSkipTlsVerify(Boolean skipTlsVerify) { + this.skipTlsVerify = skipTlsVerify; + } + + public HTTPFsConfig equalityCheckMode(EqualityCheckModeEnum equalityCheckMode) { + + this.equalityCheckMode = equalityCheckMode; + return this; + } + + /** + * Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed: * `0` username and endpoint must match. This is the default * `1` only the endpoint must match + * @return equalityCheckMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EQUALITY_CHECK_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EqualityCheckModeEnum getEqualityCheckMode() { + return equalityCheckMode; + } + + + @JsonProperty(JSON_PROPERTY_EQUALITY_CHECK_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEqualityCheckMode(EqualityCheckModeEnum equalityCheckMode) { + this.equalityCheckMode = equalityCheckMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HTTPFsConfig htTPFsConfig = (HTTPFsConfig) o; + return Objects.equals(this.endpoint, htTPFsConfig.endpoint) && + Objects.equals(this.username, htTPFsConfig.username) && + Objects.equals(this.password, htTPFsConfig.password) && + Objects.equals(this.apiKey, htTPFsConfig.apiKey) && + Objects.equals(this.skipTlsVerify, htTPFsConfig.skipTlsVerify) && + Objects.equals(this.equalityCheckMode, htTPFsConfig.equalityCheckMode); + } + + @Override + public int hashCode() { + return Objects.hash(endpoint, username, password, apiKey, skipTlsVerify, equalityCheckMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HTTPFsConfig {\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n"); + sb.append(" skipTlsVerify: ").append(toIndentedString(skipTlsVerify)).append("\n"); + sb.append(" equalityCheckMode: ").append(toIndentedString(equalityCheckMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPPart.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPPart.java new file mode 100644 index 00000000..960874f7 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HTTPPart.java @@ -0,0 +1,208 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.KeyValue; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * HTTPPart + */ +@JsonPropertyOrder({ + HTTPPart.JSON_PROPERTY_NAME, + HTTPPart.JSON_PROPERTY_HEADERS, + HTTPPart.JSON_PROPERTY_FILEPATH, + HTTPPart.JSON_PROPERTY_BODY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class HTTPPart { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private List headers = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILEPATH = "filepath"; + private String filepath; + + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + public HTTPPart() { + } + + public HTTPPart name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public HTTPPart headers(List headers) { + + this.headers = headers; + return this; + } + + public HTTPPart addHeadersItem(KeyValue headersItem) { + if (this.headers == null) { + this.headers = new ArrayList<>(); + } + this.headers.add(headersItem); + return this; + } + + /** + * Additional headers. Content-Disposition header is automatically set. Content-Type header is automatically detect for files to attach + * @return headers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getHeaders() { + return headers; + } + + + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(List headers) { + this.headers = headers; + } + + public HTTPPart filepath(String filepath) { + + this.filepath = filepath; + return this; + } + + /** + * path to the file to be sent as an attachment + * @return filepath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILEPATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFilepath() { + return filepath; + } + + + @JsonProperty(JSON_PROPERTY_FILEPATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilepath(String filepath) { + this.filepath = filepath; + } + + public HTTPPart body(String body) { + + this.body = body; + return this; + } + + /** + * Get body + * @return body + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBody() { + return body; + } + + + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(String body) { + this.body = body; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HTTPPart htTPPart = (HTTPPart) o; + return Objects.equals(this.name, htTPPart.name) && + Objects.equals(this.headers, htTPPart.headers) && + Objects.equals(this.filepath, htTPPart.filepath) && + Objects.equals(this.body, htTPPart.body); + } + + @Override + public int hashCode() { + return Objects.hash(name, headers, filepath, body); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HTTPPart {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" filepath: ").append(toIndentedString(filepath)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HooksFilter.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HooksFilter.java new file mode 100644 index 00000000..fd44b4e5 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/HooksFilter.java @@ -0,0 +1,165 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * User specific hook overrides + */ +@JsonPropertyOrder({ + HooksFilter.JSON_PROPERTY_EXTERNAL_AUTH_DISABLED, + HooksFilter.JSON_PROPERTY_PRE_LOGIN_DISABLED, + HooksFilter.JSON_PROPERTY_CHECK_PASSWORD_DISABLED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class HooksFilter { + public static final String JSON_PROPERTY_EXTERNAL_AUTH_DISABLED = "external_auth_disabled"; + private Boolean externalAuthDisabled; + + public static final String JSON_PROPERTY_PRE_LOGIN_DISABLED = "pre_login_disabled"; + private Boolean preLoginDisabled; + + public static final String JSON_PROPERTY_CHECK_PASSWORD_DISABLED = "check_password_disabled"; + private Boolean checkPasswordDisabled; + + public HooksFilter() { + } + + public HooksFilter externalAuthDisabled(Boolean externalAuthDisabled) { + + this.externalAuthDisabled = externalAuthDisabled; + return this; + } + + /** + * If true, the external auth hook, if defined, will not be executed + * @return externalAuthDisabled + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_AUTH_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getExternalAuthDisabled() { + return externalAuthDisabled; + } + + + @JsonProperty(JSON_PROPERTY_EXTERNAL_AUTH_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalAuthDisabled(Boolean externalAuthDisabled) { + this.externalAuthDisabled = externalAuthDisabled; + } + + public HooksFilter preLoginDisabled(Boolean preLoginDisabled) { + + this.preLoginDisabled = preLoginDisabled; + return this; + } + + /** + * If true, the pre-login hook, if defined, will not be executed + * @return preLoginDisabled + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRE_LOGIN_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPreLoginDisabled() { + return preLoginDisabled; + } + + + @JsonProperty(JSON_PROPERTY_PRE_LOGIN_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPreLoginDisabled(Boolean preLoginDisabled) { + this.preLoginDisabled = preLoginDisabled; + } + + public HooksFilter checkPasswordDisabled(Boolean checkPasswordDisabled) { + + this.checkPasswordDisabled = checkPasswordDisabled; + return this; + } + + /** + * If true, the check password hook, if defined, will not be executed + * @return checkPasswordDisabled + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHECK_PASSWORD_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCheckPasswordDisabled() { + return checkPasswordDisabled; + } + + + @JsonProperty(JSON_PROPERTY_CHECK_PASSWORD_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCheckPasswordDisabled(Boolean checkPasswordDisabled) { + this.checkPasswordDisabled = checkPasswordDisabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HooksFilter hooksFilter = (HooksFilter) o; + return Objects.equals(this.externalAuthDisabled, hooksFilter.externalAuthDisabled) && + Objects.equals(this.preLoginDisabled, hooksFilter.preLoginDisabled) && + Objects.equals(this.checkPasswordDisabled, hooksFilter.checkPasswordDisabled); + } + + @Override + public int hashCode() { + return Objects.hash(externalAuthDisabled, preLoginDisabled, checkPasswordDisabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HooksFilter {\n"); + sb.append(" externalAuthDisabled: ").append(toIndentedString(externalAuthDisabled)).append("\n"); + sb.append(" preLoginDisabled: ").append(toIndentedString(preLoginDisabled)).append("\n"); + sb.append(" checkPasswordDisabled: ").append(toIndentedString(checkPasswordDisabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListEntry.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListEntry.java new file mode 100644 index 00000000..95edf49a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListEntry.java @@ -0,0 +1,291 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.IPListMode; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.IPListType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * IPListEntry + */ +@JsonPropertyOrder({ + IPListEntry.JSON_PROPERTY_IPORNET, + IPListEntry.JSON_PROPERTY_DESCRIPTION, + IPListEntry.JSON_PROPERTY_TYPE, + IPListEntry.JSON_PROPERTY_MODE, + IPListEntry.JSON_PROPERTY_PROTOCOLS, + IPListEntry.JSON_PROPERTY_CREATED_AT, + IPListEntry.JSON_PROPERTY_UPDATED_AT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class IPListEntry { + public static final String JSON_PROPERTY_IPORNET = "ipornet"; + private String ipornet; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IPListType type; + + public static final String JSON_PROPERTY_MODE = "mode"; + private IPListMode mode; + + public static final String JSON_PROPERTY_PROTOCOLS = "protocols"; + private Integer protocols; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public IPListEntry() { + } + + public IPListEntry ipornet(String ipornet) { + + this.ipornet = ipornet; + return this; + } + + /** + * IP address or network in CIDR format, for example `192.168.1.2/32`, `192.168.0.0/24`, `2001:db8::/32` + * @return ipornet + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IPORNET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIpornet() { + return ipornet; + } + + + @JsonProperty(JSON_PROPERTY_IPORNET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIpornet(String ipornet) { + this.ipornet = ipornet; + } + + public IPListEntry description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public IPListEntry type(IPListType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public IPListType getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(IPListType type) { + this.type = type; + } + + public IPListEntry mode(IPListMode mode) { + + this.mode = mode; + return this; + } + + /** + * Get mode + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public IPListMode getMode() { + return mode; + } + + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(IPListMode mode) { + this.mode = mode; + } + + public IPListEntry protocols(Integer protocols) { + + this.protocols = protocols; + return this; + } + + /** + * Defines the protocol the entry applies to. `0` means all the supported protocols, 1 SSH, 2 FTP, 4 WebDAV, 8 HTTP. Protocols can be combined, for example 3 means SSH and FTP + * @return protocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getProtocols() { + return protocols; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocols(Integer protocols) { + this.protocols = protocols; + } + + public IPListEntry createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public IPListEntry updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in millisecond + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IPListEntry ipListEntry = (IPListEntry) o; + return Objects.equals(this.ipornet, ipListEntry.ipornet) && + Objects.equals(this.description, ipListEntry.description) && + Objects.equals(this.type, ipListEntry.type) && + Objects.equals(this.mode, ipListEntry.mode) && + Objects.equals(this.protocols, ipListEntry.protocols) && + Objects.equals(this.createdAt, ipListEntry.createdAt) && + Objects.equals(this.updatedAt, ipListEntry.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(ipornet, description, type, mode, protocols, createdAt, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IPListEntry {\n"); + sb.append(" ipornet: ").append(toIndentedString(ipornet)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" protocols: ").append(toIndentedString(protocols)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListMode.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListMode.java new file mode 100644 index 00000000..143a50a6 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListMode.java @@ -0,0 +1,59 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * IP list modes * `1` - allow * `2` - deny, supported for defender list type only + */ +public enum IPListMode { + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + IPListMode(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IPListMode fromValue(Integer value) { + for (IPListMode b : IPListMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListType.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListType.java new file mode 100644 index 00000000..47c5218f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/IPListType.java @@ -0,0 +1,61 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * IP List types: * `1` - allow list * `2` - defender * `3` - rate limiter safe list + */ +public enum IPListType { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3); + + private Integer value; + + IPListType(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IPListType fromValue(Integer value) { + for (IPListType b : IPListType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/KeyValue.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/KeyValue.java new file mode 100644 index 00000000..983b73ab --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/KeyValue.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * KeyValue + */ +@JsonPropertyOrder({ + KeyValue.JSON_PROPERTY_KEY, + KeyValue.JSON_PROPERTY_VALUE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class KeyValue { + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public KeyValue() { + } + + public KeyValue key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(String key) { + this.key = key; + } + + public KeyValue value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeyValue keyValue = (KeyValue) o; + return Objects.equals(this.key, keyValue.key) && + Objects.equals(this.value, keyValue.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class KeyValue {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEvent.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEvent.java new file mode 100644 index 00000000..fe346821 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEvent.java @@ -0,0 +1,353 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.EventProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.LogEventType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * LogEvent + */ +@JsonPropertyOrder({ + LogEvent.JSON_PROPERTY_ID, + LogEvent.JSON_PROPERTY_TIMESTAMP, + LogEvent.JSON_PROPERTY_EVENT, + LogEvent.JSON_PROPERTY_PROTOCOL, + LogEvent.JSON_PROPERTY_USERNAME, + LogEvent.JSON_PROPERTY_IP, + LogEvent.JSON_PROPERTY_MESSAGE, + LogEvent.JSON_PROPERTY_ROLE, + LogEvent.JSON_PROPERTY_INSTANCE_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class LogEvent { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private Long timestamp; + + public static final String JSON_PROPERTY_EVENT = "event"; + private LogEventType event; + + public static final String JSON_PROPERTY_PROTOCOL = "protocol"; + private EventProtocols protocol; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private String instanceId; + + public LogEvent() { + } + + public LogEvent id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + public LogEvent timestamp(Long timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * unix timestamp in nanoseconds + * @return timestamp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTimestamp() { + return timestamp; + } + + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + public LogEvent event(LogEventType event) { + + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogEventType getEvent() { + return event; + } + + + @JsonProperty(JSON_PROPERTY_EVENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEvent(LogEventType event) { + this.event = event; + } + + public LogEvent protocol(EventProtocols protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * @return protocol + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EventProtocols getProtocol() { + return protocol; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocol(EventProtocols protocol) { + this.protocol = protocol; + } + + public LogEvent username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public LogEvent ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Get ip + * @return ip + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + public LogEvent message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public LogEvent role(String role) { + + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; + } + + public LogEvent instanceId(String instanceId) { + + this.instanceId = instanceId; + return this; + } + + /** + * Get instanceId + * @return instanceId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInstanceId() { + return instanceId; + } + + + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogEvent logEvent = (LogEvent) o; + return Objects.equals(this.id, logEvent.id) && + Objects.equals(this.timestamp, logEvent.timestamp) && + Objects.equals(this.event, logEvent.event) && + Objects.equals(this.protocol, logEvent.protocol) && + Objects.equals(this.username, logEvent.username) && + Objects.equals(this.ip, logEvent.ip) && + Objects.equals(this.message, logEvent.message) && + Objects.equals(this.role, logEvent.role) && + Objects.equals(this.instanceId, logEvent.instanceId); + } + + @Override + public int hashCode() { + return Objects.hash(id, timestamp, event, protocol, username, ip, message, role, instanceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogEvent {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEventType.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEventType.java new file mode 100644 index 00000000..ef3aad04 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LogEventType.java @@ -0,0 +1,65 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Event status: * `1` - Login failed * `2` - Login failed non-existent user * `3` - No login tried * `4` - Algorithm negotiation failed * `5` - Login succeeded + */ +public enum LogEventType { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5); + + private Integer value; + + LogEventType(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogEventType fromValue(Integer value) { + for (LogEventType b : LogEventType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LoginMethods.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LoginMethods.java new file mode 100644 index 00000000..bff765aa --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/LoginMethods.java @@ -0,0 +1,71 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Available login methods. To enable multi-step authentication you have to allow only multi-step login methods * `publickey` * `password`, password for all the supported protocols * `password-over-SSH`, password over SSH protocol (SSH/SFTP/SCP) * `keyboard-interactive` * `publickey+password` - multi-step auth: public key and password * `publickey+keyboard-interactive` - multi-step auth: public key and keyboard interactive * `TLSCertificate` * `TLSCertificate+password` - multi-step auth: TLS client certificate and password + */ +public enum LoginMethods { + + PUBLICKEY("publickey"), + + PASSWORD("password"), + + PASSWORD_OVER_SSH("password-over-SSH"), + + KEYBOARD_INTERACTIVE("keyboard-interactive"), + + PUBLICKEY_PASSWORD("publickey+password"), + + PUBLICKEY_KEYBOARD_INTERACTIVE("publickey+keyboard-interactive"), + + TLS_CERTIFICATE("TLSCertificate"), + + TLS_CERTIFICATE_PASSWORD("TLSCertificate+password"); + + private String value; + + LoginMethods(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LoginMethods fromValue(String value) { + for (LoginMethods b : LoginMethods.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAProtocols.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAProtocols.java new file mode 100644 index 00000000..572af520 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAProtocols.java @@ -0,0 +1,61 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Protocols: * `SSH` - includes both SFTP and SSH commands * `FTP` - plain FTP and FTPES/FTPS * `HTTP` - WebClient/REST API + */ +public enum MFAProtocols { + + SSH("SSH"), + + FTP("FTP"), + + HTTP("HTTP"); + + private String value; + + MFAProtocols(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MFAProtocols fromValue(String value) { + for (MFAProtocols b : MFAProtocols.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAStatus.java new file mode 100644 index 00000000..e7adb522 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/MFAStatus.java @@ -0,0 +1,146 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TOTPConfig; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * MFAStatus + */ +@JsonPropertyOrder({ + MFAStatus.JSON_PROPERTY_IS_ACTIVE, + MFAStatus.JSON_PROPERTY_TOTP_CONFIGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class MFAStatus { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + private Boolean isActive; + + public static final String JSON_PROPERTY_TOTP_CONFIGS = "totp_configs"; + private List totpConfigs = new ArrayList<>(); + + public MFAStatus() { + } + + public MFAStatus isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public MFAStatus totpConfigs(List totpConfigs) { + + this.totpConfigs = totpConfigs; + return this; + } + + public MFAStatus addTotpConfigsItem(TOTPConfig totpConfigsItem) { + if (this.totpConfigs == null) { + this.totpConfigs = new ArrayList<>(); + } + this.totpConfigs.add(totpConfigsItem); + return this; + } + + /** + * Get totpConfigs + * @return totpConfigs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTP_CONFIGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTotpConfigs() { + return totpConfigs; + } + + + @JsonProperty(JSON_PROPERTY_TOTP_CONFIGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotpConfigs(List totpConfigs) { + this.totpConfigs = totpConfigs; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MFAStatus mfAStatus = (MFAStatus) o; + return Objects.equals(this.isActive, mfAStatus.isActive) && + Objects.equals(this.totpConfigs, mfAStatus.totpConfigs); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, totpConfigs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MFAStatus {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" totpConfigs: ").append(toIndentedString(totpConfigs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ModelApiResponse.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ModelApiResponse.java new file mode 100644 index 00000000..20711e17 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ModelApiResponse.java @@ -0,0 +1,135 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelApiResponse + */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_MESSAGE, + ModelApiResponse.JSON_PROPERTY_ERROR +}) +@JsonTypeName("ApiResponse") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ModelApiResponse { + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public ModelApiResponse() { + } + + public ModelApiResponse message(String message) { + + this.message = message; + return this; + } + + /** + * message, can be empty + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse error(String error) { + + this.error = error; + return this; + } + + /** + * error description if any + * @return error + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(String error) { + this.error = error; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.message, _apiResponse.message) && + Objects.equals(this.error, _apiResponse.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/OSFsConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/OSFsConfig.java new file mode 100644 index 00000000..37e23bc6 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/OSFsConfig.java @@ -0,0 +1,138 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * OSFsConfig + */ +@JsonPropertyOrder({ + OSFsConfig.JSON_PROPERTY_READ_BUFFER_SIZE, + OSFsConfig.JSON_PROPERTY_WRITE_BUFFER_SIZE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class OSFsConfig { + public static final String JSON_PROPERTY_READ_BUFFER_SIZE = "read_buffer_size"; + private Integer readBufferSize; + + public static final String JSON_PROPERTY_WRITE_BUFFER_SIZE = "write_buffer_size"; + private Integer writeBufferSize; + + public OSFsConfig() { + } + + public OSFsConfig readBufferSize(Integer readBufferSize) { + + this.readBufferSize = readBufferSize; + return this; + } + + /** + * The read buffer size, as MB, to use for downloads. 0 means no buffering, that's fine in most use cases. + * minimum: 0 + * maximum: 10 + * @return readBufferSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_READ_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getReadBufferSize() { + return readBufferSize; + } + + + @JsonProperty(JSON_PROPERTY_READ_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReadBufferSize(Integer readBufferSize) { + this.readBufferSize = readBufferSize; + } + + public OSFsConfig writeBufferSize(Integer writeBufferSize) { + + this.writeBufferSize = writeBufferSize; + return this; + } + + /** + * The write buffer size, as MB, to use for uploads. 0 means no buffering, that's fine in most use cases. + * minimum: 0 + * maximum: 10 + * @return writeBufferSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WRITE_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getWriteBufferSize() { + return writeBufferSize; + } + + + @JsonProperty(JSON_PROPERTY_WRITE_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWriteBufferSize(Integer writeBufferSize) { + this.writeBufferSize = writeBufferSize; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OSFsConfig osFsConfig = (OSFsConfig) o; + return Objects.equals(this.readBufferSize, osFsConfig.readBufferSize) && + Objects.equals(this.writeBufferSize, osFsConfig.writeBufferSize); + } + + @Override + public int hashCode() { + return Objects.hash(readBufferSize, writeBufferSize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OSFsConfig {\n"); + sb.append(" readBufferSize: ").append(toIndentedString(readBufferSize)).append("\n"); + sb.append(" writeBufferSize: ").append(toIndentedString(writeBufferSize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PassiveIPOverride.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PassiveIPOverride.java new file mode 100644 index 00000000..8796fe87 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PassiveIPOverride.java @@ -0,0 +1,145 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * PassiveIPOverride + */ +@JsonPropertyOrder({ + PassiveIPOverride.JSON_PROPERTY_NETWORKS, + PassiveIPOverride.JSON_PROPERTY_IP +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class PassiveIPOverride { + public static final String JSON_PROPERTY_NETWORKS = "networks"; + private List networks = new ArrayList<>(); + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public PassiveIPOverride() { + } + + public PassiveIPOverride networks(List networks) { + + this.networks = networks; + return this; + } + + public PassiveIPOverride addNetworksItem(String networksItem) { + if (this.networks == null) { + this.networks = new ArrayList<>(); + } + this.networks.add(networksItem); + return this; + } + + /** + * Get networks + * @return networks + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NETWORKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNetworks() { + return networks; + } + + + @JsonProperty(JSON_PROPERTY_NETWORKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworks(List networks) { + this.networks = networks; + } + + public PassiveIPOverride ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Get ip + * @return ip + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PassiveIPOverride passiveIPOverride = (PassiveIPOverride) o; + return Objects.equals(this.networks, passiveIPOverride.networks) && + Objects.equals(this.ip, passiveIPOverride.ip); + } + + @Override + public int hashCode() { + return Objects.hash(networks, ip); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PassiveIPOverride {\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PatternsFilter.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PatternsFilter.java new file mode 100644 index 00000000..2cac87d2 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PatternsFilter.java @@ -0,0 +1,250 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * PatternsFilter + */ +@JsonPropertyOrder({ + PatternsFilter.JSON_PROPERTY_PATH, + PatternsFilter.JSON_PROPERTY_ALLOWED_PATTERNS, + PatternsFilter.JSON_PROPERTY_DENIED_PATTERNS, + PatternsFilter.JSON_PROPERTY_DENY_POLICY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class PatternsFilter { + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_ALLOWED_PATTERNS = "allowed_patterns"; + private List allowedPatterns = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_PATTERNS = "denied_patterns"; + private List deniedPatterns = new ArrayList<>(); + + /** + * Policies for denied patterns * `0` - default policy. Denied files/directories matching the filters are visible in directory listing but cannot be uploaded/downloaded/overwritten/renamed * `1` - deny policy hide. This policy applies the same restrictions as the default one and denied files/directories matching the filters will also be hidden in directory listing. This mode may cause performance issues for large directories + */ + public enum DenyPolicyEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + DenyPolicyEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DenyPolicyEnum fromValue(Integer value) { + for (DenyPolicyEnum b : DenyPolicyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_DENY_POLICY = "deny_policy"; + private DenyPolicyEnum denyPolicy; + + public PatternsFilter() { + } + + public PatternsFilter path(String path) { + + this.path = path; + return this; + } + + /** + * virtual path as seen by users, if no other specific filter is defined, the filter applies for sub directories too. For example if filters are defined for the paths \"/\" and \"/sub\" then the filters for \"/\" are applied for any file outside the \"/sub\" directory + * @return path + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(String path) { + this.path = path; + } + + public PatternsFilter allowedPatterns(List allowedPatterns) { + + this.allowedPatterns = allowedPatterns; + return this; + } + + public PatternsFilter addAllowedPatternsItem(String allowedPatternsItem) { + if (this.allowedPatterns == null) { + this.allowedPatterns = new ArrayList<>(); + } + this.allowedPatterns.add(allowedPatternsItem); + return this; + } + + /** + * list of, case insensitive, allowed shell like patterns. Allowed patterns are evaluated before the denied ones + * @return allowedPatterns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOWED_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAllowedPatterns() { + return allowedPatterns; + } + + + @JsonProperty(JSON_PROPERTY_ALLOWED_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedPatterns(List allowedPatterns) { + this.allowedPatterns = allowedPatterns; + } + + public PatternsFilter deniedPatterns(List deniedPatterns) { + + this.deniedPatterns = deniedPatterns; + return this; + } + + public PatternsFilter addDeniedPatternsItem(String deniedPatternsItem) { + if (this.deniedPatterns == null) { + this.deniedPatterns = new ArrayList<>(); + } + this.deniedPatterns.add(deniedPatternsItem); + return this; + } + + /** + * list of, case insensitive, denied shell like patterns + * @return deniedPatterns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedPatterns() { + return deniedPatterns; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedPatterns(List deniedPatterns) { + this.deniedPatterns = deniedPatterns; + } + + public PatternsFilter denyPolicy(DenyPolicyEnum denyPolicy) { + + this.denyPolicy = denyPolicy; + return this; + } + + /** + * Policies for denied patterns * `0` - default policy. Denied files/directories matching the filters are visible in directory listing but cannot be uploaded/downloaded/overwritten/renamed * `1` - deny policy hide. This policy applies the same restrictions as the default one and denied files/directories matching the filters will also be hidden in directory listing. This mode may cause performance issues for large directories + * @return denyPolicy + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENY_POLICY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public DenyPolicyEnum getDenyPolicy() { + return denyPolicy; + } + + + @JsonProperty(JSON_PROPERTY_DENY_POLICY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDenyPolicy(DenyPolicyEnum denyPolicy) { + this.denyPolicy = denyPolicy; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatternsFilter patternsFilter = (PatternsFilter) o; + return Objects.equals(this.path, patternsFilter.path) && + Objects.equals(this.allowedPatterns, patternsFilter.allowedPatterns) && + Objects.equals(this.deniedPatterns, patternsFilter.deniedPatterns) && + Objects.equals(this.denyPolicy, patternsFilter.denyPolicy); + } + + @Override + public int hashCode() { + return Objects.hash(path, allowedPatterns, deniedPatterns, denyPolicy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatternsFilter {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" allowedPatterns: ").append(toIndentedString(allowedPatterns)).append("\n"); + sb.append(" deniedPatterns: ").append(toIndentedString(deniedPatterns)).append("\n"); + sb.append(" denyPolicy: ").append(toIndentedString(denyPolicy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Permission.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Permission.java new file mode 100644 index 00000000..aca3167d --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Permission.java @@ -0,0 +1,89 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Permissions: * `*` - all permissions are granted * `list` - list items is allowed * `download` - download files is allowed * `upload` - upload files is allowed * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite * `delete` - delete files or directories is allowed * `delete_files` - delete files is allowed * `delete_dirs` - delete directories is allowed * `rename` - rename files or directories is allowed * `rename_files` - rename files is allowed * `rename_dirs` - rename directories is allowed * `create_dirs` - create directories is allowed * `create_symlinks` - create links is allowed * `chmod` changing file or directory permissions is allowed * `chown` changing file or directory owner and group is allowed * `chtimes` changing file or directory access and modification time is allowed * `copy`, copying files or directories is allowed + */ +public enum Permission { + + STAR("*"), + + LIST("list"), + + DOWNLOAD("download"), + + UPLOAD("upload"), + + OVERWRITE("overwrite"), + + DELETE("delete"), + + DELETE_FILES("delete_files"), + + DELETE_DIRS("delete_dirs"), + + RENAME("rename"), + + RENAME_FILES("rename_files"), + + RENAME_DIRS("rename_dirs"), + + CREATE_DIRS("create_dirs"), + + CREATE_SYMLINKS("create_symlinks"), + + CHMOD("chmod"), + + CHOWN("chown"), + + CHTIMES("chtimes"), + + COPY("copy"); + + private String value; + + Permission(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Permission fromValue(String value) { + for (Permission b : Permission.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEvent.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEvent.java new file mode 100644 index 00000000..388ac18f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEvent.java @@ -0,0 +1,384 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ProviderEventAction; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ProviderEventObjectType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ProviderEvent + */ +@JsonPropertyOrder({ + ProviderEvent.JSON_PROPERTY_ID, + ProviderEvent.JSON_PROPERTY_TIMESTAMP, + ProviderEvent.JSON_PROPERTY_ACTION, + ProviderEvent.JSON_PROPERTY_USERNAME, + ProviderEvent.JSON_PROPERTY_IP, + ProviderEvent.JSON_PROPERTY_OBJECT_TYPE, + ProviderEvent.JSON_PROPERTY_OBJECT_NAME, + ProviderEvent.JSON_PROPERTY_OBJECT_DATA, + ProviderEvent.JSON_PROPERTY_ROLE, + ProviderEvent.JSON_PROPERTY_INSTANCE_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ProviderEvent { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private Long timestamp; + + public static final String JSON_PROPERTY_ACTION = "action"; + private ProviderEventAction action; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_IP = "ip"; + private String ip; + + public static final String JSON_PROPERTY_OBJECT_TYPE = "object_type"; + private ProviderEventObjectType objectType; + + public static final String JSON_PROPERTY_OBJECT_NAME = "object_name"; + private String objectName; + + public static final String JSON_PROPERTY_OBJECT_DATA = "object_data"; + private byte[] objectData; + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public static final String JSON_PROPERTY_INSTANCE_ID = "instance_id"; + private String instanceId; + + public ProviderEvent() { + } + + public ProviderEvent id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + public ProviderEvent timestamp(Long timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * unix timestamp in nanoseconds + * @return timestamp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getTimestamp() { + return timestamp; + } + + + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + public ProviderEvent action(ProviderEventAction action) { + + this.action = action; + return this; + } + + /** + * Get action + * @return action + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ProviderEventAction getAction() { + return action; + } + + + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAction(ProviderEventAction action) { + this.action = action; + } + + public ProviderEvent username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public ProviderEvent ip(String ip) { + + this.ip = ip; + return this; + } + + /** + * Get ip + * @return ip + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIp() { + return ip; + } + + + @JsonProperty(JSON_PROPERTY_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIp(String ip) { + this.ip = ip; + } + + public ProviderEvent objectType(ProviderEventObjectType objectType) { + + this.objectType = objectType; + return this; + } + + /** + * Get objectType + * @return objectType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OBJECT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ProviderEventObjectType getObjectType() { + return objectType; + } + + + @JsonProperty(JSON_PROPERTY_OBJECT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectType(ProviderEventObjectType objectType) { + this.objectType = objectType; + } + + public ProviderEvent objectName(String objectName) { + + this.objectName = objectName; + return this; + } + + /** + * Get objectName + * @return objectName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OBJECT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getObjectName() { + return objectName; + } + + + @JsonProperty(JSON_PROPERTY_OBJECT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectName(String objectName) { + this.objectName = objectName; + } + + public ProviderEvent objectData(byte[] objectData) { + + this.objectData = objectData; + return this; + } + + /** + * base64 of the JSON serialized object with sensitive fields removed + * @return objectData + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OBJECT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public byte[] getObjectData() { + return objectData; + } + + + @JsonProperty(JSON_PROPERTY_OBJECT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectData(byte[] objectData) { + this.objectData = objectData; + } + + public ProviderEvent role(String role) { + + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; + } + + public ProviderEvent instanceId(String instanceId) { + + this.instanceId = instanceId; + return this; + } + + /** + * Get instanceId + * @return instanceId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getInstanceId() { + return instanceId; + } + + + @JsonProperty(JSON_PROPERTY_INSTANCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProviderEvent providerEvent = (ProviderEvent) o; + return Objects.equals(this.id, providerEvent.id) && + Objects.equals(this.timestamp, providerEvent.timestamp) && + Objects.equals(this.action, providerEvent.action) && + Objects.equals(this.username, providerEvent.username) && + Objects.equals(this.ip, providerEvent.ip) && + Objects.equals(this.objectType, providerEvent.objectType) && + Objects.equals(this.objectName, providerEvent.objectName) && + Arrays.equals(this.objectData, providerEvent.objectData) && + Objects.equals(this.role, providerEvent.role) && + Objects.equals(this.instanceId, providerEvent.instanceId); + } + + @Override + public int hashCode() { + return Objects.hash(id, timestamp, action, username, ip, objectType, objectName, Arrays.hashCode(objectData), role, instanceId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProviderEvent {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" objectType: ").append(toIndentedString(objectType)).append("\n"); + sb.append(" objectName: ").append(toIndentedString(objectName)).append("\n"); + sb.append(" objectData: ").append(toIndentedString(objectData)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventAction.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventAction.java new file mode 100644 index 00000000..40b3f94f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventAction.java @@ -0,0 +1,61 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProviderEventAction + */ +public enum ProviderEventAction { + + ADD("add"), + + UPDATE("update"), + + DELETE("delete"); + + private String value; + + ProviderEventAction(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProviderEventAction fromValue(String value) { + for (ProviderEventAction b : ProviderEventAction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventObjectType.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventObjectType.java new file mode 100644 index 00000000..c7869ac8 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ProviderEventObjectType.java @@ -0,0 +1,73 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ProviderEventObjectType + */ +public enum ProviderEventObjectType { + + USER("user"), + + FOLDER("folder"), + + GROUP("group"), + + ADMIN("admin"), + + API_KEY("api_key"), + + SHARE("share"), + + EVENT_ACTION("event_action"), + + EVENT_RULE("event_rule"), + + ROLE("role"); + + private String value; + + ProviderEventObjectType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ProviderEventObjectType fromValue(String value) { + for (ProviderEventObjectType b : ProviderEventObjectType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PwdChange.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PwdChange.java new file mode 100644 index 00000000..3fb9d993 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/PwdChange.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * PwdChange + */ +@JsonPropertyOrder({ + PwdChange.JSON_PROPERTY_CURRENT_PASSWORD, + PwdChange.JSON_PROPERTY_NEW_PASSWORD +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class PwdChange { + public static final String JSON_PROPERTY_CURRENT_PASSWORD = "current_password"; + private String currentPassword; + + public static final String JSON_PROPERTY_NEW_PASSWORD = "new_password"; + private String newPassword; + + public PwdChange() { + } + + public PwdChange currentPassword(String currentPassword) { + + this.currentPassword = currentPassword; + return this; + } + + /** + * Get currentPassword + * @return currentPassword + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURRENT_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCurrentPassword() { + return currentPassword; + } + + + @JsonProperty(JSON_PROPERTY_CURRENT_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrentPassword(String currentPassword) { + this.currentPassword = currentPassword; + } + + public PwdChange newPassword(String newPassword) { + + this.newPassword = newPassword; + return this; + } + + /** + * Get newPassword + * @return newPassword + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEW_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNewPassword() { + return newPassword; + } + + + @JsonProperty(JSON_PROPERTY_NEW_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNewPassword(String newPassword) { + this.newPassword = newPassword; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PwdChange pwdChange = (PwdChange) o; + return Objects.equals(this.currentPassword, pwdChange.currentPassword) && + Objects.equals(this.newPassword, pwdChange.newPassword); + } + + @Override + public int hashCode() { + return Objects.hash(currentPassword, newPassword); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PwdChange {\n"); + sb.append(" currentPassword: ").append(toIndentedString(currentPassword)).append("\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaScan.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaScan.java new file mode 100644 index 00000000..fb64eb9b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaScan.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * QuotaScan + */ +@JsonPropertyOrder({ + QuotaScan.JSON_PROPERTY_USERNAME, + QuotaScan.JSON_PROPERTY_START_TIME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class QuotaScan { + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_START_TIME = "start_time"; + private Long startTime; + + public QuotaScan() { + } + + public QuotaScan username(String username) { + + this.username = username; + return this; + } + + /** + * username to which the quota scan refers + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public QuotaScan startTime(Long startTime) { + + this.startTime = startTime; + return this; + } + + /** + * scan start time as unix timestamp in milliseconds + * @return startTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getStartTime() { + return startTime; + } + + + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuotaScan quotaScan = (QuotaScan) o; + return Objects.equals(this.username, quotaScan.username) && + Objects.equals(this.startTime, quotaScan.startTime); + } + + @Override + public int hashCode() { + return Objects.hash(username, startTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuotaScan {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaUsage.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaUsage.java new file mode 100644 index 00000000..dd52768f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/QuotaUsage.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * QuotaUsage + */ +@JsonPropertyOrder({ + QuotaUsage.JSON_PROPERTY_USED_QUOTA_SIZE, + QuotaUsage.JSON_PROPERTY_USED_QUOTA_FILES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class QuotaUsage { + public static final String JSON_PROPERTY_USED_QUOTA_SIZE = "used_quota_size"; + private Long usedQuotaSize; + + public static final String JSON_PROPERTY_USED_QUOTA_FILES = "used_quota_files"; + private Integer usedQuotaFiles; + + public QuotaUsage() { + } + + public QuotaUsage usedQuotaSize(Long usedQuotaSize) { + + this.usedQuotaSize = usedQuotaSize; + return this; + } + + /** + * Get usedQuotaSize + * @return usedQuotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedQuotaSize() { + return usedQuotaSize; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaSize(Long usedQuotaSize) { + this.usedQuotaSize = usedQuotaSize; + } + + public QuotaUsage usedQuotaFiles(Integer usedQuotaFiles) { + + this.usedQuotaFiles = usedQuotaFiles; + return this; + } + + /** + * Get usedQuotaFiles + * @return usedQuotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedQuotaFiles() { + return usedQuotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaFiles(Integer usedQuotaFiles) { + this.usedQuotaFiles = usedQuotaFiles; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuotaUsage quotaUsage = (QuotaUsage) o; + return Objects.equals(this.usedQuotaSize, quotaUsage.usedQuotaSize) && + Objects.equals(this.usedQuotaFiles, quotaUsage.usedQuotaFiles); + } + + @Override + public int hashCode() { + return Objects.hash(usedQuotaSize, usedQuotaFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuotaUsage {\n"); + sb.append(" usedQuotaSize: ").append(toIndentedString(usedQuotaSize)).append("\n"); + sb.append(" usedQuotaFiles: ").append(toIndentedString(usedQuotaFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RecoveryCode.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RecoveryCode.java new file mode 100644 index 00000000..e831997a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RecoveryCode.java @@ -0,0 +1,135 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Recovery codes to use if the user loses access to their second factor auth device. Each code can only be used once, you should use these codes to login and disable or reset 2FA for your account + */ +@JsonPropertyOrder({ + RecoveryCode.JSON_PROPERTY_SECRET, + RecoveryCode.JSON_PROPERTY_USED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class RecoveryCode { + public static final String JSON_PROPERTY_SECRET = "secret"; + private Secret secret; + + public static final String JSON_PROPERTY_USED = "used"; + private Boolean used; + + public RecoveryCode() { + } + + public RecoveryCode secret(Secret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(Secret secret) { + this.secret = secret; + } + + public RecoveryCode used(Boolean used) { + + this.used = used; + return this; + } + + /** + * Get used + * @return used + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getUsed() { + return used; + } + + + @JsonProperty(JSON_PROPERTY_USED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsed(Boolean used) { + this.used = used; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoveryCode recoveryCode = (RecoveryCode) o; + return Objects.equals(this.secret, recoveryCode.secret) && + Objects.equals(this.used, recoveryCode.used); + } + + @Override + public int hashCode() { + return Objects.hash(secret, used); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoveryCode {\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" used: ").append(toIndentedString(used)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheck.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheck.java new file mode 100644 index 00000000..cc60e3f7 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheck.java @@ -0,0 +1,248 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FolderRetention; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.RetentionCheckNotification; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * RetentionCheck + */ +@JsonPropertyOrder({ + RetentionCheck.JSON_PROPERTY_USERNAME, + RetentionCheck.JSON_PROPERTY_FOLDERS, + RetentionCheck.JSON_PROPERTY_START_TIME, + RetentionCheck.JSON_PROPERTY_NOTIFICATIONS, + RetentionCheck.JSON_PROPERTY_EMAIL +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class RetentionCheck { + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FOLDERS = "folders"; + private List folders = new ArrayList<>(); + + public static final String JSON_PROPERTY_START_TIME = "start_time"; + private Long startTime; + + public static final String JSON_PROPERTY_NOTIFICATIONS = "notifications"; + private List notifications = new ArrayList<>(); + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public RetentionCheck() { + } + + public RetentionCheck username(String username) { + + this.username = username; + return this; + } + + /** + * username to which the retention check refers + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public RetentionCheck folders(List folders) { + + this.folders = folders; + return this; + } + + public RetentionCheck addFoldersItem(FolderRetention foldersItem) { + if (this.folders == null) { + this.folders = new ArrayList<>(); + } + this.folders.add(foldersItem); + return this; + } + + /** + * Get folders + * @return folders + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFolders() { + return folders; + } + + + @JsonProperty(JSON_PROPERTY_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFolders(List folders) { + this.folders = folders; + } + + public RetentionCheck startTime(Long startTime) { + + this.startTime = startTime; + return this; + } + + /** + * check start time as unix timestamp in milliseconds + * @return startTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getStartTime() { + return startTime; + } + + + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public RetentionCheck notifications(List notifications) { + + this.notifications = notifications; + return this; + } + + public RetentionCheck addNotificationsItem(RetentionCheckNotification notificationsItem) { + if (this.notifications == null) { + this.notifications = new ArrayList<>(); + } + this.notifications.add(notificationsItem); + return this; + } + + /** + * Get notifications + * @return notifications + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNotifications() { + return notifications; + } + + + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNotifications(List notifications) { + this.notifications = notifications; + } + + public RetentionCheck email(String email) { + + this.email = email; + return this; + } + + /** + * if the notification method is set to \"Email\", this is the e-mail address that receives the retention check report. This field is automatically set to the email address associated with the administrator starting the check + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RetentionCheck retentionCheck = (RetentionCheck) o; + return Objects.equals(this.username, retentionCheck.username) && + Objects.equals(this.folders, retentionCheck.folders) && + Objects.equals(this.startTime, retentionCheck.startTime) && + Objects.equals(this.notifications, retentionCheck.notifications) && + Objects.equals(this.email, retentionCheck.email); + } + + @Override + public int hashCode() { + return Objects.hash(username, folders, startTime, notifications, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RetentionCheck {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" folders: ").append(toIndentedString(folders)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" notifications: ").append(toIndentedString(notifications)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheckNotification.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheckNotification.java new file mode 100644 index 00000000..0112d24f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/RetentionCheckNotification.java @@ -0,0 +1,59 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Options: * `Hook` - notify result using the defined hook. A \"data_retention_hook\" must be defined in your configuration file for this to work * `Email` - notify results by email. The admin starting the retention check must have an associated email address and the SMTP server must be configured for this to work + */ +public enum RetentionCheckNotification { + + HOOK("Hook"), + + EMAIL("Email"); + + private String value; + + RetentionCheckNotification(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RetentionCheckNotification fromValue(String value) { + for (RetentionCheckNotification b : RetentionCheckNotification.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Role.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Role.java new file mode 100644 index 00000000..2c410c17 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Role.java @@ -0,0 +1,309 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Role + */ +@JsonPropertyOrder({ + Role.JSON_PROPERTY_ID, + Role.JSON_PROPERTY_NAME, + Role.JSON_PROPERTY_DESCRIPTION, + Role.JSON_PROPERTY_CREATED_AT, + Role.JSON_PROPERTY_UPDATED_AT, + Role.JSON_PROPERTY_USERS, + Role.JSON_PROPERTY_ADMINS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Role { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_ADMINS = "admins"; + private List admins = new ArrayList<>(); + + public Role() { + } + + public Role id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public Role name(String name) { + + this.name = name; + return this; + } + + /** + * name is unique + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public Role description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public Role createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public Role updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in milliseconds + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public Role users(List users) { + + this.users = users; + return this; + } + + public Role addUsersItem(String usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * list of usernames associated with this group + * @return users + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + public Role admins(List admins) { + + this.admins = admins; + return this; + } + + public Role addAdminsItem(String adminsItem) { + if (this.admins == null) { + this.admins = new ArrayList<>(); + } + this.admins.add(adminsItem); + return this; + } + + /** + * list of admins usernames associated with this group + * @return admins + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAdmins() { + return admins; + } + + + @JsonProperty(JSON_PROPERTY_ADMINS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdmins(List admins) { + this.admins = admins; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Role role = (Role) o; + return Objects.equals(this.id, role.id) && + Objects.equals(this.name, role.name) && + Objects.equals(this.description, role.description) && + Objects.equals(this.createdAt, role.createdAt) && + Objects.equals(this.updatedAt, role.updatedAt) && + Objects.equals(this.users, role.users) && + Objects.equals(this.admins, role.admins); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, createdAt, updatedAt, users, admins); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Role {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" admins: ").append(toIndentedString(admins)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/S3Config.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/S3Config.java new file mode 100644 index 00000000..53c277bc --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/S3Config.java @@ -0,0 +1,600 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * S3 Compatible Object Storage configuration details + */ +@JsonPropertyOrder({ + S3Config.JSON_PROPERTY_BUCKET, + S3Config.JSON_PROPERTY_REGION, + S3Config.JSON_PROPERTY_ACCESS_KEY, + S3Config.JSON_PROPERTY_ACCESS_SECRET, + S3Config.JSON_PROPERTY_ROLE_ARN, + S3Config.JSON_PROPERTY_SESSION_TOKEN, + S3Config.JSON_PROPERTY_ENDPOINT, + S3Config.JSON_PROPERTY_STORAGE_CLASS, + S3Config.JSON_PROPERTY_ACL, + S3Config.JSON_PROPERTY_UPLOAD_PART_SIZE, + S3Config.JSON_PROPERTY_UPLOAD_CONCURRENCY, + S3Config.JSON_PROPERTY_UPLOAD_PART_MAX_TIME, + S3Config.JSON_PROPERTY_DOWNLOAD_PART_SIZE, + S3Config.JSON_PROPERTY_DOWNLOAD_CONCURRENCY, + S3Config.JSON_PROPERTY_DOWNLOAD_PART_MAX_TIME, + S3Config.JSON_PROPERTY_FORCE_PATH_STYLE, + S3Config.JSON_PROPERTY_KEY_PREFIX +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class S3Config { + public static final String JSON_PROPERTY_BUCKET = "bucket"; + private String bucket; + + public static final String JSON_PROPERTY_REGION = "region"; + private String region; + + public static final String JSON_PROPERTY_ACCESS_KEY = "access_key"; + private String accessKey; + + public static final String JSON_PROPERTY_ACCESS_SECRET = "access_secret"; + private Secret accessSecret; + + public static final String JSON_PROPERTY_ROLE_ARN = "role_arn"; + private String roleArn; + + public static final String JSON_PROPERTY_SESSION_TOKEN = "session_token"; + private String sessionToken; + + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_STORAGE_CLASS = "storage_class"; + private String storageClass; + + public static final String JSON_PROPERTY_ACL = "acl"; + private String acl; + + public static final String JSON_PROPERTY_UPLOAD_PART_SIZE = "upload_part_size"; + private Integer uploadPartSize; + + public static final String JSON_PROPERTY_UPLOAD_CONCURRENCY = "upload_concurrency"; + private Integer uploadConcurrency; + + public static final String JSON_PROPERTY_UPLOAD_PART_MAX_TIME = "upload_part_max_time"; + private Integer uploadPartMaxTime; + + public static final String JSON_PROPERTY_DOWNLOAD_PART_SIZE = "download_part_size"; + private Integer downloadPartSize; + + public static final String JSON_PROPERTY_DOWNLOAD_CONCURRENCY = "download_concurrency"; + private Integer downloadConcurrency; + + public static final String JSON_PROPERTY_DOWNLOAD_PART_MAX_TIME = "download_part_max_time"; + private Integer downloadPartMaxTime; + + public static final String JSON_PROPERTY_FORCE_PATH_STYLE = "force_path_style"; + private Boolean forcePathStyle; + + public static final String JSON_PROPERTY_KEY_PREFIX = "key_prefix"; + private String keyPrefix; + + public S3Config() { + } + + public S3Config bucket(String bucket) { + + this.bucket = bucket; + return this; + } + + /** + * Get bucket + * @return bucket + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBucket() { + return bucket; + } + + + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public S3Config region(String region) { + + this.region = region; + return this; + } + + /** + * Get region + * @return region + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRegion() { + return region; + } + + + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRegion(String region) { + this.region = region; + } + + public S3Config accessKey(String accessKey) { + + this.accessKey = accessKey; + return this; + } + + /** + * Get accessKey + * @return accessKey + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccessKey() { + return accessKey; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public S3Config accessSecret(Secret accessSecret) { + + this.accessSecret = accessSecret; + return this; + } + + /** + * Get accessSecret + * @return accessSecret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getAccessSecret() { + return accessSecret; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessSecret(Secret accessSecret) { + this.accessSecret = accessSecret; + } + + public S3Config roleArn(String roleArn) { + + this.roleArn = roleArn; + return this; + } + + /** + * Optional IAM Role ARN to assume + * @return roleArn + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE_ARN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRoleArn() { + return roleArn; + } + + + @JsonProperty(JSON_PROPERTY_ROLE_ARN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRoleArn(String roleArn) { + this.roleArn = roleArn; + } + + public S3Config sessionToken(String sessionToken) { + + this.sessionToken = sessionToken; + return this; + } + + /** + * Optional Session token that is a part of temporary security credentials provisioned by AWS STS + * @return sessionToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSessionToken() { + return sessionToken; + } + + + @JsonProperty(JSON_PROPERTY_SESSION_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSessionToken(String sessionToken) { + this.sessionToken = sessionToken; + } + + public S3Config endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * optional endpoint + * @return endpoint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public S3Config storageClass(String storageClass) { + + this.storageClass = storageClass; + return this; + } + + /** + * Get storageClass + * @return storageClass + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STORAGE_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStorageClass() { + return storageClass; + } + + + @JsonProperty(JSON_PROPERTY_STORAGE_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStorageClass(String storageClass) { + this.storageClass = storageClass; + } + + public S3Config acl(String acl) { + + this.acl = acl; + return this; + } + + /** + * The canned ACL to apply to uploaded objects. Leave empty to use the default ACL. For more information and available ACLs, see here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl + * @return acl + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAcl() { + return acl; + } + + + @JsonProperty(JSON_PROPERTY_ACL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAcl(String acl) { + this.acl = acl; + } + + public S3Config uploadPartSize(Integer uploadPartSize) { + + this.uploadPartSize = uploadPartSize; + return this; + } + + /** + * the buffer size (in MB) to use for multipart uploads. The minimum allowed part size is 5MB, and if this value is set to zero, the default value (5MB) for the AWS SDK will be used. The minimum allowed value is 5. + * @return uploadPartSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadPartSize() { + return uploadPartSize; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadPartSize(Integer uploadPartSize) { + this.uploadPartSize = uploadPartSize; + } + + public S3Config uploadConcurrency(Integer uploadConcurrency) { + + this.uploadConcurrency = uploadConcurrency; + return this; + } + + /** + * the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used + * @return uploadConcurrency + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadConcurrency() { + return uploadConcurrency; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadConcurrency(Integer uploadConcurrency) { + this.uploadConcurrency = uploadConcurrency; + } + + public S3Config uploadPartMaxTime(Integer uploadPartMaxTime) { + + this.uploadPartMaxTime = uploadPartMaxTime; + return this; + } + + /** + * the maximum time allowed, in seconds, to upload a single chunk (the chunk size is defined via \"upload_part_size\"). 0 means no timeout + * @return uploadPartMaxTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_MAX_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadPartMaxTime() { + return uploadPartMaxTime; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_PART_MAX_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadPartMaxTime(Integer uploadPartMaxTime) { + this.uploadPartMaxTime = uploadPartMaxTime; + } + + public S3Config downloadPartSize(Integer downloadPartSize) { + + this.downloadPartSize = downloadPartSize; + return this; + } + + /** + * the buffer size (in MB) to use for multipart downloads. The minimum allowed part size is 5MB, and if this value is set to zero, the default value (5MB) for the AWS SDK will be used. The minimum allowed value is 5. Ignored for partial downloads + * @return downloadPartSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadPartSize() { + return downloadPartSize; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_PART_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadPartSize(Integer downloadPartSize) { + this.downloadPartSize = downloadPartSize; + } + + public S3Config downloadConcurrency(Integer downloadConcurrency) { + + this.downloadConcurrency = downloadConcurrency; + return this; + } + + /** + * the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used. Ignored for partial downloads + * @return downloadConcurrency + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadConcurrency() { + return downloadConcurrency; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_CONCURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadConcurrency(Integer downloadConcurrency) { + this.downloadConcurrency = downloadConcurrency; + } + + public S3Config downloadPartMaxTime(Integer downloadPartMaxTime) { + + this.downloadPartMaxTime = downloadPartMaxTime; + return this; + } + + /** + * the maximum time allowed, in seconds, to download a single chunk (the chunk size is defined via \"download_part_size\"). 0 means no timeout. Ignored for partial downloads. + * @return downloadPartMaxTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_PART_MAX_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadPartMaxTime() { + return downloadPartMaxTime; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_PART_MAX_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadPartMaxTime(Integer downloadPartMaxTime) { + this.downloadPartMaxTime = downloadPartMaxTime; + } + + public S3Config forcePathStyle(Boolean forcePathStyle) { + + this.forcePathStyle = forcePathStyle; + return this; + } + + /** + * Set this to \"true\" to force the request to use path-style addressing, i.e., \"http://s3.amazonaws.com/BUCKET/KEY\". By default, the S3 client will use virtual hosted bucket addressing when possible (\"http://BUCKET.s3.amazonaws.com/KEY\") + * @return forcePathStyle + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_PATH_STYLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getForcePathStyle() { + return forcePathStyle; + } + + + @JsonProperty(JSON_PROPERTY_FORCE_PATH_STYLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setForcePathStyle(Boolean forcePathStyle) { + this.forcePathStyle = forcePathStyle; + } + + public S3Config keyPrefix(String keyPrefix) { + + this.keyPrefix = keyPrefix; + return this; + } + + /** + * key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with \"/\" and must end with \"/\". If empty the whole bucket contents will be available + * @return keyPrefix + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKeyPrefix() { + return keyPrefix; + } + + + @JsonProperty(JSON_PROPERTY_KEY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyPrefix(String keyPrefix) { + this.keyPrefix = keyPrefix; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + S3Config s3Config = (S3Config) o; + return Objects.equals(this.bucket, s3Config.bucket) && + Objects.equals(this.region, s3Config.region) && + Objects.equals(this.accessKey, s3Config.accessKey) && + Objects.equals(this.accessSecret, s3Config.accessSecret) && + Objects.equals(this.roleArn, s3Config.roleArn) && + Objects.equals(this.sessionToken, s3Config.sessionToken) && + Objects.equals(this.endpoint, s3Config.endpoint) && + Objects.equals(this.storageClass, s3Config.storageClass) && + Objects.equals(this.acl, s3Config.acl) && + Objects.equals(this.uploadPartSize, s3Config.uploadPartSize) && + Objects.equals(this.uploadConcurrency, s3Config.uploadConcurrency) && + Objects.equals(this.uploadPartMaxTime, s3Config.uploadPartMaxTime) && + Objects.equals(this.downloadPartSize, s3Config.downloadPartSize) && + Objects.equals(this.downloadConcurrency, s3Config.downloadConcurrency) && + Objects.equals(this.downloadPartMaxTime, s3Config.downloadPartMaxTime) && + Objects.equals(this.forcePathStyle, s3Config.forcePathStyle) && + Objects.equals(this.keyPrefix, s3Config.keyPrefix); + } + + @Override + public int hashCode() { + return Objects.hash(bucket, region, accessKey, accessSecret, roleArn, sessionToken, endpoint, storageClass, acl, uploadPartSize, uploadConcurrency, uploadPartMaxTime, downloadPartSize, downloadConcurrency, downloadPartMaxTime, forcePathStyle, keyPrefix); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class S3Config {\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" accessKey: ").append(toIndentedString(accessKey)).append("\n"); + sb.append(" accessSecret: ").append(toIndentedString(accessSecret)).append("\n"); + sb.append(" roleArn: ").append(toIndentedString(roleArn)).append("\n"); + sb.append(" sessionToken: ").append(toIndentedString(sessionToken)).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" storageClass: ").append(toIndentedString(storageClass)).append("\n"); + sb.append(" acl: ").append(toIndentedString(acl)).append("\n"); + sb.append(" uploadPartSize: ").append(toIndentedString(uploadPartSize)).append("\n"); + sb.append(" uploadConcurrency: ").append(toIndentedString(uploadConcurrency)).append("\n"); + sb.append(" uploadPartMaxTime: ").append(toIndentedString(uploadPartMaxTime)).append("\n"); + sb.append(" downloadPartSize: ").append(toIndentedString(downloadPartSize)).append("\n"); + sb.append(" downloadConcurrency: ").append(toIndentedString(downloadConcurrency)).append("\n"); + sb.append(" downloadPartMaxTime: ").append(toIndentedString(downloadPartMaxTime)).append("\n"); + sb.append(" forcePathStyle: ").append(toIndentedString(forcePathStyle)).append("\n"); + sb.append(" keyPrefix: ").append(toIndentedString(keyPrefix)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SFTPFsConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SFTPFsConfig.java new file mode 100644 index 00000000..f27aee41 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SFTPFsConfig.java @@ -0,0 +1,431 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SFTPFsConfig + */ +@JsonPropertyOrder({ + SFTPFsConfig.JSON_PROPERTY_ENDPOINT, + SFTPFsConfig.JSON_PROPERTY_USERNAME, + SFTPFsConfig.JSON_PROPERTY_PASSWORD, + SFTPFsConfig.JSON_PROPERTY_PRIVATE_KEY, + SFTPFsConfig.JSON_PROPERTY_KEY_PASSPHRASE, + SFTPFsConfig.JSON_PROPERTY_FINGERPRINTS, + SFTPFsConfig.JSON_PROPERTY_PREFIX, + SFTPFsConfig.JSON_PROPERTY_DISABLE_CONCURRENT_READS, + SFTPFsConfig.JSON_PROPERTY_BUFFER_SIZE, + SFTPFsConfig.JSON_PROPERTY_EQUALITY_CHECK_MODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class SFTPFsConfig { + public static final String JSON_PROPERTY_ENDPOINT = "endpoint"; + private String endpoint; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private Secret password; + + public static final String JSON_PROPERTY_PRIVATE_KEY = "private_key"; + private Secret privateKey; + + public static final String JSON_PROPERTY_KEY_PASSPHRASE = "key_passphrase"; + private Secret keyPassphrase; + + public static final String JSON_PROPERTY_FINGERPRINTS = "fingerprints"; + private List fingerprints = new ArrayList<>(); + + public static final String JSON_PROPERTY_PREFIX = "prefix"; + private String prefix; + + public static final String JSON_PROPERTY_DISABLE_CONCURRENT_READS = "disable_concurrent_reads"; + private Boolean disableConcurrentReads; + + public static final String JSON_PROPERTY_BUFFER_SIZE = "buffer_size"; + private Integer bufferSize; + + /** + * Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed: * `0` username and endpoint must match. This is the default * `1` only the endpoint must match + */ + public enum EqualityCheckModeEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + EqualityCheckModeEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EqualityCheckModeEnum fromValue(Integer value) { + for (EqualityCheckModeEnum b : EqualityCheckModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_EQUALITY_CHECK_MODE = "equality_check_mode"; + private EqualityCheckModeEnum equalityCheckMode; + + public SFTPFsConfig() { + } + + public SFTPFsConfig endpoint(String endpoint) { + + this.endpoint = endpoint; + return this; + } + + /** + * remote SFTP endpoint as host:port + * @return endpoint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEndpoint() { + return endpoint; + } + + + @JsonProperty(JSON_PROPERTY_ENDPOINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public SFTPFsConfig username(String username) { + + this.username = username; + return this; + } + + /** + * you can specify a password or private key or both. In the latter case the private key will be tried first. + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public SFTPFsConfig password(Secret password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(Secret password) { + this.password = password; + } + + public SFTPFsConfig privateKey(Secret privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIVATE_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getPrivateKey() { + return privateKey; + } + + + @JsonProperty(JSON_PROPERTY_PRIVATE_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrivateKey(Secret privateKey) { + this.privateKey = privateKey; + } + + public SFTPFsConfig keyPassphrase(Secret keyPassphrase) { + + this.keyPassphrase = keyPassphrase; + return this; + } + + /** + * Get keyPassphrase + * @return keyPassphrase + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY_PASSPHRASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getKeyPassphrase() { + return keyPassphrase; + } + + + @JsonProperty(JSON_PROPERTY_KEY_PASSPHRASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeyPassphrase(Secret keyPassphrase) { + this.keyPassphrase = keyPassphrase; + } + + public SFTPFsConfig fingerprints(List fingerprints) { + + this.fingerprints = fingerprints; + return this; + } + + public SFTPFsConfig addFingerprintsItem(String fingerprintsItem) { + if (this.fingerprints == null) { + this.fingerprints = new ArrayList<>(); + } + this.fingerprints.add(fingerprintsItem); + return this; + } + + /** + * SHA256 fingerprints to use for host key verification. If you don't provide any fingerprint the remote host key will not be verified, this is a security risk + * @return fingerprints + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINGERPRINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFingerprints() { + return fingerprints; + } + + + @JsonProperty(JSON_PROPERTY_FINGERPRINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFingerprints(List fingerprints) { + this.fingerprints = fingerprints; + } + + public SFTPFsConfig prefix(String prefix) { + + this.prefix = prefix; + return this; + } + + /** + * Specifying a prefix you can restrict all operations to a given path within the remote SFTP server. + * @return prefix + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrefix() { + return prefix; + } + + + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public SFTPFsConfig disableConcurrentReads(Boolean disableConcurrentReads) { + + this.disableConcurrentReads = disableConcurrentReads; + return this; + } + + /** + * Concurrent reads are safe to use and disabling them will degrade performance. Some servers automatically delete files once they are downloaded. Using concurrent reads is problematic with such servers. + * @return disableConcurrentReads + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLE_CONCURRENT_READS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableConcurrentReads() { + return disableConcurrentReads; + } + + + @JsonProperty(JSON_PROPERTY_DISABLE_CONCURRENT_READS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableConcurrentReads(Boolean disableConcurrentReads) { + this.disableConcurrentReads = disableConcurrentReads; + } + + public SFTPFsConfig bufferSize(Integer bufferSize) { + + this.bufferSize = bufferSize; + return this; + } + + /** + * The size of the buffer (in MB) to use for transfers. By enabling buffering, the reads and writes, from/to the remote SFTP server, are split in multiple concurrent requests and this allows data to be transferred at a faster rate, over high latency networks, by overlapping round-trip times. With buffering enabled, resuming uploads is not supported and a file cannot be opened for both reading and writing at the same time. 0 means disabled. + * minimum: 0 + * maximum: 16 + * @return bufferSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getBufferSize() { + return bufferSize; + } + + + @JsonProperty(JSON_PROPERTY_BUFFER_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBufferSize(Integer bufferSize) { + this.bufferSize = bufferSize; + } + + public SFTPFsConfig equalityCheckMode(EqualityCheckModeEnum equalityCheckMode) { + + this.equalityCheckMode = equalityCheckMode; + return this; + } + + /** + * Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed: * `0` username and endpoint must match. This is the default * `1` only the endpoint must match + * @return equalityCheckMode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EQUALITY_CHECK_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EqualityCheckModeEnum getEqualityCheckMode() { + return equalityCheckMode; + } + + + @JsonProperty(JSON_PROPERTY_EQUALITY_CHECK_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEqualityCheckMode(EqualityCheckModeEnum equalityCheckMode) { + this.equalityCheckMode = equalityCheckMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SFTPFsConfig sfTPFsConfig = (SFTPFsConfig) o; + return Objects.equals(this.endpoint, sfTPFsConfig.endpoint) && + Objects.equals(this.username, sfTPFsConfig.username) && + Objects.equals(this.password, sfTPFsConfig.password) && + Objects.equals(this.privateKey, sfTPFsConfig.privateKey) && + Objects.equals(this.keyPassphrase, sfTPFsConfig.keyPassphrase) && + Objects.equals(this.fingerprints, sfTPFsConfig.fingerprints) && + Objects.equals(this.prefix, sfTPFsConfig.prefix) && + Objects.equals(this.disableConcurrentReads, sfTPFsConfig.disableConcurrentReads) && + Objects.equals(this.bufferSize, sfTPFsConfig.bufferSize) && + Objects.equals(this.equalityCheckMode, sfTPFsConfig.equalityCheckMode); + } + + @Override + public int hashCode() { + return Objects.hash(endpoint, username, password, privateKey, keyPassphrase, fingerprints, prefix, disableConcurrentReads, bufferSize, equalityCheckMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SFTPFsConfig {\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" keyPassphrase: ").append(toIndentedString(keyPassphrase)).append("\n"); + sb.append(" fingerprints: ").append(toIndentedString(fingerprints)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" disableConcurrentReads: ").append(toIndentedString(disableConcurrentReads)).append("\n"); + sb.append(" bufferSize: ").append(toIndentedString(bufferSize)).append("\n"); + sb.append(" equalityCheckMode: ").append(toIndentedString(equalityCheckMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHAuthentications.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHAuthentications.java new file mode 100644 index 00000000..07d13138 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHAuthentications.java @@ -0,0 +1,65 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SSHAuthentications + */ +public enum SSHAuthentications { + + PUBLICKEY("publickey"), + + PASSWORD("password"), + + KEYBOARD_INTERACTIVE("keyboard-interactive"), + + PUBLICKEY_PASSWORD("publickey+password"), + + PUBLICKEY_KEYBOARD_INTERACTIVE("publickey+keyboard-interactive"); + + private String value; + + SSHAuthentications(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SSHAuthentications fromValue(String value) { + for (SSHAuthentications b : SSHAuthentications.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHBinding.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHBinding.java new file mode 100644 index 00000000..6981b2ca --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHBinding.java @@ -0,0 +1,165 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SSHBinding + */ +@JsonPropertyOrder({ + SSHBinding.JSON_PROPERTY_ADDRESS, + SSHBinding.JSON_PROPERTY_PORT, + SSHBinding.JSON_PROPERTY_APPLY_PROXY_CONFIG +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class SSHBinding { + public static final String JSON_PROPERTY_ADDRESS = "address"; + private String address; + + public static final String JSON_PROPERTY_PORT = "port"; + private Integer port; + + public static final String JSON_PROPERTY_APPLY_PROXY_CONFIG = "apply_proxy_config"; + private Boolean applyProxyConfig; + + public SSHBinding() { + } + + public SSHBinding address(String address) { + + this.address = address; + return this; + } + + /** + * TCP address the server listen on + * @return address + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(String address) { + this.address = address; + } + + public SSHBinding port(Integer port) { + + this.port = port; + return this; + } + + /** + * the port used for serving requests + * @return port + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPort() { + return port; + } + + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(Integer port) { + this.port = port; + } + + public SSHBinding applyProxyConfig(Boolean applyProxyConfig) { + + this.applyProxyConfig = applyProxyConfig; + return this; + } + + /** + * apply the proxy configuration, if any + * @return applyProxyConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPLY_PROXY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getApplyProxyConfig() { + return applyProxyConfig; + } + + + @JsonProperty(JSON_PROPERTY_APPLY_PROXY_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplyProxyConfig(Boolean applyProxyConfig) { + this.applyProxyConfig = applyProxyConfig; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSHBinding ssHBinding = (SSHBinding) o; + return Objects.equals(this.address, ssHBinding.address) && + Objects.equals(this.port, ssHBinding.port) && + Objects.equals(this.applyProxyConfig, ssHBinding.applyProxyConfig); + } + + @Override + public int hashCode() { + return Objects.hash(address, port, applyProxyConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSHBinding {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" applyProxyConfig: ").append(toIndentedString(applyProxyConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHHostKey.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHHostKey.java new file mode 100644 index 00000000..0bf6c6eb --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHHostKey.java @@ -0,0 +1,176 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SSHHostKey + */ +@JsonPropertyOrder({ + SSHHostKey.JSON_PROPERTY_PATH, + SSHHostKey.JSON_PROPERTY_FINGERPRINT, + SSHHostKey.JSON_PROPERTY_ALGORITHMS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class SSHHostKey { + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_FINGERPRINT = "fingerprint"; + private String fingerprint; + + public static final String JSON_PROPERTY_ALGORITHMS = "algorithms"; + private List algorithms = new ArrayList<>(); + + public SSHHostKey() { + } + + public SSHHostKey path(String path) { + + this.path = path; + return this; + } + + /** + * Get path + * @return path + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(String path) { + this.path = path; + } + + public SSHHostKey fingerprint(String fingerprint) { + + this.fingerprint = fingerprint; + return this; + } + + /** + * Get fingerprint + * @return fingerprint + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FINGERPRINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFingerprint() { + return fingerprint; + } + + + @JsonProperty(JSON_PROPERTY_FINGERPRINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFingerprint(String fingerprint) { + this.fingerprint = fingerprint; + } + + public SSHHostKey algorithms(List algorithms) { + + this.algorithms = algorithms; + return this; + } + + public SSHHostKey addAlgorithmsItem(String algorithmsItem) { + if (this.algorithms == null) { + this.algorithms = new ArrayList<>(); + } + this.algorithms.add(algorithmsItem); + return this; + } + + /** + * Get algorithms + * @return algorithms + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALGORITHMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAlgorithms() { + return algorithms; + } + + + @JsonProperty(JSON_PROPERTY_ALGORITHMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlgorithms(List algorithms) { + this.algorithms = algorithms; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSHHostKey ssHHostKey = (SSHHostKey) o; + return Objects.equals(this.path, ssHHostKey.path) && + Objects.equals(this.fingerprint, ssHHostKey.fingerprint) && + Objects.equals(this.algorithms, ssHHostKey.algorithms); + } + + @Override + public int hashCode() { + return Objects.hash(path, fingerprint, algorithms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSHHostKey {\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n"); + sb.append(" algorithms: ").append(toIndentedString(algorithms)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHServiceStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHServiceStatus.java new file mode 100644 index 00000000..02f90a96 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SSHServiceStatus.java @@ -0,0 +1,442 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.jackson.nullable.JsonNullable; + +import java.util.*; + +/** + * SSHServiceStatus + */ +@JsonPropertyOrder({ + SSHServiceStatus.JSON_PROPERTY_IS_ACTIVE, + SSHServiceStatus.JSON_PROPERTY_BINDINGS, + SSHServiceStatus.JSON_PROPERTY_HOST_KEYS, + SSHServiceStatus.JSON_PROPERTY_SSH_COMMANDS, + SSHServiceStatus.JSON_PROPERTY_AUTHENTICATIONS, + SSHServiceStatus.JSON_PROPERTY_PUBLIC_KEY_ALGORITHMS, + SSHServiceStatus.JSON_PROPERTY_MACS, + SSHServiceStatus.JSON_PROPERTY_KEX_ALGORITHMS, + SSHServiceStatus.JSON_PROPERTY_CIPHERS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class SSHServiceStatus { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + public static final String JSON_PROPERTY_BINDINGS = "bindings"; + public static final String JSON_PROPERTY_HOST_KEYS = "host_keys"; + public static final String JSON_PROPERTY_SSH_COMMANDS = "ssh_commands"; + public static final String JSON_PROPERTY_AUTHENTICATIONS = "authentications"; + public static final String JSON_PROPERTY_PUBLIC_KEY_ALGORITHMS = "public_key_algorithms"; + public static final String JSON_PROPERTY_MACS = "macs"; + public static final String JSON_PROPERTY_KEX_ALGORITHMS = "kex_algorithms"; + public static final String JSON_PROPERTY_CIPHERS = "ciphers"; + private Boolean isActive; + private JsonNullable> bindings = JsonNullable.>undefined(); + private JsonNullable> hostKeys = JsonNullable.>undefined(); + private List sshCommands = new ArrayList<>(); + private List authentications = new ArrayList<>(); + private List publicKeyAlgorithms = new ArrayList<>(); + private List macs = new ArrayList<>(); + private List kexAlgorithms = new ArrayList<>(); + private List ciphers = new ArrayList<>(); + + public SSHServiceStatus() { + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + public SSHServiceStatus isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public SSHServiceStatus bindings(List bindings) { + this.bindings = JsonNullable.>of(bindings); + + return this; + } + + public SSHServiceStatus addBindingsItem(SSHBinding bindingsItem) { + if (this.bindings == null || !this.bindings.isPresent()) { + this.bindings = JsonNullable.>of(new ArrayList<>()); + } + try { + this.bindings.get().add(bindingsItem); + } catch (NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get bindings + * + * @return bindings + */ + @javax.annotation.Nullable + @JsonIgnore + + public List getBindings() { + return bindings.orElse(null); + } + + public void setBindings(List bindings) { + this.bindings = JsonNullable.>of(bindings); + } + + @JsonProperty(JSON_PROPERTY_BINDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getBindings_JsonNullable() { + return bindings; + } + + @JsonProperty(JSON_PROPERTY_BINDINGS) + public void setBindings_JsonNullable(JsonNullable> bindings) { + this.bindings = bindings; + } + + public SSHServiceStatus hostKeys(List hostKeys) { + this.hostKeys = JsonNullable.>of(hostKeys); + + return this; + } + + public SSHServiceStatus addHostKeysItem(SSHHostKey hostKeysItem) { + if (this.hostKeys == null || !this.hostKeys.isPresent()) { + this.hostKeys = JsonNullable.>of(new ArrayList<>()); + } + try { + this.hostKeys.get().add(hostKeysItem); + } catch (NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get hostKeys + * + * @return hostKeys + */ + @javax.annotation.Nullable + @JsonIgnore + + public List getHostKeys() { + return hostKeys.orElse(null); + } + + public void setHostKeys(List hostKeys) { + this.hostKeys = JsonNullable.>of(hostKeys); + } + + @JsonProperty(JSON_PROPERTY_HOST_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getHostKeys_JsonNullable() { + return hostKeys; + } + + @JsonProperty(JSON_PROPERTY_HOST_KEYS) + public void setHostKeys_JsonNullable(JsonNullable> hostKeys) { + this.hostKeys = hostKeys; + } + + public SSHServiceStatus sshCommands(List sshCommands) { + + this.sshCommands = sshCommands; + return this; + } + + public SSHServiceStatus addSshCommandsItem(String sshCommandsItem) { + if (this.sshCommands == null) { + this.sshCommands = new ArrayList<>(); + } + this.sshCommands.add(sshCommandsItem); + return this; + } + + /** + * Get sshCommands + * + * @return sshCommands + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SSH_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSshCommands() { + return sshCommands; + } + + @JsonProperty(JSON_PROPERTY_SSH_COMMANDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSshCommands(List sshCommands) { + this.sshCommands = sshCommands; + } + + public SSHServiceStatus authentications(List authentications) { + + this.authentications = authentications; + return this; + } + + public SSHServiceStatus addAuthenticationsItem(SSHAuthentications authenticationsItem) { + if (this.authentications == null) { + this.authentications = new ArrayList<>(); + } + this.authentications.add(authenticationsItem); + return this; + } + + /** + * Get authentications + * + * @return authentications + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHENTICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAuthentications() { + return authentications; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAuthentications(List authentications) { + this.authentications = authentications; + } + + public SSHServiceStatus publicKeyAlgorithms(List publicKeyAlgorithms) { + + this.publicKeyAlgorithms = publicKeyAlgorithms; + return this; + } + + public SSHServiceStatus addPublicKeyAlgorithmsItem(String publicKeyAlgorithmsItem) { + if (this.publicKeyAlgorithms == null) { + this.publicKeyAlgorithms = new ArrayList<>(); + } + this.publicKeyAlgorithms.add(publicKeyAlgorithmsItem); + return this; + } + + /** + * Get publicKeyAlgorithms + * + * @return publicKeyAlgorithms + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_KEY_ALGORITHMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPublicKeyAlgorithms() { + return publicKeyAlgorithms; + } + + @JsonProperty(JSON_PROPERTY_PUBLIC_KEY_ALGORITHMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicKeyAlgorithms(List publicKeyAlgorithms) { + this.publicKeyAlgorithms = publicKeyAlgorithms; + } + + public SSHServiceStatus macs(List macs) { + + this.macs = macs; + return this; + } + + public SSHServiceStatus addMacsItem(String macsItem) { + if (this.macs == null) { + this.macs = new ArrayList<>(); + } + this.macs.add(macsItem); + return this; + } + + /** + * Get macs + * + * @return macs + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MACS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getMacs() { + return macs; + } + + @JsonProperty(JSON_PROPERTY_MACS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMacs(List macs) { + this.macs = macs; + } + + public SSHServiceStatus kexAlgorithms(List kexAlgorithms) { + + this.kexAlgorithms = kexAlgorithms; + return this; + } + + public SSHServiceStatus addKexAlgorithmsItem(String kexAlgorithmsItem) { + if (this.kexAlgorithms == null) { + this.kexAlgorithms = new ArrayList<>(); + } + this.kexAlgorithms.add(kexAlgorithmsItem); + return this; + } + + /** + * Get kexAlgorithms + * + * @return kexAlgorithms + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEX_ALGORITHMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getKexAlgorithms() { + return kexAlgorithms; + } + + @JsonProperty(JSON_PROPERTY_KEX_ALGORITHMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKexAlgorithms(List kexAlgorithms) { + this.kexAlgorithms = kexAlgorithms; + } + + public SSHServiceStatus ciphers(List ciphers) { + + this.ciphers = ciphers; + return this; + } + + public SSHServiceStatus addCiphersItem(String ciphersItem) { + if (this.ciphers == null) { + this.ciphers = new ArrayList<>(); + } + this.ciphers.add(ciphersItem); + return this; + } + + /** + * Get ciphers + * + * @return ciphers + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CIPHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getCiphers() { + return ciphers; + } + + @JsonProperty(JSON_PROPERTY_CIPHERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCiphers(List ciphers) { + this.ciphers = ciphers; + } + + @Override + public int hashCode() { + return Objects.hash(isActive, hashCodeNullable(bindings), hashCodeNullable(hostKeys), sshCommands, authentications, publicKeyAlgorithms, macs, kexAlgorithms, ciphers); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSHServiceStatus ssHServiceStatus = (SSHServiceStatus) o; + return Objects.equals(this.isActive, ssHServiceStatus.isActive) && + equalsNullable(this.bindings, ssHServiceStatus.bindings) && + equalsNullable(this.hostKeys, ssHServiceStatus.hostKeys) && + Objects.equals(this.sshCommands, ssHServiceStatus.sshCommands) && + Objects.equals(this.authentications, ssHServiceStatus.authentications) && + Objects.equals(this.publicKeyAlgorithms, ssHServiceStatus.publicKeyAlgorithms) && + Objects.equals(this.macs, ssHServiceStatus.macs) && + Objects.equals(this.kexAlgorithms, ssHServiceStatus.kexAlgorithms) && + Objects.equals(this.ciphers, ssHServiceStatus.ciphers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSHServiceStatus {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" bindings: ").append(toIndentedString(bindings)).append("\n"); + sb.append(" hostKeys: ").append(toIndentedString(hostKeys)).append("\n"); + sb.append(" sshCommands: ").append(toIndentedString(sshCommands)).append("\n"); + sb.append(" authentications: ").append(toIndentedString(authentications)).append("\n"); + sb.append(" publicKeyAlgorithms: ").append(toIndentedString(publicKeyAlgorithms)).append("\n"); + sb.append(" macs: ").append(toIndentedString(macs)).append("\n"); + sb.append(" kexAlgorithms: ").append(toIndentedString(kexAlgorithms)).append("\n"); + sb.append(" ciphers: ").append(toIndentedString(ciphers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Schedule.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Schedule.java new file mode 100644 index 00000000..497fb43c --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Schedule.java @@ -0,0 +1,196 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Schedule + */ +@JsonPropertyOrder({ + Schedule.JSON_PROPERTY_HOUR, + Schedule.JSON_PROPERTY_DAY_OF_WEEK, + Schedule.JSON_PROPERTY_DAY_OF_MONTH, + Schedule.JSON_PROPERTY_MONTH +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Schedule { + public static final String JSON_PROPERTY_HOUR = "hour"; + private String hour; + + public static final String JSON_PROPERTY_DAY_OF_WEEK = "day_of_week"; + private String dayOfWeek; + + public static final String JSON_PROPERTY_DAY_OF_MONTH = "day_of_month"; + private String dayOfMonth; + + public static final String JSON_PROPERTY_MONTH = "month"; + private String month; + + public Schedule() { + } + + public Schedule hour(String hour) { + + this.hour = hour; + return this; + } + + /** + * Get hour + * @return hour + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHour() { + return hour; + } + + + @JsonProperty(JSON_PROPERTY_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHour(String hour) { + this.hour = hour; + } + + public Schedule dayOfWeek(String dayOfWeek) { + + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Get dayOfWeek + * @return dayOfWeek + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDayOfWeek() { + return dayOfWeek; + } + + + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfWeek(String dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public Schedule dayOfMonth(String dayOfMonth) { + + this.dayOfMonth = dayOfMonth; + return this; + } + + /** + * Get dayOfMonth + * @return dayOfMonth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DAY_OF_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDayOfMonth() { + return dayOfMonth; + } + + + @JsonProperty(JSON_PROPERTY_DAY_OF_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfMonth(String dayOfMonth) { + this.dayOfMonth = dayOfMonth; + } + + public Schedule month(String month) { + + this.month = month; + return this; + } + + /** + * Get month + * @return month + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMonth() { + return month; + } + + + @JsonProperty(JSON_PROPERTY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMonth(String month) { + this.month = month; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Schedule schedule = (Schedule) o; + return Objects.equals(this.hour, schedule.hour) && + Objects.equals(this.dayOfWeek, schedule.dayOfWeek) && + Objects.equals(this.dayOfMonth, schedule.dayOfMonth) && + Objects.equals(this.month, schedule.month); + } + + @Override + public int hashCode() { + return Objects.hash(hour, dayOfWeek, dayOfMonth, month); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Schedule {\n"); + sb.append(" hour: ").append(toIndentedString(hour)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append(" dayOfMonth: ").append(toIndentedString(dayOfMonth)).append("\n"); + sb.append(" month: ").append(toIndentedString(month)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Secret.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Secret.java new file mode 100644 index 00000000..ea601bf2 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Secret.java @@ -0,0 +1,274 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The secret is encrypted before saving, so to set a new secret you must provide a payload and set the status to \"Plain\". The encryption key and additional data will be generated automatically. If you set the status to \"Redacted\" the existing secret will be preserved + */ +@JsonPropertyOrder({ + Secret.JSON_PROPERTY_STATUS, + Secret.JSON_PROPERTY_PAYLOAD, + Secret.JSON_PROPERTY_KEY, + Secret.JSON_PROPERTY_ADDITIONAL_DATA, + Secret.JSON_PROPERTY_MODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Secret { + /** + * Set to \"Plain\" to add or update an existing secret, set to \"Redacted\" to preserve the existing value + */ + public enum StatusEnum { + PLAIN("Plain"), + + AES_256_GCM("AES-256-GCM"), + + SECRETBOX("Secretbox"), + + GCP("GCP"), + + AWS("AWS"), + + VAULT_TRANSIT("VaultTransit"), + + AZURE_KEY_VAULT("AzureKeyVault"), + + REDACTED("Redacted"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_PAYLOAD = "payload"; + private String payload; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additional_data"; + private String additionalData; + + public static final String JSON_PROPERTY_MODE = "mode"; + private Integer mode; + + public Secret() { + } + + public Secret status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Set to \"Plain\" to add or update an existing secret, set to \"Redacted\" to preserve the existing value + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Secret payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPayload() { + return payload; + } + + + @JsonProperty(JSON_PROPERTY_PAYLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPayload(String payload) { + this.payload = payload; + } + + public Secret key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getKey() { + return key; + } + + + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKey(String key) { + this.key = key; + } + + public Secret additionalData(String additionalData) { + + this.additionalData = additionalData; + return this; + } + + /** + * Get additionalData + * @return additionalData + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAdditionalData() { + return additionalData; + } + + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalData(String additionalData) { + this.additionalData = additionalData; + } + + public Secret mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * 1 means encrypted using a master key + * @return mode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMode() { + return mode; + } + + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(Integer mode) { + this.mode = mode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Secret secret = (Secret) o; + return Objects.equals(this.status, secret.status) && + Objects.equals(this.payload, secret.payload) && + Objects.equals(this.key, secret.key) && + Objects.equals(this.additionalData, secret.additionalData) && + Objects.equals(this.mode, secret.mode); + } + + @Override + public int hashCode() { + return Objects.hash(status, payload, key, additionalData, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Secret {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatus.java new file mode 100644 index 00000000..e2829af0 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatus.java @@ -0,0 +1,327 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.DataProviderStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FTPServiceStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.MFAStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.SSHServiceStatus; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ServicesStatusDefender; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ServicesStatusRateLimiters; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.WebDAVServiceStatus; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ServicesStatus + */ +@JsonPropertyOrder({ + ServicesStatus.JSON_PROPERTY_SSH, + ServicesStatus.JSON_PROPERTY_FTP, + ServicesStatus.JSON_PROPERTY_WEBDAV, + ServicesStatus.JSON_PROPERTY_DATA_PROVIDER, + ServicesStatus.JSON_PROPERTY_DEFENDER, + ServicesStatus.JSON_PROPERTY_MFA, + ServicesStatus.JSON_PROPERTY_ALLOW_LIST, + ServicesStatus.JSON_PROPERTY_RATE_LIMITERS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ServicesStatus { + public static final String JSON_PROPERTY_SSH = "ssh"; + private SSHServiceStatus ssh; + + public static final String JSON_PROPERTY_FTP = "ftp"; + private FTPServiceStatus ftp; + + public static final String JSON_PROPERTY_WEBDAV = "webdav"; + private WebDAVServiceStatus webdav; + + public static final String JSON_PROPERTY_DATA_PROVIDER = "data_provider"; + private DataProviderStatus dataProvider; + + public static final String JSON_PROPERTY_DEFENDER = "defender"; + private ServicesStatusDefender defender; + + public static final String JSON_PROPERTY_MFA = "mfa"; + private MFAStatus mfa; + + public static final String JSON_PROPERTY_ALLOW_LIST = "allow_list"; + private ServicesStatusDefender allowList; + + public static final String JSON_PROPERTY_RATE_LIMITERS = "rate_limiters"; + private ServicesStatusRateLimiters rateLimiters; + + public ServicesStatus() { + } + + public ServicesStatus ssh(SSHServiceStatus ssh) { + + this.ssh = ssh; + return this; + } + + /** + * Get ssh + * @return ssh + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SSH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SSHServiceStatus getSsh() { + return ssh; + } + + + @JsonProperty(JSON_PROPERTY_SSH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSsh(SSHServiceStatus ssh) { + this.ssh = ssh; + } + + public ServicesStatus ftp(FTPServiceStatus ftp) { + + this.ftp = ftp; + return this; + } + + /** + * Get ftp + * @return ftp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FTP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FTPServiceStatus getFtp() { + return ftp; + } + + + @JsonProperty(JSON_PROPERTY_FTP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFtp(FTPServiceStatus ftp) { + this.ftp = ftp; + } + + public ServicesStatus webdav(WebDAVServiceStatus webdav) { + + this.webdav = webdav; + return this; + } + + /** + * Get webdav + * @return webdav + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEBDAV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public WebDAVServiceStatus getWebdav() { + return webdav; + } + + + @JsonProperty(JSON_PROPERTY_WEBDAV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebdav(WebDAVServiceStatus webdav) { + this.webdav = webdav; + } + + public ServicesStatus dataProvider(DataProviderStatus dataProvider) { + + this.dataProvider = dataProvider; + return this; + } + + /** + * Get dataProvider + * @return dataProvider + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public DataProviderStatus getDataProvider() { + return dataProvider; + } + + + @JsonProperty(JSON_PROPERTY_DATA_PROVIDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDataProvider(DataProviderStatus dataProvider) { + this.dataProvider = dataProvider; + } + + public ServicesStatus defender(ServicesStatusDefender defender) { + + this.defender = defender; + return this; + } + + /** + * Get defender + * @return defender + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServicesStatusDefender getDefender() { + return defender; + } + + + @JsonProperty(JSON_PROPERTY_DEFENDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefender(ServicesStatusDefender defender) { + this.defender = defender; + } + + public ServicesStatus mfa(MFAStatus mfa) { + + this.mfa = mfa; + return this; + } + + /** + * Get mfa + * @return mfa + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MFA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MFAStatus getMfa() { + return mfa; + } + + + @JsonProperty(JSON_PROPERTY_MFA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMfa(MFAStatus mfa) { + this.mfa = mfa; + } + + public ServicesStatus allowList(ServicesStatusDefender allowList) { + + this.allowList = allowList; + return this; + } + + /** + * Get allowList + * @return allowList + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServicesStatusDefender getAllowList() { + return allowList; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowList(ServicesStatusDefender allowList) { + this.allowList = allowList; + } + + public ServicesStatus rateLimiters(ServicesStatusRateLimiters rateLimiters) { + + this.rateLimiters = rateLimiters; + return this; + } + + /** + * Get rateLimiters + * @return rateLimiters + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMITERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServicesStatusRateLimiters getRateLimiters() { + return rateLimiters; + } + + + @JsonProperty(JSON_PROPERTY_RATE_LIMITERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRateLimiters(ServicesStatusRateLimiters rateLimiters) { + this.rateLimiters = rateLimiters; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServicesStatus servicesStatus = (ServicesStatus) o; + return Objects.equals(this.ssh, servicesStatus.ssh) && + Objects.equals(this.ftp, servicesStatus.ftp) && + Objects.equals(this.webdav, servicesStatus.webdav) && + Objects.equals(this.dataProvider, servicesStatus.dataProvider) && + Objects.equals(this.defender, servicesStatus.defender) && + Objects.equals(this.mfa, servicesStatus.mfa) && + Objects.equals(this.allowList, servicesStatus.allowList) && + Objects.equals(this.rateLimiters, servicesStatus.rateLimiters); + } + + @Override + public int hashCode() { + return Objects.hash(ssh, ftp, webdav, dataProvider, defender, mfa, allowList, rateLimiters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServicesStatus {\n"); + sb.append(" ssh: ").append(toIndentedString(ssh)).append("\n"); + sb.append(" ftp: ").append(toIndentedString(ftp)).append("\n"); + sb.append(" webdav: ").append(toIndentedString(webdav)).append("\n"); + sb.append(" dataProvider: ").append(toIndentedString(dataProvider)).append("\n"); + sb.append(" defender: ").append(toIndentedString(defender)).append("\n"); + sb.append(" mfa: ").append(toIndentedString(mfa)).append("\n"); + sb.append(" allowList: ").append(toIndentedString(allowList)).append("\n"); + sb.append(" rateLimiters: ").append(toIndentedString(rateLimiters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusDefender.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusDefender.java new file mode 100644 index 00000000..ec1a466d --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusDefender.java @@ -0,0 +1,104 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ServicesStatusDefender + */ +@JsonPropertyOrder({ + ServicesStatusDefender.JSON_PROPERTY_IS_ACTIVE +}) +@JsonTypeName("ServicesStatus_defender") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ServicesStatusDefender { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + private Boolean isActive; + + public ServicesStatusDefender() { + } + + public ServicesStatusDefender isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServicesStatusDefender servicesStatusDefender = (ServicesStatusDefender) o; + return Objects.equals(this.isActive, servicesStatusDefender.isActive); + } + + @Override + public int hashCode() { + return Objects.hash(isActive); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServicesStatusDefender {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusRateLimiters.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusRateLimiters.java new file mode 100644 index 00000000..ff64c8aa --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ServicesStatusRateLimiters.java @@ -0,0 +1,146 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ServicesStatusRateLimiters + */ +@JsonPropertyOrder({ + ServicesStatusRateLimiters.JSON_PROPERTY_IS_ACTIVE, + ServicesStatusRateLimiters.JSON_PROPERTY_PROTOCOLS +}) +@JsonTypeName("ServicesStatus_rate_limiters") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ServicesStatusRateLimiters { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + private Boolean isActive; + + public static final String JSON_PROPERTY_PROTOCOLS = "protocols"; + private List protocols = new ArrayList<>(); + + public ServicesStatusRateLimiters() { + } + + public ServicesStatusRateLimiters isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public ServicesStatusRateLimiters protocols(List protocols) { + + this.protocols = protocols; + return this; + } + + public ServicesStatusRateLimiters addProtocolsItem(String protocolsItem) { + if (this.protocols == null) { + this.protocols = new ArrayList<>(); + } + this.protocols.add(protocolsItem); + return this; + } + + /** + * Get protocols + * @return protocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProtocols() { + return protocols; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocols(List protocols) { + this.protocols = protocols; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServicesStatusRateLimiters servicesStatusRateLimiters = (ServicesStatusRateLimiters) o; + return Objects.equals(this.isActive, servicesStatusRateLimiters.isActive) && + Objects.equals(this.protocols, servicesStatusRateLimiters.protocols); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, protocols); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServicesStatusRateLimiters {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" protocols: ").append(toIndentedString(protocols)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SetpropsUserFileRequest.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SetpropsUserFileRequest.java new file mode 100644 index 00000000..c3efa759 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SetpropsUserFileRequest.java @@ -0,0 +1,104 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SetpropsUserFileRequest + */ +@JsonPropertyOrder({ + SetpropsUserFileRequest.JSON_PROPERTY_MODIFICATION_TIME +}) +@JsonTypeName("setprops_user_file_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class SetpropsUserFileRequest { + public static final String JSON_PROPERTY_MODIFICATION_TIME = "modification_time"; + private Integer modificationTime; + + public SetpropsUserFileRequest() { + } + + public SetpropsUserFileRequest modificationTime(Integer modificationTime) { + + this.modificationTime = modificationTime; + return this; + } + + /** + * File modification time as unix timestamp in milliseconds + * @return modificationTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFICATION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getModificationTime() { + return modificationTime; + } + + + @JsonProperty(JSON_PROPERTY_MODIFICATION_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModificationTime(Integer modificationTime) { + this.modificationTime = modificationTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetpropsUserFileRequest setpropsUserFileRequest = (SetpropsUserFileRequest) o; + return Objects.equals(this.modificationTime, setpropsUserFileRequest.modificationTime); + } + + @Override + public int hashCode() { + return Objects.hash(modificationTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetpropsUserFileRequest {\n"); + sb.append(" modificationTime: ").append(toIndentedString(modificationTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Share.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Share.java new file mode 100644 index 00000000..f82babb3 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Share.java @@ -0,0 +1,526 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.ShareScope; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Share + */ +@JsonPropertyOrder({ + Share.JSON_PROPERTY_ID, + Share.JSON_PROPERTY_NAME, + Share.JSON_PROPERTY_DESCRIPTION, + Share.JSON_PROPERTY_SCOPE, + Share.JSON_PROPERTY_PATHS, + Share.JSON_PROPERTY_USERNAME, + Share.JSON_PROPERTY_CREATED_AT, + Share.JSON_PROPERTY_UPDATED_AT, + Share.JSON_PROPERTY_LAST_USE_AT, + Share.JSON_PROPERTY_EXPIRES_AT, + Share.JSON_PROPERTY_PASSWORD, + Share.JSON_PROPERTY_MAX_TOKENS, + Share.JSON_PROPERTY_USED_TOKENS, + Share.JSON_PROPERTY_ALLOW_FROM +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Share { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_SCOPE = "scope"; + private ShareScope scope; + + public static final String JSON_PROPERTY_PATHS = "paths"; + private List paths = new ArrayList<>(); + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_LAST_USE_AT = "last_use_at"; + private Long lastUseAt; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private Long expiresAt; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_MAX_TOKENS = "max_tokens"; + private Integer maxTokens; + + public static final String JSON_PROPERTY_USED_TOKENS = "used_tokens"; + private Integer usedTokens; + + public static final String JSON_PROPERTY_ALLOW_FROM = "allow_from"; + private List allowFrom = new ArrayList<>(); + + public Share() { + } + + public Share id(String id) { + + this.id = id; + return this; + } + + /** + * auto-generated unique share identifier + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + } + + public Share name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public Share description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public Share scope(ShareScope scope) { + + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ShareScope getScope() { + return scope; + } + + + @JsonProperty(JSON_PROPERTY_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScope(ShareScope scope) { + this.scope = scope; + } + + public Share paths(List paths) { + + this.paths = paths; + return this; + } + + public Share addPathsItem(String pathsItem) { + if (this.paths == null) { + this.paths = new ArrayList<>(); + } + this.paths.add(pathsItem); + return this; + } + + /** + * paths to files or directories, for share scope write this array must contain exactly one directory. Paths will not be validated on save so you can also create them after creating the share + * @return paths + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPaths() { + return paths; + } + + + @JsonProperty(JSON_PROPERTY_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaths(List paths) { + this.paths = paths; + } + + public Share username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public Share createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public Share updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in milliseconds + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public Share lastUseAt(Long lastUseAt) { + + this.lastUseAt = lastUseAt; + return this; + } + + /** + * last use time as unix timestamp in milliseconds + * @return lastUseAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_USE_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastUseAt() { + return lastUseAt; + } + + + @JsonProperty(JSON_PROPERTY_LAST_USE_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastUseAt(Long lastUseAt) { + this.lastUseAt = lastUseAt; + } + + public Share expiresAt(Long expiresAt) { + + this.expiresAt = expiresAt; + return this; + } + + /** + * optional share expiration, as unix timestamp in milliseconds. 0 means no expiration + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(Long expiresAt) { + this.expiresAt = expiresAt; + } + + public Share password(String password) { + + this.password = password; + return this; + } + + /** + * optional password to protect the share. The special value \"[**redacted**]\" means that a password has been set, you can use this value if you want to preserve the current password when you update a share + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public Share maxTokens(Integer maxTokens) { + + this.maxTokens = maxTokens; + return this; + } + + /** + * maximum allowed access tokens. 0 means no limit + * @return maxTokens + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxTokens() { + return maxTokens; + } + + + @JsonProperty(JSON_PROPERTY_MAX_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxTokens(Integer maxTokens) { + this.maxTokens = maxTokens; + } + + public Share usedTokens(Integer usedTokens) { + + this.usedTokens = usedTokens; + return this; + } + + /** + * Get usedTokens + * @return usedTokens + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedTokens() { + return usedTokens; + } + + + @JsonProperty(JSON_PROPERTY_USED_TOKENS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedTokens(Integer usedTokens) { + this.usedTokens = usedTokens; + } + + public Share allowFrom(List allowFrom) { + + this.allowFrom = allowFrom; + return this; + } + + public Share addAllowFromItem(String allowFromItem) { + if (this.allowFrom == null) { + this.allowFrom = new ArrayList<>(); + } + this.allowFrom.add(allowFromItem); + return this; + } + + /** + * Limit the share availability to these IP/Mask. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example \"192.0.2.0/24\" or \"2001:db8::/32\". An empty list means no restrictions + * @return allowFrom + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAllowFrom() { + return allowFrom; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowFrom(List allowFrom) { + this.allowFrom = allowFrom; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Share share = (Share) o; + return Objects.equals(this.id, share.id) && + Objects.equals(this.name, share.name) && + Objects.equals(this.description, share.description) && + Objects.equals(this.scope, share.scope) && + Objects.equals(this.paths, share.paths) && + Objects.equals(this.username, share.username) && + Objects.equals(this.createdAt, share.createdAt) && + Objects.equals(this.updatedAt, share.updatedAt) && + Objects.equals(this.lastUseAt, share.lastUseAt) && + Objects.equals(this.expiresAt, share.expiresAt) && + Objects.equals(this.password, share.password) && + Objects.equals(this.maxTokens, share.maxTokens) && + Objects.equals(this.usedTokens, share.usedTokens) && + Objects.equals(this.allowFrom, share.allowFrom); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, scope, paths, username, createdAt, updatedAt, lastUseAt, expiresAt, password, maxTokens, usedTokens, allowFrom); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Share {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastUseAt: ").append(toIndentedString(lastUseAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" maxTokens: ").append(toIndentedString(maxTokens)).append("\n"); + sb.append(" usedTokens: ").append(toIndentedString(usedTokens)).append("\n"); + sb.append(" allowFrom: ").append(toIndentedString(allowFrom)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ShareScope.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ShareScope.java new file mode 100644 index 00000000..0d9bdfa2 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ShareScope.java @@ -0,0 +1,59 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Options: * `1` - read scope * `2` - write scope + */ +public enum ShareScope { + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + ShareScope(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ShareScope fromValue(Integer value) { + for (ShareScope b : ShareScope.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SupportedProtocols.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SupportedProtocols.java new file mode 100644 index 00000000..e2c903c9 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/SupportedProtocols.java @@ -0,0 +1,63 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Protocols: * `SSH` - includes both SFTP and SSH commands * `FTP` - plain FTP and FTPES/FTPS * `DAV` - WebDAV over HTTP/HTTPS * `HTTP` - WebClient/REST API + */ +public enum SupportedProtocols { + + SSH("SSH"), + + FTP("FTP"), + + DAV("DAV"), + + HTTP("HTTP"); + + private String value; + + SupportedProtocols(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SupportedProtocols fromValue(String value) { + for (SupportedProtocols b : SupportedProtocols.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TLSVersions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TLSVersions.java new file mode 100644 index 00000000..53686fed --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TLSVersions.java @@ -0,0 +1,59 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * TLS version: * `12` - TLS 1.2 * `13` - TLS 1.3 + */ +public enum TLSVersions { + + NUMBER_12(12), + + NUMBER_13(13); + + private Integer value; + + TLSVersions(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TLSVersions fromValue(Integer value) { + for (TLSVersions b : TLSVersions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPConfig.java new file mode 100644 index 00000000..65ed58c8 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPConfig.java @@ -0,0 +1,166 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TOTPHMacAlgo; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TOTPConfig + */ +@JsonPropertyOrder({ + TOTPConfig.JSON_PROPERTY_NAME, + TOTPConfig.JSON_PROPERTY_ISSUER, + TOTPConfig.JSON_PROPERTY_ALGO +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class TOTPConfig { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ISSUER = "issuer"; + private String issuer; + + public static final String JSON_PROPERTY_ALGO = "algo"; + private TOTPHMacAlgo algo; + + public TOTPConfig() { + } + + public TOTPConfig name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public TOTPConfig issuer(String issuer) { + + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getIssuer() { + return issuer; + } + + + @JsonProperty(JSON_PROPERTY_ISSUER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + public TOTPConfig algo(TOTPHMacAlgo algo) { + + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TOTPHMacAlgo getAlgo() { + return algo; + } + + + @JsonProperty(JSON_PROPERTY_ALGO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAlgo(TOTPHMacAlgo algo) { + this.algo = algo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TOTPConfig toTPConfig = (TOTPConfig) o; + return Objects.equals(this.name, toTPConfig.name) && + Objects.equals(this.issuer, toTPConfig.issuer) && + Objects.equals(this.algo, toTPConfig.algo); + } + + @Override + public int hashCode() { + return Objects.hash(name, issuer, algo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TOTPConfig {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPHMacAlgo.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPHMacAlgo.java new file mode 100644 index 00000000..2536b7da --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TOTPHMacAlgo.java @@ -0,0 +1,61 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Supported HMAC algorithms for Time-based one time passwords + */ +public enum TOTPHMacAlgo { + + SHA1("sha1"), + + SHA256("sha256"), + + SHA512("sha512"); + + private String value; + + TOTPHMacAlgo(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TOTPHMacAlgo fromValue(String value) { + for (TOTPHMacAlgo b : TOTPHMacAlgo.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TimePeriod.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TimePeriod.java new file mode 100644 index 00000000..68622bde --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TimePeriod.java @@ -0,0 +1,210 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TimePeriod + */ +@JsonPropertyOrder({ + TimePeriod.JSON_PROPERTY_DAY_OF_WEEK, + TimePeriod.JSON_PROPERTY_FROM, + TimePeriod.JSON_PROPERTY_TO +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class TimePeriod { + /** + * Day of week, 0 Sunday, 6 Saturday + */ + public enum DayOfWeekEnum { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + DayOfWeekEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static DayOfWeekEnum fromValue(Integer value) { + for (DayOfWeekEnum b : DayOfWeekEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_DAY_OF_WEEK = "day_of_week"; + private DayOfWeekEnum dayOfWeek; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_TO = "to"; + private String to; + + public TimePeriod() { + } + + public TimePeriod dayOfWeek(DayOfWeekEnum dayOfWeek) { + + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Day of week, 0 Sunday, 6 Saturday + * @return dayOfWeek + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public DayOfWeekEnum getDayOfWeek() { + return dayOfWeek; + } + + + @JsonProperty(JSON_PROPERTY_DAY_OF_WEEK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDayOfWeek(DayOfWeekEnum dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public TimePeriod from(String from) { + + this.from = from; + return this; + } + + /** + * Start time in HH:MM format + * @return from + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFrom() { + return from; + } + + + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrom(String from) { + this.from = from; + } + + public TimePeriod to(String to) { + + this.to = to; + return this; + } + + /** + * End time in HH:MM format + * @return to + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTo() { + return to; + } + + + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTo(String to) { + this.to = to; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimePeriod timePeriod = (TimePeriod) o; + return Objects.equals(this.dayOfWeek, timePeriod.dayOfWeek) && + Objects.equals(this.from, timePeriod.from) && + Objects.equals(this.to, timePeriod.to); + } + + @Override + public int hashCode() { + return Objects.hash(dayOfWeek, from, to); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimePeriod {\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Token.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Token.java new file mode 100644 index 00000000..e6b9fd63 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Token.java @@ -0,0 +1,135 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Token + */ +@JsonPropertyOrder({ + Token.JSON_PROPERTY_ACCESS_TOKEN, + Token.JSON_PROPERTY_EXPIRES_AT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Token { + public static final String JSON_PROPERTY_ACCESS_TOKEN = "access_token"; + private String accessToken; + + public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; + private OffsetDateTime expiresAt; + + public Token() { + } + + public Token accessToken(String accessToken) { + + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAccessToken() { + return accessToken; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public Token expiresAt(OffsetDateTime expiresAt) { + + this.expiresAt = expiresAt; + return this; + } + + /** + * Get expiresAt + * @return expiresAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiresAt(OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Token token = (Token) o; + return Objects.equals(this.accessToken, token.accessToken) && + Objects.equals(this.expiresAt, token.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Token {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Transfer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Transfer.java new file mode 100644 index 00000000..72b25c96 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/Transfer.java @@ -0,0 +1,231 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Transfer + */ +@JsonPropertyOrder({ + Transfer.JSON_PROPERTY_OPERATION_TYPE, + Transfer.JSON_PROPERTY_PATH, + Transfer.JSON_PROPERTY_START_TIME, + Transfer.JSON_PROPERTY_SIZE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class Transfer { + /** + * Operations: * `upload` * `download` + */ + public enum OperationTypeEnum { + UPLOAD("upload"), + + DOWNLOAD("download"); + + private String value; + + OperationTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OperationTypeEnum fromValue(String value) { + for (OperationTypeEnum b : OperationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_OPERATION_TYPE = "operation_type"; + private OperationTypeEnum operationType; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_START_TIME = "start_time"; + private Long startTime; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public Transfer() { + } + + public Transfer operationType(OperationTypeEnum operationType) { + + this.operationType = operationType; + return this; + } + + /** + * Operations: * `upload` * `download` + * @return operationType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OperationTypeEnum getOperationType() { + return operationType; + } + + + @JsonProperty(JSON_PROPERTY_OPERATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOperationType(OperationTypeEnum operationType) { + this.operationType = operationType; + } + + public Transfer path(String path) { + + this.path = path; + return this; + } + + /** + * file path for the upload/download + * @return path + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPath(String path) { + this.path = path; + } + + public Transfer startTime(Long startTime) { + + this.startTime = startTime; + return this; + } + + /** + * start time as unix timestamp in milliseconds + * @return startTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getStartTime() { + return startTime; + } + + + @JsonProperty(JSON_PROPERTY_START_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public Transfer size(Long size) { + + this.size = size; + return this; + } + + /** + * bytes transferred + * @return size + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(Long size) { + this.size = size; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Transfer transfer = (Transfer) o; + return Objects.equals(this.operationType, transfer.operationType) && + Objects.equals(this.path, transfer.path) && + Objects.equals(this.startTime, transfer.startTime) && + Objects.equals(this.size, transfer.size); + } + + @Override + public int hashCode() { + return Objects.hash(operationType, path, startTime, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Transfer {\n"); + sb.append(" operationType: ").append(toIndentedString(operationType)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TransferQuotaUsage.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TransferQuotaUsage.java new file mode 100644 index 00000000..1770b3ac --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/TransferQuotaUsage.java @@ -0,0 +1,134 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TransferQuotaUsage + */ +@JsonPropertyOrder({ + TransferQuotaUsage.JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER, + TransferQuotaUsage.JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class TransferQuotaUsage { + public static final String JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER = "used_upload_data_transfer"; + private Long usedUploadDataTransfer; + + public static final String JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER = "used_download_data_transfer"; + private Long usedDownloadDataTransfer; + + public TransferQuotaUsage() { + } + + public TransferQuotaUsage usedUploadDataTransfer(Long usedUploadDataTransfer) { + + this.usedUploadDataTransfer = usedUploadDataTransfer; + return this; + } + + /** + * The value must be specified as bytes + * @return usedUploadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedUploadDataTransfer() { + return usedUploadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedUploadDataTransfer(Long usedUploadDataTransfer) { + this.usedUploadDataTransfer = usedUploadDataTransfer; + } + + public TransferQuotaUsage usedDownloadDataTransfer(Long usedDownloadDataTransfer) { + + this.usedDownloadDataTransfer = usedDownloadDataTransfer; + return this; + } + + /** + * The value must be specified as bytes + * @return usedDownloadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedDownloadDataTransfer() { + return usedDownloadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedDownloadDataTransfer(Long usedDownloadDataTransfer) { + this.usedDownloadDataTransfer = usedDownloadDataTransfer; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferQuotaUsage transferQuotaUsage = (TransferQuotaUsage) o; + return Objects.equals(this.usedUploadDataTransfer, transferQuotaUsage.usedUploadDataTransfer) && + Objects.equals(this.usedDownloadDataTransfer, transferQuotaUsage.usedDownloadDataTransfer); + } + + @Override + public int hashCode() { + return Objects.hash(usedUploadDataTransfer, usedDownloadDataTransfer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferQuotaUsage {\n"); + sb.append(" usedUploadDataTransfer: ").append(toIndentedString(usedUploadDataTransfer)).append("\n"); + sb.append(" usedDownloadDataTransfer: ").append(toIndentedString(usedDownloadDataTransfer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/User.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/User.java new file mode 100644 index 00000000..38398b81 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/User.java @@ -0,0 +1,1371 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FilesystemConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.GroupMapping; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Permission; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.UserFilters; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.VirtualFolder; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * User + */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_STATUS, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_DESCRIPTION, + User.JSON_PROPERTY_EXPIRATION_DATE, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PUBLIC_KEYS, + User.JSON_PROPERTY_HAS_PASSWORD, + User.JSON_PROPERTY_HOME_DIR, + User.JSON_PROPERTY_VIRTUAL_FOLDERS, + User.JSON_PROPERTY_UID, + User.JSON_PROPERTY_GID, + User.JSON_PROPERTY_MAX_SESSIONS, + User.JSON_PROPERTY_QUOTA_SIZE, + User.JSON_PROPERTY_QUOTA_FILES, + User.JSON_PROPERTY_PERMISSIONS, + User.JSON_PROPERTY_USED_QUOTA_SIZE, + User.JSON_PROPERTY_USED_QUOTA_FILES, + User.JSON_PROPERTY_LAST_QUOTA_UPDATE, + User.JSON_PROPERTY_UPLOAD_BANDWIDTH, + User.JSON_PROPERTY_DOWNLOAD_BANDWIDTH, + User.JSON_PROPERTY_UPLOAD_DATA_TRANSFER, + User.JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER, + User.JSON_PROPERTY_TOTAL_DATA_TRANSFER, + User.JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER, + User.JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER, + User.JSON_PROPERTY_CREATED_AT, + User.JSON_PROPERTY_UPDATED_AT, + User.JSON_PROPERTY_LAST_LOGIN, + User.JSON_PROPERTY_FIRST_DOWNLOAD, + User.JSON_PROPERTY_FIRST_UPLOAD, + User.JSON_PROPERTY_LAST_PASSWORD_CHANGE, + User.JSON_PROPERTY_FILTERS, + User.JSON_PROPERTY_FILESYSTEM, + User.JSON_PROPERTY_ADDITIONAL_INFO, + User.JSON_PROPERTY_GROUPS, + User.JSON_PROPERTY_OIDC_CUSTOM_FIELDS, + User.JSON_PROPERTY_ROLE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class User { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + /** + * status: * `0` user is disabled, login is not allowed * `1` user is enabled + */ + public enum StatusEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + StatusEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(Integer value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private Long expirationDate; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PUBLIC_KEYS = "public_keys"; + private List publicKeys = new ArrayList<>(); + + public static final String JSON_PROPERTY_HAS_PASSWORD = "has_password"; + private Boolean hasPassword; + + public static final String JSON_PROPERTY_HOME_DIR = "home_dir"; + private String homeDir; + + public static final String JSON_PROPERTY_VIRTUAL_FOLDERS = "virtual_folders"; + private List virtualFolders = new ArrayList<>(); + + public static final String JSON_PROPERTY_UID = "uid"; + private Integer uid; + + public static final String JSON_PROPERTY_GID = "gid"; + private Integer gid; + + public static final String JSON_PROPERTY_MAX_SESSIONS = "max_sessions"; + private Integer maxSessions; + + public static final String JSON_PROPERTY_QUOTA_SIZE = "quota_size"; + private Long quotaSize; + + public static final String JSON_PROPERTY_QUOTA_FILES = "quota_files"; + private Integer quotaFiles; + + public static final String JSON_PROPERTY_PERMISSIONS = "permissions"; + private Map> permissions = new HashMap<>(); + + public static final String JSON_PROPERTY_USED_QUOTA_SIZE = "used_quota_size"; + private Long usedQuotaSize; + + public static final String JSON_PROPERTY_USED_QUOTA_FILES = "used_quota_files"; + private Integer usedQuotaFiles; + + public static final String JSON_PROPERTY_LAST_QUOTA_UPDATE = "last_quota_update"; + private Long lastQuotaUpdate; + + public static final String JSON_PROPERTY_UPLOAD_BANDWIDTH = "upload_bandwidth"; + private Integer uploadBandwidth; + + public static final String JSON_PROPERTY_DOWNLOAD_BANDWIDTH = "download_bandwidth"; + private Integer downloadBandwidth; + + public static final String JSON_PROPERTY_UPLOAD_DATA_TRANSFER = "upload_data_transfer"; + private Integer uploadDataTransfer; + + public static final String JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER = "download_data_transfer"; + private Integer downloadDataTransfer; + + public static final String JSON_PROPERTY_TOTAL_DATA_TRANSFER = "total_data_transfer"; + private Integer totalDataTransfer; + + public static final String JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER = "used_upload_data_transfer"; + private Integer usedUploadDataTransfer; + + public static final String JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER = "used_download_data_transfer"; + private Integer usedDownloadDataTransfer; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_LAST_LOGIN = "last_login"; + private Long lastLogin; + + public static final String JSON_PROPERTY_FIRST_DOWNLOAD = "first_download"; + private Long firstDownload; + + public static final String JSON_PROPERTY_FIRST_UPLOAD = "first_upload"; + private Long firstUpload; + + public static final String JSON_PROPERTY_LAST_PASSWORD_CHANGE = "last_password_change"; + private Long lastPasswordChange; + + public static final String JSON_PROPERTY_FILTERS = "filters"; + private UserFilters filters; + + public static final String JSON_PROPERTY_FILESYSTEM = "filesystem"; + private FilesystemConfig filesystem; + + public static final String JSON_PROPERTY_ADDITIONAL_INFO = "additional_info"; + private String additionalInfo; + + public static final String JSON_PROPERTY_GROUPS = "groups"; + private List groups = new ArrayList<>(); + + public static final String JSON_PROPERTY_OIDC_CUSTOM_FIELDS = "oidc_custom_fields"; + private Map oidcCustomFields = new HashMap<>(); + + public static final String JSON_PROPERTY_ROLE = "role"; + private String role; + + public User() { + } + + public User id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public User status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * status: * `0` user is disabled, login is not allowed * `1` user is enabled + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public User username(String username) { + + this.username = username; + return this; + } + + /** + * username is unique + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User description(String description) { + + this.description = description; + return this; + } + + /** + * optional description, for example the user full name + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public User expirationDate(Long expirationDate) { + + this.expirationDate = expirationDate; + return this; + } + + /** + * expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration + * @return expirationDate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getExpirationDate() { + return expirationDate; + } + + + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpirationDate(Long expirationDate) { + this.expirationDate = expirationDate; + } + + public User password(String password) { + + this.password = password; + return this; + } + + /** + * If the password has no known hashing algo prefix it will be stored, by default, using bcrypt, argon2id is supported too. You can send a password hashed as bcrypt ($2a$ prefix), argon2id, pbkdf2 or unix crypt and it will be stored as is. For security reasons this field is omitted when you search/get users + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User publicKeys(List publicKeys) { + + this.publicKeys = publicKeys; + return this; + } + + public User addPublicKeysItem(String publicKeysItem) { + if (this.publicKeys == null) { + this.publicKeys = new ArrayList<>(); + } + this.publicKeys.add(publicKeysItem); + return this; + } + + /** + * Public keys in OpenSSH format. + * @return publicKeys + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPublicKeys() { + return publicKeys; + } + + + @JsonProperty(JSON_PROPERTY_PUBLIC_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + } + + public User hasPassword(Boolean hasPassword) { + + this.hasPassword = hasPassword; + return this; + } + + /** + * Indicates whether the password is set + * @return hasPassword + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getHasPassword() { + return hasPassword; + } + + + @JsonProperty(JSON_PROPERTY_HAS_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasPassword(Boolean hasPassword) { + this.hasPassword = hasPassword; + } + + public User homeDir(String homeDir) { + + this.homeDir = homeDir; + return this; + } + + /** + * path to the user home directory. The user cannot upload or download files outside this directory. SFTPGo tries to automatically create this folder if missing. Must be an absolute path + * @return homeDir + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOME_DIR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getHomeDir() { + return homeDir; + } + + + @JsonProperty(JSON_PROPERTY_HOME_DIR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHomeDir(String homeDir) { + this.homeDir = homeDir; + } + + public User virtualFolders(List virtualFolders) { + + this.virtualFolders = virtualFolders; + return this; + } + + public User addVirtualFoldersItem(VirtualFolder virtualFoldersItem) { + if (this.virtualFolders == null) { + this.virtualFolders = new ArrayList<>(); + } + this.virtualFolders.add(virtualFoldersItem); + return this; + } + + /** + * mapping between virtual SFTPGo paths and virtual folders + * @return virtualFolders + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIRTUAL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getVirtualFolders() { + return virtualFolders; + } + + + @JsonProperty(JSON_PROPERTY_VIRTUAL_FOLDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVirtualFolders(List virtualFolders) { + this.virtualFolders = virtualFolders; + } + + public User uid(Integer uid) { + + this.uid = uid; + return this; + } + + /** + * if you run SFTPGo as root user, the created files and directories will be assigned to this uid. 0 means no change, the owner will be the user that runs SFTPGo. Ignored on windows + * minimum: 0 + * maximum: 2147483647 + * @return uid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUid() { + return uid; + } + + + @JsonProperty(JSON_PROPERTY_UID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUid(Integer uid) { + this.uid = uid; + } + + public User gid(Integer gid) { + + this.gid = gid; + return this; + } + + /** + * if you run SFTPGo as root user, the created files and directories will be assigned to this gid. 0 means no change, the group will be the one of the user that runs SFTPGo. Ignored on windows + * minimum: 0 + * maximum: 2147483647 + * @return gid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getGid() { + return gid; + } + + + @JsonProperty(JSON_PROPERTY_GID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGid(Integer gid) { + this.gid = gid; + } + + public User maxSessions(Integer maxSessions) { + + this.maxSessions = maxSessions; + return this; + } + + /** + * Limit the sessions that a user can open. 0 means unlimited + * @return maxSessions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxSessions() { + return maxSessions; + } + + + @JsonProperty(JSON_PROPERTY_MAX_SESSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxSessions(Integer maxSessions) { + this.maxSessions = maxSessions; + } + + public User quotaSize(Long quotaSize) { + + this.quotaSize = quotaSize; + return this; + } + + /** + * Quota as size in bytes. 0 means unlimited. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + * @return quotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuotaSize() { + return quotaSize; + } + + + @JsonProperty(JSON_PROPERTY_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotaSize(Long quotaSize) { + this.quotaSize = quotaSize; + } + + public User quotaFiles(Integer quotaFiles) { + + this.quotaFiles = quotaFiles; + return this; + } + + /** + * Quota as number of files. 0 means unlimited. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + * @return quotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuotaFiles() { + return quotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotaFiles(Integer quotaFiles) { + this.quotaFiles = quotaFiles; + } + + public User permissions(Map> permissions) { + + this.permissions = permissions; + return this; + } + + public User putPermissionsItem(String key, List permissionsItem) { + if (this.permissions == null) { + this.permissions = new HashMap<>(); + } + this.permissions.put(key, permissionsItem); + return this; + } + + /** + * hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory (\"/\") are required + * @return permissions + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getPermissions() { + return permissions; + } + + + @JsonProperty(JSON_PROPERTY_PERMISSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPermissions(Map> permissions) { + this.permissions = permissions; + } + + public User usedQuotaSize(Long usedQuotaSize) { + + this.usedQuotaSize = usedQuotaSize; + return this; + } + + /** + * Get usedQuotaSize + * @return usedQuotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedQuotaSize() { + return usedQuotaSize; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaSize(Long usedQuotaSize) { + this.usedQuotaSize = usedQuotaSize; + } + + public User usedQuotaFiles(Integer usedQuotaFiles) { + + this.usedQuotaFiles = usedQuotaFiles; + return this; + } + + /** + * Get usedQuotaFiles + * @return usedQuotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedQuotaFiles() { + return usedQuotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaFiles(Integer usedQuotaFiles) { + this.usedQuotaFiles = usedQuotaFiles; + } + + public User lastQuotaUpdate(Long lastQuotaUpdate) { + + this.lastQuotaUpdate = lastQuotaUpdate; + return this; + } + + /** + * Last quota update as unix timestamp in milliseconds + * @return lastQuotaUpdate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_QUOTA_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastQuotaUpdate() { + return lastQuotaUpdate; + } + + + @JsonProperty(JSON_PROPERTY_LAST_QUOTA_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastQuotaUpdate(Long lastQuotaUpdate) { + this.lastQuotaUpdate = lastQuotaUpdate; + } + + public User uploadBandwidth(Integer uploadBandwidth) { + + this.uploadBandwidth = uploadBandwidth; + return this; + } + + /** + * Maximum upload bandwidth as KB/s, 0 means unlimited + * @return uploadBandwidth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadBandwidth() { + return uploadBandwidth; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadBandwidth(Integer uploadBandwidth) { + this.uploadBandwidth = uploadBandwidth; + } + + public User downloadBandwidth(Integer downloadBandwidth) { + + this.downloadBandwidth = downloadBandwidth; + return this; + } + + /** + * Maximum download bandwidth as KB/s, 0 means unlimited + * @return downloadBandwidth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadBandwidth() { + return downloadBandwidth; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_BANDWIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadBandwidth(Integer downloadBandwidth) { + this.downloadBandwidth = downloadBandwidth; + } + + public User uploadDataTransfer(Integer uploadDataTransfer) { + + this.uploadDataTransfer = uploadDataTransfer; + return this; + } + + /** + * Maximum data transfer allowed for uploads as MB. 0 means no limit + * @return uploadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUploadDataTransfer() { + return uploadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUploadDataTransfer(Integer uploadDataTransfer) { + this.uploadDataTransfer = uploadDataTransfer; + } + + public User downloadDataTransfer(Integer downloadDataTransfer) { + + this.downloadDataTransfer = downloadDataTransfer; + return this; + } + + /** + * Maximum data transfer allowed for downloads as MB. 0 means no limit + * @return downloadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDownloadDataTransfer() { + return downloadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDownloadDataTransfer(Integer downloadDataTransfer) { + this.downloadDataTransfer = downloadDataTransfer; + } + + public User totalDataTransfer(Integer totalDataTransfer) { + + this.totalDataTransfer = totalDataTransfer; + return this; + } + + /** + * Maximum total data transfer as MB. 0 means unlimited. You can set a total data transfer instead of the individual values for uploads and downloads + * @return totalDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTotalDataTransfer() { + return totalDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_TOTAL_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalDataTransfer(Integer totalDataTransfer) { + this.totalDataTransfer = totalDataTransfer; + } + + public User usedUploadDataTransfer(Integer usedUploadDataTransfer) { + + this.usedUploadDataTransfer = usedUploadDataTransfer; + return this; + } + + /** + * Uploaded size, as bytes, since the last reset + * @return usedUploadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedUploadDataTransfer() { + return usedUploadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_USED_UPLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedUploadDataTransfer(Integer usedUploadDataTransfer) { + this.usedUploadDataTransfer = usedUploadDataTransfer; + } + + public User usedDownloadDataTransfer(Integer usedDownloadDataTransfer) { + + this.usedDownloadDataTransfer = usedDownloadDataTransfer; + return this; + } + + /** + * Downloaded size, as bytes, since the last reset + * @return usedDownloadDataTransfer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedDownloadDataTransfer() { + return usedDownloadDataTransfer; + } + + + @JsonProperty(JSON_PROPERTY_USED_DOWNLOAD_DATA_TRANSFER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedDownloadDataTransfer(Integer usedDownloadDataTransfer) { + this.usedDownloadDataTransfer = usedDownloadDataTransfer; + } + + public User createdAt(Long createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * creation time as unix timestamp in milliseconds. It will be 0 for users created before v2.2.0 + * @return createdAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getCreatedAt() { + return createdAt; + } + + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public User updatedAt(Long updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * last update time as unix timestamp in milliseconds + * @return updatedAt + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUpdatedAt() { + return updatedAt; + } + + + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public User lastLogin(Long lastLogin) { + + this.lastLogin = lastLogin; + return this; + } + + /** + * Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes + * @return lastLogin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastLogin() { + return lastLogin; + } + + + @JsonProperty(JSON_PROPERTY_LAST_LOGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastLogin(Long lastLogin) { + this.lastLogin = lastLogin; + } + + public User firstDownload(Long firstDownload) { + + this.firstDownload = firstDownload; + return this; + } + + /** + * first download time as unix timestamp in milliseconds + * @return firstDownload + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_DOWNLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFirstDownload() { + return firstDownload; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_DOWNLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstDownload(Long firstDownload) { + this.firstDownload = firstDownload; + } + + public User firstUpload(Long firstUpload) { + + this.firstUpload = firstUpload; + return this; + } + + /** + * first upload time as unix timestamp in milliseconds + * @return firstUpload + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getFirstUpload() { + return firstUpload; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_UPLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstUpload(Long firstUpload) { + this.firstUpload = firstUpload; + } + + public User lastPasswordChange(Long lastPasswordChange) { + + this.lastPasswordChange = lastPasswordChange; + return this; + } + + /** + * last password change time as unix timestamp in milliseconds + * @return lastPasswordChange + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_PASSWORD_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastPasswordChange() { + return lastPasswordChange; + } + + + @JsonProperty(JSON_PROPERTY_LAST_PASSWORD_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastPasswordChange(Long lastPasswordChange) { + this.lastPasswordChange = lastPasswordChange; + } + + public User filters(UserFilters filters) { + + this.filters = filters; + return this; + } + + /** + * Get filters + * @return filters + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserFilters getFilters() { + return filters; + } + + + @JsonProperty(JSON_PROPERTY_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilters(UserFilters filters) { + this.filters = filters; + } + + public User filesystem(FilesystemConfig filesystem) { + + this.filesystem = filesystem; + return this; + } + + /** + * Get filesystem + * @return filesystem + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FilesystemConfig getFilesystem() { + return filesystem; + } + + + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesystem(FilesystemConfig filesystem) { + this.filesystem = filesystem; + } + + public User additionalInfo(String additionalInfo) { + + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Free form text field for external systems + * @return additionalInfo + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDITIONAL_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAdditionalInfo() { + return additionalInfo; + } + + + @JsonProperty(JSON_PROPERTY_ADDITIONAL_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAdditionalInfo(String additionalInfo) { + this.additionalInfo = additionalInfo; + } + + public User groups(List groups) { + + this.groups = groups; + return this; + } + + public User addGroupsItem(GroupMapping groupsItem) { + if (this.groups == null) { + this.groups = new ArrayList<>(); + } + this.groups.add(groupsItem); + return this; + } + + /** + * Get groups + * @return groups + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getGroups() { + return groups; + } + + + @JsonProperty(JSON_PROPERTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGroups(List groups) { + this.groups = groups; + } + + public User oidcCustomFields(Map oidcCustomFields) { + + this.oidcCustomFields = oidcCustomFields; + return this; + } + + public User putOidcCustomFieldsItem(String key, Object oidcCustomFieldsItem) { + if (this.oidcCustomFields == null) { + this.oidcCustomFields = new HashMap<>(); + } + this.oidcCustomFields.put(key, oidcCustomFieldsItem); + return this; + } + + /** + * This field is passed to the pre-login hook if custom OIDC token fields have been configured. Field values can be of any type (this is a free form object) and depend on the type of the configured OIDC token fields + * @return oidcCustomFields + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OIDC_CUSTOM_FIELDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getOidcCustomFields() { + return oidcCustomFields; + } + + + @JsonProperty(JSON_PROPERTY_OIDC_CUSTOM_FIELDS) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setOidcCustomFields(Map oidcCustomFields) { + this.oidcCustomFields = oidcCustomFields; + } + + public User role(String role) { + + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRole() { + return role; + } + + + @JsonProperty(JSON_PROPERTY_ROLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRole(String role) { + this.role = role; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.status, user.status) && + Objects.equals(this.username, user.username) && + Objects.equals(this.email, user.email) && + Objects.equals(this.description, user.description) && + Objects.equals(this.expirationDate, user.expirationDate) && + Objects.equals(this.password, user.password) && + Objects.equals(this.publicKeys, user.publicKeys) && + Objects.equals(this.hasPassword, user.hasPassword) && + Objects.equals(this.homeDir, user.homeDir) && + Objects.equals(this.virtualFolders, user.virtualFolders) && + Objects.equals(this.uid, user.uid) && + Objects.equals(this.gid, user.gid) && + Objects.equals(this.maxSessions, user.maxSessions) && + Objects.equals(this.quotaSize, user.quotaSize) && + Objects.equals(this.quotaFiles, user.quotaFiles) && + Objects.equals(this.permissions, user.permissions) && + Objects.equals(this.usedQuotaSize, user.usedQuotaSize) && + Objects.equals(this.usedQuotaFiles, user.usedQuotaFiles) && + Objects.equals(this.lastQuotaUpdate, user.lastQuotaUpdate) && + Objects.equals(this.uploadBandwidth, user.uploadBandwidth) && + Objects.equals(this.downloadBandwidth, user.downloadBandwidth) && + Objects.equals(this.uploadDataTransfer, user.uploadDataTransfer) && + Objects.equals(this.downloadDataTransfer, user.downloadDataTransfer) && + Objects.equals(this.totalDataTransfer, user.totalDataTransfer) && + Objects.equals(this.usedUploadDataTransfer, user.usedUploadDataTransfer) && + Objects.equals(this.usedDownloadDataTransfer, user.usedDownloadDataTransfer) && + Objects.equals(this.createdAt, user.createdAt) && + Objects.equals(this.updatedAt, user.updatedAt) && + Objects.equals(this.lastLogin, user.lastLogin) && + Objects.equals(this.firstDownload, user.firstDownload) && + Objects.equals(this.firstUpload, user.firstUpload) && + Objects.equals(this.lastPasswordChange, user.lastPasswordChange) && + Objects.equals(this.filters, user.filters) && + Objects.equals(this.filesystem, user.filesystem) && + Objects.equals(this.additionalInfo, user.additionalInfo) && + Objects.equals(this.groups, user.groups) && + Objects.equals(this.oidcCustomFields, user.oidcCustomFields) && + Objects.equals(this.role, user.role); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, username, email, description, expirationDate, password, publicKeys, hasPassword, homeDir, virtualFolders, uid, gid, maxSessions, quotaSize, quotaFiles, permissions, usedQuotaSize, usedQuotaFiles, lastQuotaUpdate, uploadBandwidth, downloadBandwidth, uploadDataTransfer, downloadDataTransfer, totalDataTransfer, usedUploadDataTransfer, usedDownloadDataTransfer, createdAt, updatedAt, lastLogin, firstDownload, firstUpload, lastPasswordChange, filters, filesystem, additionalInfo, groups, oidcCustomFields, role); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" publicKeys: ").append(toIndentedString(publicKeys)).append("\n"); + sb.append(" hasPassword: ").append(toIndentedString(hasPassword)).append("\n"); + sb.append(" homeDir: ").append(toIndentedString(homeDir)).append("\n"); + sb.append(" virtualFolders: ").append(toIndentedString(virtualFolders)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" gid: ").append(toIndentedString(gid)).append("\n"); + sb.append(" maxSessions: ").append(toIndentedString(maxSessions)).append("\n"); + sb.append(" quotaSize: ").append(toIndentedString(quotaSize)).append("\n"); + sb.append(" quotaFiles: ").append(toIndentedString(quotaFiles)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" usedQuotaSize: ").append(toIndentedString(usedQuotaSize)).append("\n"); + sb.append(" usedQuotaFiles: ").append(toIndentedString(usedQuotaFiles)).append("\n"); + sb.append(" lastQuotaUpdate: ").append(toIndentedString(lastQuotaUpdate)).append("\n"); + sb.append(" uploadBandwidth: ").append(toIndentedString(uploadBandwidth)).append("\n"); + sb.append(" downloadBandwidth: ").append(toIndentedString(downloadBandwidth)).append("\n"); + sb.append(" uploadDataTransfer: ").append(toIndentedString(uploadDataTransfer)).append("\n"); + sb.append(" downloadDataTransfer: ").append(toIndentedString(downloadDataTransfer)).append("\n"); + sb.append(" totalDataTransfer: ").append(toIndentedString(totalDataTransfer)).append("\n"); + sb.append(" usedUploadDataTransfer: ").append(toIndentedString(usedUploadDataTransfer)).append("\n"); + sb.append(" usedDownloadDataTransfer: ").append(toIndentedString(usedDownloadDataTransfer)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" lastLogin: ").append(toIndentedString(lastLogin)).append("\n"); + sb.append(" firstDownload: ").append(toIndentedString(firstDownload)).append("\n"); + sb.append(" firstUpload: ").append(toIndentedString(firstUpload)).append("\n"); + sb.append(" lastPasswordChange: ").append(toIndentedString(lastPasswordChange)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" filesystem: ").append(toIndentedString(filesystem)).append("\n"); + sb.append(" additionalInfo: ").append(toIndentedString(additionalInfo)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" oidcCustomFields: ").append(toIndentedString(oidcCustomFields)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserFilters.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserFilters.java new file mode 100644 index 00000000..b3f87e33 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserFilters.java @@ -0,0 +1,1046 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.BandwidthLimit; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.HooksFilter; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.LoginMethods; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.MFAProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.PatternsFilter; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.RecoveryCode; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.SupportedProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TimePeriod; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.UserTOTPConfig; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.UserType; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.WebClientOptions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * UserFilters + */ +@JsonPropertyOrder({ + UserFilters.JSON_PROPERTY_ALLOWED_IP, + UserFilters.JSON_PROPERTY_DENIED_IP, + UserFilters.JSON_PROPERTY_DENIED_LOGIN_METHODS, + UserFilters.JSON_PROPERTY_DENIED_PROTOCOLS, + UserFilters.JSON_PROPERTY_FILE_PATTERNS, + UserFilters.JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE, + UserFilters.JSON_PROPERTY_TLS_USERNAME, + UserFilters.JSON_PROPERTY_TLS_CERTS, + UserFilters.JSON_PROPERTY_HOOKS, + UserFilters.JSON_PROPERTY_DISABLE_FS_CHECKS, + UserFilters.JSON_PROPERTY_WEB_CLIENT, + UserFilters.JSON_PROPERTY_ALLOW_API_KEY_AUTH, + UserFilters.JSON_PROPERTY_USER_TYPE, + UserFilters.JSON_PROPERTY_BANDWIDTH_LIMITS, + UserFilters.JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME, + UserFilters.JSON_PROPERTY_START_DIRECTORY, + UserFilters.JSON_PROPERTY_TWO_FACTOR_PROTOCOLS, + UserFilters.JSON_PROPERTY_FTP_SECURITY, + UserFilters.JSON_PROPERTY_IS_ANONYMOUS, + UserFilters.JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION, + UserFilters.JSON_PROPERTY_MAX_SHARES_EXPIRATION, + UserFilters.JSON_PROPERTY_PASSWORD_EXPIRATION, + UserFilters.JSON_PROPERTY_PASSWORD_STRENGTH, + UserFilters.JSON_PROPERTY_ACCESS_TIME, + UserFilters.JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE, + UserFilters.JSON_PROPERTY_TOTP_CONFIG, + UserFilters.JSON_PROPERTY_RECOVERY_CODES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class UserFilters { + public static final String JSON_PROPERTY_ALLOWED_IP = "allowed_ip"; + private List allowedIp = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_IP = "denied_ip"; + private List deniedIp = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_LOGIN_METHODS = "denied_login_methods"; + private List deniedLoginMethods = new ArrayList<>(); + + public static final String JSON_PROPERTY_DENIED_PROTOCOLS = "denied_protocols"; + private List deniedProtocols = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILE_PATTERNS = "file_patterns"; + private List filePatterns = new ArrayList<>(); + + public static final String JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE = "max_upload_file_size"; + private Long maxUploadFileSize; + + public static final String JSON_PROPERTY_TLS_USERNAME = "tls_username"; + private String tlsUsername; + + public static final String JSON_PROPERTY_TLS_CERTS = "tls_certs"; + private List tlsCerts = new ArrayList<>(); + + public static final String JSON_PROPERTY_HOOKS = "hooks"; + private HooksFilter hooks; + + public static final String JSON_PROPERTY_DISABLE_FS_CHECKS = "disable_fs_checks"; + private Boolean disableFsChecks; + + public static final String JSON_PROPERTY_WEB_CLIENT = "web_client"; + private List webClient = new ArrayList<>(); + + public static final String JSON_PROPERTY_ALLOW_API_KEY_AUTH = "allow_api_key_auth"; + private Boolean allowApiKeyAuth; + + public static final String JSON_PROPERTY_USER_TYPE = "user_type"; + private UserType userType; + + public static final String JSON_PROPERTY_BANDWIDTH_LIMITS = "bandwidth_limits"; + private List bandwidthLimits = new ArrayList<>(); + + public static final String JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME = "external_auth_cache_time"; + private Integer externalAuthCacheTime; + + public static final String JSON_PROPERTY_START_DIRECTORY = "start_directory"; + private String startDirectory; + + public static final String JSON_PROPERTY_TWO_FACTOR_PROTOCOLS = "two_factor_protocols"; + private List twoFactorProtocols = new ArrayList<>(); + + /** + * Set to `1` to require TLS for both data and control connection. his setting is useful if you want to allow both encrypted and plain text FTP sessions globally and then you want to require encrypted sessions on a per-user basis. It has no effect if TLS is already required for all users in the configuration file. + */ + public enum FtpSecurityEnum { + NUMBER_0(0), + + NUMBER_1(1); + + private Integer value; + + FtpSecurityEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FtpSecurityEnum fromValue(Integer value) { + for (FtpSecurityEnum b : FtpSecurityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FTP_SECURITY = "ftp_security"; + private FtpSecurityEnum ftpSecurity; + + public static final String JSON_PROPERTY_IS_ANONYMOUS = "is_anonymous"; + private Boolean isAnonymous; + + public static final String JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION = "default_shares_expiration"; + private Integer defaultSharesExpiration; + + public static final String JSON_PROPERTY_MAX_SHARES_EXPIRATION = "max_shares_expiration"; + private Integer maxSharesExpiration; + + public static final String JSON_PROPERTY_PASSWORD_EXPIRATION = "password_expiration"; + private Integer passwordExpiration; + + public static final String JSON_PROPERTY_PASSWORD_STRENGTH = "password_strength"; + private Integer passwordStrength; + + public static final String JSON_PROPERTY_ACCESS_TIME = "access_time"; + private List accessTime = new ArrayList<>(); + + public static final String JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE = "require_password_change"; + private Boolean requirePasswordChange; + + public static final String JSON_PROPERTY_TOTP_CONFIG = "totp_config"; + private UserTOTPConfig totpConfig; + + public static final String JSON_PROPERTY_RECOVERY_CODES = "recovery_codes"; + private List recoveryCodes = new ArrayList<>(); + + public UserFilters() { + } + + public UserFilters allowedIp(List allowedIp) { + + this.allowedIp = allowedIp; + return this; + } + + public UserFilters addAllowedIpItem(String allowedIpItem) { + if (this.allowedIp == null) { + this.allowedIp = new ArrayList<>(); + } + this.allowedIp.add(allowedIpItem); + return this; + } + + /** + * only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example \"192.0.2.0/24\" or \"2001:db8::/32\" + * @return allowedIp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOWED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAllowedIp() { + return allowedIp; + } + + + @JsonProperty(JSON_PROPERTY_ALLOWED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowedIp(List allowedIp) { + this.allowedIp = allowedIp; + } + + public UserFilters deniedIp(List deniedIp) { + + this.deniedIp = deniedIp; + return this; + } + + public UserFilters addDeniedIpItem(String deniedIpItem) { + if (this.deniedIp == null) { + this.deniedIp = new ArrayList<>(); + } + this.deniedIp.add(deniedIpItem); + return this; + } + + /** + * clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones + * @return deniedIp + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedIp() { + return deniedIp; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_IP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedIp(List deniedIp) { + this.deniedIp = deniedIp; + } + + public UserFilters deniedLoginMethods(List deniedLoginMethods) { + + this.deniedLoginMethods = deniedLoginMethods; + return this; + } + + public UserFilters addDeniedLoginMethodsItem(LoginMethods deniedLoginMethodsItem) { + if (this.deniedLoginMethods == null) { + this.deniedLoginMethods = new ArrayList<>(); + } + this.deniedLoginMethods.add(deniedLoginMethodsItem); + return this; + } + + /** + * if null or empty any available login method is allowed + * @return deniedLoginMethods + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_LOGIN_METHODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedLoginMethods() { + return deniedLoginMethods; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_LOGIN_METHODS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedLoginMethods(List deniedLoginMethods) { + this.deniedLoginMethods = deniedLoginMethods; + } + + public UserFilters deniedProtocols(List deniedProtocols) { + + this.deniedProtocols = deniedProtocols; + return this; + } + + public UserFilters addDeniedProtocolsItem(SupportedProtocols deniedProtocolsItem) { + if (this.deniedProtocols == null) { + this.deniedProtocols = new ArrayList<>(); + } + this.deniedProtocols.add(deniedProtocolsItem); + return this; + } + + /** + * if null or empty any available protocol is allowed + * @return deniedProtocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DENIED_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDeniedProtocols() { + return deniedProtocols; + } + + + @JsonProperty(JSON_PROPERTY_DENIED_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeniedProtocols(List deniedProtocols) { + this.deniedProtocols = deniedProtocols; + } + + public UserFilters filePatterns(List filePatterns) { + + this.filePatterns = filePatterns; + return this; + } + + public UserFilters addFilePatternsItem(PatternsFilter filePatternsItem) { + if (this.filePatterns == null) { + this.filePatterns = new ArrayList<>(); + } + this.filePatterns.add(filePatternsItem); + return this; + } + + /** + * filters based on shell like file patterns. These restrictions do not apply to files listing for performance reasons, so a denied file cannot be downloaded/overwritten/renamed but it will still be in the list of files. Please note that these restrictions can be easily bypassed + * @return filePatterns + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFilePatterns() { + return filePatterns; + } + + + @JsonProperty(JSON_PROPERTY_FILE_PATTERNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilePatterns(List filePatterns) { + this.filePatterns = filePatterns; + } + + public UserFilters maxUploadFileSize(Long maxUploadFileSize) { + + this.maxUploadFileSize = maxUploadFileSize; + return this; + } + + /** + * maximum allowed size, as bytes, for a single file upload. The upload will be aborted if/when the size of the file being sent exceeds this limit. 0 means unlimited. This restriction does not apply for SSH system commands such as `git` and `rsync` + * @return maxUploadFileSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getMaxUploadFileSize() { + return maxUploadFileSize; + } + + + @JsonProperty(JSON_PROPERTY_MAX_UPLOAD_FILE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxUploadFileSize(Long maxUploadFileSize) { + this.maxUploadFileSize = maxUploadFileSize; + } + + public UserFilters tlsUsername(String tlsUsername) { + + this.tlsUsername = tlsUsername; + return this; + } + + /** + * defines the TLS certificate field to use as username. For FTP clients it must match the name provided using the \"USER\" command. For WebDAV, if no username is provided, the CN will be used as username. For WebDAV clients it must match the implicit or provided username. Ignored if mutual TLS is disabled. Currently the only supported value is `CommonName` + * @return tlsUsername + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTlsUsername() { + return tlsUsername; + } + + + @JsonProperty(JSON_PROPERTY_TLS_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsUsername(String tlsUsername) { + this.tlsUsername = tlsUsername; + } + + public UserFilters tlsCerts(List tlsCerts) { + + this.tlsCerts = tlsCerts; + return this; + } + + public UserFilters addTlsCertsItem(String tlsCertsItem) { + if (this.tlsCerts == null) { + this.tlsCerts = new ArrayList<>(); + } + this.tlsCerts.add(tlsCertsItem); + return this; + } + + /** + * Get tlsCerts + * @return tlsCerts + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_CERTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTlsCerts() { + return tlsCerts; + } + + + @JsonProperty(JSON_PROPERTY_TLS_CERTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsCerts(List tlsCerts) { + this.tlsCerts = tlsCerts; + } + + public UserFilters hooks(HooksFilter hooks) { + + this.hooks = hooks; + return this; + } + + /** + * Get hooks + * @return hooks + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public HooksFilter getHooks() { + return hooks; + } + + + @JsonProperty(JSON_PROPERTY_HOOKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHooks(HooksFilter hooks) { + this.hooks = hooks; + } + + public UserFilters disableFsChecks(Boolean disableFsChecks) { + + this.disableFsChecks = disableFsChecks; + return this; + } + + /** + * Disable checks for existence and automatic creation of home directory and virtual folders. SFTPGo requires that the user's home directory, virtual folder root, and intermediate paths to virtual folders exist to work properly. If you already know that the required directories exist, disabling these checks will speed up login. You could, for example, disable these checks after the first login + * @return disableFsChecks + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLE_FS_CHECKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableFsChecks() { + return disableFsChecks; + } + + + @JsonProperty(JSON_PROPERTY_DISABLE_FS_CHECKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableFsChecks(Boolean disableFsChecks) { + this.disableFsChecks = disableFsChecks; + } + + public UserFilters webClient(List webClient) { + + this.webClient = webClient; + return this; + } + + public UserFilters addWebClientItem(WebClientOptions webClientItem) { + if (this.webClient == null) { + this.webClient = new ArrayList<>(); + } + this.webClient.add(webClientItem); + return this; + } + + /** + * WebClient/user REST API related configuration options + * @return webClient + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEB_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWebClient() { + return webClient; + } + + + @JsonProperty(JSON_PROPERTY_WEB_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWebClient(List webClient) { + this.webClient = webClient; + } + + public UserFilters allowApiKeyAuth(Boolean allowApiKeyAuth) { + + this.allowApiKeyAuth = allowApiKeyAuth; + return this; + } + + /** + * API key authentication allows to impersonate this user with an API key + * @return allowApiKeyAuth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowApiKeyAuth() { + return allowApiKeyAuth; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowApiKeyAuth(Boolean allowApiKeyAuth) { + this.allowApiKeyAuth = allowApiKeyAuth; + } + + public UserFilters userType(UserType userType) { + + this.userType = userType; + return this; + } + + /** + * Get userType + * @return userType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserType getUserType() { + return userType; + } + + + @JsonProperty(JSON_PROPERTY_USER_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserType(UserType userType) { + this.userType = userType; + } + + public UserFilters bandwidthLimits(List bandwidthLimits) { + + this.bandwidthLimits = bandwidthLimits; + return this; + } + + public UserFilters addBandwidthLimitsItem(BandwidthLimit bandwidthLimitsItem) { + if (this.bandwidthLimits == null) { + this.bandwidthLimits = new ArrayList<>(); + } + this.bandwidthLimits.add(bandwidthLimitsItem); + return this; + } + + /** + * Get bandwidthLimits + * @return bandwidthLimits + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BANDWIDTH_LIMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBandwidthLimits() { + return bandwidthLimits; + } + + + @JsonProperty(JSON_PROPERTY_BANDWIDTH_LIMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBandwidthLimits(List bandwidthLimits) { + this.bandwidthLimits = bandwidthLimits; + } + + public UserFilters externalAuthCacheTime(Integer externalAuthCacheTime) { + + this.externalAuthCacheTime = externalAuthCacheTime; + return this; + } + + /** + * Defines the cache time, in seconds, for users authenticated using an external auth hook. 0 means no cache + * @return externalAuthCacheTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getExternalAuthCacheTime() { + return externalAuthCacheTime; + } + + + @JsonProperty(JSON_PROPERTY_EXTERNAL_AUTH_CACHE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExternalAuthCacheTime(Integer externalAuthCacheTime) { + this.externalAuthCacheTime = externalAuthCacheTime; + } + + public UserFilters startDirectory(String startDirectory) { + + this.startDirectory = startDirectory; + return this; + } + + /** + * Specifies an alternate starting directory. If not set, the default is \"/\". This option is supported for SFTP/SCP, FTP and HTTP (WebClient/REST API) protocols. Relative paths will use this directory as base. + * @return startDirectory + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DIRECTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStartDirectory() { + return startDirectory; + } + + + @JsonProperty(JSON_PROPERTY_START_DIRECTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStartDirectory(String startDirectory) { + this.startDirectory = startDirectory; + } + + public UserFilters twoFactorProtocols(List twoFactorProtocols) { + + this.twoFactorProtocols = twoFactorProtocols; + return this; + } + + public UserFilters addTwoFactorProtocolsItem(MFAProtocols twoFactorProtocolsItem) { + if (this.twoFactorProtocols == null) { + this.twoFactorProtocols = new ArrayList<>(); + } + this.twoFactorProtocols.add(twoFactorProtocolsItem); + return this; + } + + /** + * Defines protocols that require two factor authentication + * @return twoFactorProtocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TWO_FACTOR_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTwoFactorProtocols() { + return twoFactorProtocols; + } + + + @JsonProperty(JSON_PROPERTY_TWO_FACTOR_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTwoFactorProtocols(List twoFactorProtocols) { + this.twoFactorProtocols = twoFactorProtocols; + } + + public UserFilters ftpSecurity(FtpSecurityEnum ftpSecurity) { + + this.ftpSecurity = ftpSecurity; + return this; + } + + /** + * Set to `1` to require TLS for both data and control connection. his setting is useful if you want to allow both encrypted and plain text FTP sessions globally and then you want to require encrypted sessions on a per-user basis. It has no effect if TLS is already required for all users in the configuration file. + * @return ftpSecurity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FTP_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FtpSecurityEnum getFtpSecurity() { + return ftpSecurity; + } + + + @JsonProperty(JSON_PROPERTY_FTP_SECURITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFtpSecurity(FtpSecurityEnum ftpSecurity) { + this.ftpSecurity = ftpSecurity; + } + + public UserFilters isAnonymous(Boolean isAnonymous) { + + this.isAnonymous = isAnonymous; + return this; + } + + /** + * If enabled the user can login with any password or no password at all. Anonymous users are supported for FTP and WebDAV protocols and permissions will be automatically set to \"list\" and \"download\" (read only) + * @return isAnonymous + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ANONYMOUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsAnonymous() { + return isAnonymous; + } + + + @JsonProperty(JSON_PROPERTY_IS_ANONYMOUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsAnonymous(Boolean isAnonymous) { + this.isAnonymous = isAnonymous; + } + + public UserFilters defaultSharesExpiration(Integer defaultSharesExpiration) { + + this.defaultSharesExpiration = defaultSharesExpiration; + return this; + } + + /** + * Defines the default expiration for newly created shares as number of days. 0 means no expiration + * @return defaultSharesExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultSharesExpiration() { + return defaultSharesExpiration; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultSharesExpiration(Integer defaultSharesExpiration) { + this.defaultSharesExpiration = defaultSharesExpiration; + } + + public UserFilters maxSharesExpiration(Integer maxSharesExpiration) { + + this.maxSharesExpiration = maxSharesExpiration; + return this; + } + + /** + * Defines the maximum allowed expiration, as a number of days, when a user creates or updates a share. 0 means no expiration + * @return maxSharesExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxSharesExpiration() { + return maxSharesExpiration; + } + + + @JsonProperty(JSON_PROPERTY_MAX_SHARES_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxSharesExpiration(Integer maxSharesExpiration) { + this.maxSharesExpiration = maxSharesExpiration; + } + + public UserFilters passwordExpiration(Integer passwordExpiration) { + + this.passwordExpiration = passwordExpiration; + return this; + } + + /** + * The password expires after the defined number of days. 0 means no expiration + * @return passwordExpiration + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPasswordExpiration() { + return passwordExpiration; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD_EXPIRATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPasswordExpiration(Integer passwordExpiration) { + this.passwordExpiration = passwordExpiration; + } + + public UserFilters passwordStrength(Integer passwordStrength) { + + this.passwordStrength = passwordStrength; + return this; + } + + /** + * Defines the minimum password strength. 0 means disabled, any password will be accepted. Values in the 50-70 range are suggested for common use cases + * @return passwordStrength + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD_STRENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPasswordStrength() { + return passwordStrength; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD_STRENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPasswordStrength(Integer passwordStrength) { + this.passwordStrength = passwordStrength; + } + + public UserFilters accessTime(List accessTime) { + + this.accessTime = accessTime; + return this; + } + + public UserFilters addAccessTimeItem(TimePeriod accessTimeItem) { + if (this.accessTime == null) { + this.accessTime = new ArrayList<>(); + } + this.accessTime.add(accessTimeItem); + return this; + } + + /** + * Get accessTime + * @return accessTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCESS_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAccessTime() { + return accessTime; + } + + + @JsonProperty(JSON_PROPERTY_ACCESS_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccessTime(List accessTime) { + this.accessTime = accessTime; + } + + public UserFilters requirePasswordChange(Boolean requirePasswordChange) { + + this.requirePasswordChange = requirePasswordChange; + return this; + } + + /** + * User must change password from WebClient/REST API at next login + * @return requirePasswordChange + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getRequirePasswordChange() { + return requirePasswordChange; + } + + + @JsonProperty(JSON_PROPERTY_REQUIRE_PASSWORD_CHANGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequirePasswordChange(Boolean requirePasswordChange) { + this.requirePasswordChange = requirePasswordChange; + } + + public UserFilters totpConfig(UserTOTPConfig totpConfig) { + + this.totpConfig = totpConfig; + return this; + } + + /** + * Get totpConfig + * @return totpConfig + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserTOTPConfig getTotpConfig() { + return totpConfig; + } + + + @JsonProperty(JSON_PROPERTY_TOTP_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotpConfig(UserTOTPConfig totpConfig) { + this.totpConfig = totpConfig; + } + + public UserFilters recoveryCodes(List recoveryCodes) { + + this.recoveryCodes = recoveryCodes; + return this; + } + + public UserFilters addRecoveryCodesItem(RecoveryCode recoveryCodesItem) { + if (this.recoveryCodes == null) { + this.recoveryCodes = new ArrayList<>(); + } + this.recoveryCodes.add(recoveryCodesItem); + return this; + } + + /** + * Get recoveryCodes + * @return recoveryCodes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECOVERY_CODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getRecoveryCodes() { + return recoveryCodes; + } + + + @JsonProperty(JSON_PROPERTY_RECOVERY_CODES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecoveryCodes(List recoveryCodes) { + this.recoveryCodes = recoveryCodes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserFilters userFilters = (UserFilters) o; + return Objects.equals(this.allowedIp, userFilters.allowedIp) && + Objects.equals(this.deniedIp, userFilters.deniedIp) && + Objects.equals(this.deniedLoginMethods, userFilters.deniedLoginMethods) && + Objects.equals(this.deniedProtocols, userFilters.deniedProtocols) && + Objects.equals(this.filePatterns, userFilters.filePatterns) && + Objects.equals(this.maxUploadFileSize, userFilters.maxUploadFileSize) && + Objects.equals(this.tlsUsername, userFilters.tlsUsername) && + Objects.equals(this.tlsCerts, userFilters.tlsCerts) && + Objects.equals(this.hooks, userFilters.hooks) && + Objects.equals(this.disableFsChecks, userFilters.disableFsChecks) && + Objects.equals(this.webClient, userFilters.webClient) && + Objects.equals(this.allowApiKeyAuth, userFilters.allowApiKeyAuth) && + Objects.equals(this.userType, userFilters.userType) && + Objects.equals(this.bandwidthLimits, userFilters.bandwidthLimits) && + Objects.equals(this.externalAuthCacheTime, userFilters.externalAuthCacheTime) && + Objects.equals(this.startDirectory, userFilters.startDirectory) && + Objects.equals(this.twoFactorProtocols, userFilters.twoFactorProtocols) && + Objects.equals(this.ftpSecurity, userFilters.ftpSecurity) && + Objects.equals(this.isAnonymous, userFilters.isAnonymous) && + Objects.equals(this.defaultSharesExpiration, userFilters.defaultSharesExpiration) && + Objects.equals(this.maxSharesExpiration, userFilters.maxSharesExpiration) && + Objects.equals(this.passwordExpiration, userFilters.passwordExpiration) && + Objects.equals(this.passwordStrength, userFilters.passwordStrength) && + Objects.equals(this.accessTime, userFilters.accessTime) && + Objects.equals(this.requirePasswordChange, userFilters.requirePasswordChange) && + Objects.equals(this.totpConfig, userFilters.totpConfig) && + Objects.equals(this.recoveryCodes, userFilters.recoveryCodes); + } + + @Override + public int hashCode() { + return Objects.hash(allowedIp, deniedIp, deniedLoginMethods, deniedProtocols, filePatterns, maxUploadFileSize, tlsUsername, tlsCerts, hooks, disableFsChecks, webClient, allowApiKeyAuth, userType, bandwidthLimits, externalAuthCacheTime, startDirectory, twoFactorProtocols, ftpSecurity, isAnonymous, defaultSharesExpiration, maxSharesExpiration, passwordExpiration, passwordStrength, accessTime, requirePasswordChange, totpConfig, recoveryCodes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserFilters {\n"); + sb.append(" allowedIp: ").append(toIndentedString(allowedIp)).append("\n"); + sb.append(" deniedIp: ").append(toIndentedString(deniedIp)).append("\n"); + sb.append(" deniedLoginMethods: ").append(toIndentedString(deniedLoginMethods)).append("\n"); + sb.append(" deniedProtocols: ").append(toIndentedString(deniedProtocols)).append("\n"); + sb.append(" filePatterns: ").append(toIndentedString(filePatterns)).append("\n"); + sb.append(" maxUploadFileSize: ").append(toIndentedString(maxUploadFileSize)).append("\n"); + sb.append(" tlsUsername: ").append(toIndentedString(tlsUsername)).append("\n"); + sb.append(" tlsCerts: ").append(toIndentedString(tlsCerts)).append("\n"); + sb.append(" hooks: ").append(toIndentedString(hooks)).append("\n"); + sb.append(" disableFsChecks: ").append(toIndentedString(disableFsChecks)).append("\n"); + sb.append(" webClient: ").append(toIndentedString(webClient)).append("\n"); + sb.append(" allowApiKeyAuth: ").append(toIndentedString(allowApiKeyAuth)).append("\n"); + sb.append(" userType: ").append(toIndentedString(userType)).append("\n"); + sb.append(" bandwidthLimits: ").append(toIndentedString(bandwidthLimits)).append("\n"); + sb.append(" externalAuthCacheTime: ").append(toIndentedString(externalAuthCacheTime)).append("\n"); + sb.append(" startDirectory: ").append(toIndentedString(startDirectory)).append("\n"); + sb.append(" twoFactorProtocols: ").append(toIndentedString(twoFactorProtocols)).append("\n"); + sb.append(" ftpSecurity: ").append(toIndentedString(ftpSecurity)).append("\n"); + sb.append(" isAnonymous: ").append(toIndentedString(isAnonymous)).append("\n"); + sb.append(" defaultSharesExpiration: ").append(toIndentedString(defaultSharesExpiration)).append("\n"); + sb.append(" maxSharesExpiration: ").append(toIndentedString(maxSharesExpiration)).append("\n"); + sb.append(" passwordExpiration: ").append(toIndentedString(passwordExpiration)).append("\n"); + sb.append(" passwordStrength: ").append(toIndentedString(passwordStrength)).append("\n"); + sb.append(" accessTime: ").append(toIndentedString(accessTime)).append("\n"); + sb.append(" requirePasswordChange: ").append(toIndentedString(requirePasswordChange)).append("\n"); + sb.append(" totpConfig: ").append(toIndentedString(totpConfig)).append("\n"); + sb.append(" recoveryCodes: ").append(toIndentedString(recoveryCodes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserProfile.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserProfile.java new file mode 100644 index 00000000..8c898bc5 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserProfile.java @@ -0,0 +1,207 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * UserProfile + */ +@JsonPropertyOrder({ + UserProfile.JSON_PROPERTY_EMAIL, + UserProfile.JSON_PROPERTY_DESCRIPTION, + UserProfile.JSON_PROPERTY_ALLOW_API_KEY_AUTH, + UserProfile.JSON_PROPERTY_PUBLIC_KEYS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class UserProfile { + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ALLOW_API_KEY_AUTH = "allow_api_key_auth"; + private Boolean allowApiKeyAuth; + + public static final String JSON_PROPERTY_PUBLIC_KEYS = "public_keys"; + private List publicKeys = new ArrayList<>(); + + public UserProfile() { + } + + public UserProfile email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public UserProfile description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public UserProfile allowApiKeyAuth(Boolean allowApiKeyAuth) { + + this.allowApiKeyAuth = allowApiKeyAuth; + return this; + } + + /** + * If enabled, you can impersonate this user, in REST API, using an API key. If disabled user credentials are required for impersonation + * @return allowApiKeyAuth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAllowApiKeyAuth() { + return allowApiKeyAuth; + } + + + @JsonProperty(JSON_PROPERTY_ALLOW_API_KEY_AUTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllowApiKeyAuth(Boolean allowApiKeyAuth) { + this.allowApiKeyAuth = allowApiKeyAuth; + } + + public UserProfile publicKeys(List publicKeys) { + + this.publicKeys = publicKeys; + return this; + } + + public UserProfile addPublicKeysItem(String publicKeysItem) { + if (this.publicKeys == null) { + this.publicKeys = new ArrayList<>(); + } + this.publicKeys.add(publicKeysItem); + return this; + } + + /** + * Get publicKeys + * @return publicKeys + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPublicKeys() { + return publicKeys; + } + + + @JsonProperty(JSON_PROPERTY_PUBLIC_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfile userProfile = (UserProfile) o; + return Objects.equals(this.email, userProfile.email) && + Objects.equals(this.description, userProfile.description) && + Objects.equals(this.allowApiKeyAuth, userProfile.allowApiKeyAuth) && + Objects.equals(this.publicKeys, userProfile.publicKeys); + } + + @Override + public int hashCode() { + return Objects.hash(email, description, allowApiKeyAuth, publicKeys); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfile {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" allowApiKeyAuth: ").append(toIndentedString(allowApiKeyAuth)).append("\n"); + sb.append(" publicKeys: ").append(toIndentedString(publicKeys)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserTOTPConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserTOTPConfig.java new file mode 100644 index 00000000..6a105901 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserTOTPConfig.java @@ -0,0 +1,209 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.MFAProtocols; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Secret; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * UserTOTPConfig + */ +@JsonPropertyOrder({ + UserTOTPConfig.JSON_PROPERTY_ENABLED, + UserTOTPConfig.JSON_PROPERTY_CONFIG_NAME, + UserTOTPConfig.JSON_PROPERTY_SECRET, + UserTOTPConfig.JSON_PROPERTY_PROTOCOLS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class UserTOTPConfig { + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private Secret secret; + + public static final String JSON_PROPERTY_PROTOCOLS = "protocols"; + private List protocols = new ArrayList<>(); + + public UserTOTPConfig() { + } + + public UserTOTPConfig enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEnabled() { + return enabled; + } + + + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public UserTOTPConfig configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * This name must be defined within the \"totp\" section of the SFTPGo configuration file. You will be unable to save a user/admin referencing a missing config_name + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + public UserTOTPConfig secret(Secret secret) { + + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Secret getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(Secret secret) { + this.secret = secret; + } + + public UserTOTPConfig protocols(List protocols) { + + this.protocols = protocols; + return this; + } + + public UserTOTPConfig addProtocolsItem(MFAProtocols protocolsItem) { + if (this.protocols == null) { + this.protocols = new ArrayList<>(); + } + this.protocols.add(protocolsItem); + return this; + } + + /** + * TOTP will be required for the specified protocols. SSH protocol (SFTP/SCP/SSH commands) will ask for the TOTP passcode if the client uses keyboard interactive authentication. FTP has no standard way to support two factor authentication, if you enable the FTP support, you have to add the TOTP passcode after the password. For example if your password is \"password\" and your one time passcode is \"123456\" you have to use \"password123456\" as password. WebDAV is not supported since each single request must be authenticated and a passcode cannot be reused. + * @return protocols + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProtocols() { + return protocols; + } + + + @JsonProperty(JSON_PROPERTY_PROTOCOLS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProtocols(List protocols) { + this.protocols = protocols; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserTOTPConfig userTOTPConfig = (UserTOTPConfig) o; + return Objects.equals(this.enabled, userTOTPConfig.enabled) && + Objects.equals(this.configName, userTOTPConfig.configName) && + Objects.equals(this.secret, userTOTPConfig.secret) && + Objects.equals(this.protocols, userTOTPConfig.protocols); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, configName, secret, protocols); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserTOTPConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" protocols: ").append(toIndentedString(protocols)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserType.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserType.java new file mode 100644 index 00000000..8aabb1b8 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/UserType.java @@ -0,0 +1,61 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * This is an hint for authentication plugins. It is ignored when using SFTPGo internal authentication + */ +public enum UserType { + + EMPTY(""), + + LDAP_USER("LDAPUser"), + + OS_USER("OSUser"); + + private String value; + + UserType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static UserType fromValue(String value) { + for (UserType b : UserType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ValidateAdminTotpSecretRequest.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ValidateAdminTotpSecretRequest.java new file mode 100644 index 00000000..2c3ca698 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/ValidateAdminTotpSecretRequest.java @@ -0,0 +1,166 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ValidateAdminTotpSecretRequest + */ +@JsonPropertyOrder({ + ValidateAdminTotpSecretRequest.JSON_PROPERTY_CONFIG_NAME, + ValidateAdminTotpSecretRequest.JSON_PROPERTY_PASSCODE, + ValidateAdminTotpSecretRequest.JSON_PROPERTY_SECRET +}) +@JsonTypeName("validate_admin_totp_secret_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class ValidateAdminTotpSecretRequest { + public static final String JSON_PROPERTY_CONFIG_NAME = "config_name"; + private String configName; + + public static final String JSON_PROPERTY_PASSCODE = "passcode"; + private String passcode; + + public static final String JSON_PROPERTY_SECRET = "secret"; + private String secret; + + public ValidateAdminTotpSecretRequest() { + } + + public ValidateAdminTotpSecretRequest configName(String configName) { + + this.configName = configName; + return this; + } + + /** + * name of the configuration to use to validate the passcode + * @return configName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getConfigName() { + return configName; + } + + + @JsonProperty(JSON_PROPERTY_CONFIG_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setConfigName(String configName) { + this.configName = configName; + } + + public ValidateAdminTotpSecretRequest passcode(String passcode) { + + this.passcode = passcode; + return this; + } + + /** + * passcode to validate + * @return passcode + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSCODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPasscode() { + return passcode; + } + + + @JsonProperty(JSON_PROPERTY_PASSCODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPasscode(String passcode) { + this.passcode = passcode; + } + + public ValidateAdminTotpSecretRequest secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * secret to use to validate the passcode + * @return secret + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSecret() { + return secret; + } + + + @JsonProperty(JSON_PROPERTY_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSecret(String secret) { + this.secret = secret; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ValidateAdminTotpSecretRequest validateAdminTotpSecretRequest = (ValidateAdminTotpSecretRequest) o; + return Objects.equals(this.configName, validateAdminTotpSecretRequest.configName) && + Objects.equals(this.passcode, validateAdminTotpSecretRequest.passcode) && + Objects.equals(this.secret, validateAdminTotpSecretRequest.secret); + } + + @Override + public int hashCode() { + return Objects.hash(configName, passcode, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ValidateAdminTotpSecretRequest {\n"); + sb.append(" configName: ").append(toIndentedString(configName)).append("\n"); + sb.append(" passcode: ").append(toIndentedString(passcode)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VersionInfo.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VersionInfo.java new file mode 100644 index 00000000..215f0c63 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VersionInfo.java @@ -0,0 +1,207 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * VersionInfo + */ +@JsonPropertyOrder({ + VersionInfo.JSON_PROPERTY_VERSION, + VersionInfo.JSON_PROPERTY_BUILD_DATE, + VersionInfo.JSON_PROPERTY_COMMIT_HASH, + VersionInfo.JSON_PROPERTY_FEATURES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class VersionInfo { + public static final String JSON_PROPERTY_VERSION = "version"; + private String version; + + public static final String JSON_PROPERTY_BUILD_DATE = "build_date"; + private String buildDate; + + public static final String JSON_PROPERTY_COMMIT_HASH = "commit_hash"; + private String commitHash; + + public static final String JSON_PROPERTY_FEATURES = "features"; + private List features = new ArrayList<>(); + + public VersionInfo() { + } + + public VersionInfo version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getVersion() { + return version; + } + + + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVersion(String version) { + this.version = version; + } + + public VersionInfo buildDate(String buildDate) { + + this.buildDate = buildDate; + return this; + } + + /** + * Get buildDate + * @return buildDate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUILD_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBuildDate() { + return buildDate; + } + + + @JsonProperty(JSON_PROPERTY_BUILD_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBuildDate(String buildDate) { + this.buildDate = buildDate; + } + + public VersionInfo commitHash(String commitHash) { + + this.commitHash = commitHash; + return this; + } + + /** + * Get commitHash + * @return commitHash + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMIT_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCommitHash() { + return commitHash; + } + + + @JsonProperty(JSON_PROPERTY_COMMIT_HASH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommitHash(String commitHash) { + this.commitHash = commitHash; + } + + public VersionInfo features(List features) { + + this.features = features; + return this; + } + + public VersionInfo addFeaturesItem(String featuresItem) { + if (this.features == null) { + this.features = new ArrayList<>(); + } + this.features.add(featuresItem); + return this; + } + + /** + * Features for the current build. Available features are `portable`, `bolt`, `mysql`, `sqlite`, `pgsql`, `s3`, `gcs`, `azblob`, `metrics`, `unixcrypt`. If a feature is available it has a `+` prefix, otherwise a `-` prefix + * @return features + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFeatures() { + return features; + } + + + @JsonProperty(JSON_PROPERTY_FEATURES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFeatures(List features) { + this.features = features; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionInfo versionInfo = (VersionInfo) o; + return Objects.equals(this.version, versionInfo.version) && + Objects.equals(this.buildDate, versionInfo.buildDate) && + Objects.equals(this.commitHash, versionInfo.commitHash) && + Objects.equals(this.features, versionInfo.features); + } + + @Override + public int hashCode() { + return Objects.hash(version, buildDate, commitHash, features); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionInfo {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" buildDate: ").append(toIndentedString(buildDate)).append("\n"); + sb.append(" commitHash: ").append(toIndentedString(commitHash)).append("\n"); + sb.append(" features: ").append(toIndentedString(features)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VirtualFolder.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VirtualFolder.java new file mode 100644 index 00000000..c5c7d8a6 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/VirtualFolder.java @@ -0,0 +1,457 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.FilesystemConfig; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A virtual folder is a mapping between a SFTPGo virtual path and a filesystem path outside the user home directory. The specified paths must be absolute and the virtual path cannot be \"/\", it must be a sub directory. The parent directory for the specified virtual path must exist. SFTPGo will try to automatically create any missing parent directory for the configured virtual folders at user login. + */ +@JsonPropertyOrder({ + VirtualFolder.JSON_PROPERTY_ID, + VirtualFolder.JSON_PROPERTY_NAME, + VirtualFolder.JSON_PROPERTY_MAPPED_PATH, + VirtualFolder.JSON_PROPERTY_DESCRIPTION, + VirtualFolder.JSON_PROPERTY_USED_QUOTA_SIZE, + VirtualFolder.JSON_PROPERTY_USED_QUOTA_FILES, + VirtualFolder.JSON_PROPERTY_LAST_QUOTA_UPDATE, + VirtualFolder.JSON_PROPERTY_USERS, + VirtualFolder.JSON_PROPERTY_FILESYSTEM, + VirtualFolder.JSON_PROPERTY_VIRTUAL_PATH, + VirtualFolder.JSON_PROPERTY_QUOTA_SIZE, + VirtualFolder.JSON_PROPERTY_QUOTA_FILES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class VirtualFolder { + public static final String JSON_PROPERTY_ID = "id"; + private Integer id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_MAPPED_PATH = "mapped_path"; + private String mappedPath; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_USED_QUOTA_SIZE = "used_quota_size"; + private Long usedQuotaSize; + + public static final String JSON_PROPERTY_USED_QUOTA_FILES = "used_quota_files"; + private Integer usedQuotaFiles; + + public static final String JSON_PROPERTY_LAST_QUOTA_UPDATE = "last_quota_update"; + private Long lastQuotaUpdate; + + public static final String JSON_PROPERTY_USERS = "users"; + private List users = new ArrayList<>(); + + public static final String JSON_PROPERTY_FILESYSTEM = "filesystem"; + private FilesystemConfig filesystem; + + public static final String JSON_PROPERTY_VIRTUAL_PATH = "virtual_path"; + private String virtualPath; + + public static final String JSON_PROPERTY_QUOTA_SIZE = "quota_size"; + private Long quotaSize; + + public static final String JSON_PROPERTY_QUOTA_FILES = "quota_files"; + private Integer quotaFiles; + + public VirtualFolder() { + } + + public VirtualFolder id(Integer id) { + + this.id = id; + return this; + } + + /** + * Get id + * minimum: 1 + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Integer id) { + this.id = id; + } + + public VirtualFolder name(String name) { + + this.name = name; + return this; + } + + /** + * unique name for this virtual folder + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public VirtualFolder mappedPath(String mappedPath) { + + this.mappedPath = mappedPath; + return this; + } + + /** + * absolute filesystem path to use as virtual folder + * @return mappedPath + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAPPED_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMappedPath() { + return mappedPath; + } + + + @JsonProperty(JSON_PROPERTY_MAPPED_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMappedPath(String mappedPath) { + this.mappedPath = mappedPath; + } + + public VirtualFolder description(String description) { + + this.description = description; + return this; + } + + /** + * optional description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + public VirtualFolder usedQuotaSize(Long usedQuotaSize) { + + this.usedQuotaSize = usedQuotaSize; + return this; + } + + /** + * Get usedQuotaSize + * @return usedQuotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getUsedQuotaSize() { + return usedQuotaSize; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaSize(Long usedQuotaSize) { + this.usedQuotaSize = usedQuotaSize; + } + + public VirtualFolder usedQuotaFiles(Integer usedQuotaFiles) { + + this.usedQuotaFiles = usedQuotaFiles; + return this; + } + + /** + * Get usedQuotaFiles + * @return usedQuotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUsedQuotaFiles() { + return usedQuotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_USED_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsedQuotaFiles(Integer usedQuotaFiles) { + this.usedQuotaFiles = usedQuotaFiles; + } + + public VirtualFolder lastQuotaUpdate(Long lastQuotaUpdate) { + + this.lastQuotaUpdate = lastQuotaUpdate; + return this; + } + + /** + * Last quota update as unix timestamp in milliseconds + * @return lastQuotaUpdate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_QUOTA_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getLastQuotaUpdate() { + return lastQuotaUpdate; + } + + + @JsonProperty(JSON_PROPERTY_LAST_QUOTA_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastQuotaUpdate(Long lastQuotaUpdate) { + this.lastQuotaUpdate = lastQuotaUpdate; + } + + public VirtualFolder users(List users) { + + this.users = users; + return this; + } + + public VirtualFolder addUsersItem(String usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * list of usernames associated with this virtual folder + * @return users + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getUsers() { + return users; + } + + + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsers(List users) { + this.users = users; + } + + public VirtualFolder filesystem(FilesystemConfig filesystem) { + + this.filesystem = filesystem; + return this; + } + + /** + * Get filesystem + * @return filesystem + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FilesystemConfig getFilesystem() { + return filesystem; + } + + + @JsonProperty(JSON_PROPERTY_FILESYSTEM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFilesystem(FilesystemConfig filesystem) { + this.filesystem = filesystem; + } + + public VirtualFolder virtualPath(String virtualPath) { + + this.virtualPath = virtualPath; + return this; + } + + /** + * Get virtualPath + * @return virtualPath + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VIRTUAL_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getVirtualPath() { + return virtualPath; + } + + + @JsonProperty(JSON_PROPERTY_VIRTUAL_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVirtualPath(String virtualPath) { + this.virtualPath = virtualPath; + } + + public VirtualFolder quotaSize(Long quotaSize) { + + this.quotaSize = quotaSize; + return this; + } + + /** + * Quota as size in bytes. 0 means unlimited, -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + * @return quotaSize + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getQuotaSize() { + return quotaSize; + } + + + @JsonProperty(JSON_PROPERTY_QUOTA_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotaSize(Long quotaSize) { + this.quotaSize = quotaSize; + } + + public VirtualFolder quotaFiles(Integer quotaFiles) { + + this.quotaFiles = quotaFiles; + return this; + } + + /** + * Quota as number of files. 0 means unlimited, , -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + * @return quotaFiles + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuotaFiles() { + return quotaFiles; + } + + + @JsonProperty(JSON_PROPERTY_QUOTA_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuotaFiles(Integer quotaFiles) { + this.quotaFiles = quotaFiles; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VirtualFolder virtualFolder = (VirtualFolder) o; + return Objects.equals(this.id, virtualFolder.id) && + Objects.equals(this.name, virtualFolder.name) && + Objects.equals(this.mappedPath, virtualFolder.mappedPath) && + Objects.equals(this.description, virtualFolder.description) && + Objects.equals(this.usedQuotaSize, virtualFolder.usedQuotaSize) && + Objects.equals(this.usedQuotaFiles, virtualFolder.usedQuotaFiles) && + Objects.equals(this.lastQuotaUpdate, virtualFolder.lastQuotaUpdate) && + Objects.equals(this.users, virtualFolder.users) && + Objects.equals(this.filesystem, virtualFolder.filesystem) && + Objects.equals(this.virtualPath, virtualFolder.virtualPath) && + Objects.equals(this.quotaSize, virtualFolder.quotaSize) && + Objects.equals(this.quotaFiles, virtualFolder.quotaFiles); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, mappedPath, description, usedQuotaSize, usedQuotaFiles, lastQuotaUpdate, users, filesystem, virtualPath, quotaSize, quotaFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VirtualFolder {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" mappedPath: ").append(toIndentedString(mappedPath)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" usedQuotaSize: ").append(toIndentedString(usedQuotaSize)).append("\n"); + sb.append(" usedQuotaFiles: ").append(toIndentedString(usedQuotaFiles)).append("\n"); + sb.append(" lastQuotaUpdate: ").append(toIndentedString(lastQuotaUpdate)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" filesystem: ").append(toIndentedString(filesystem)).append("\n"); + sb.append(" virtualPath: ").append(toIndentedString(virtualPath)).append("\n"); + sb.append(" quotaSize: ").append(toIndentedString(quotaSize)).append("\n"); + sb.append(" quotaFiles: ").append(toIndentedString(quotaFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebClientOptions.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebClientOptions.java new file mode 100644 index 00000000..f16880d8 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebClientOptions.java @@ -0,0 +1,75 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Options: * `publickey-change-disabled` - changing SSH public keys is not allowed * `tls-cert-change-disabled` - changing TLS certificates is not allowed * `write-disabled` - upload, rename, delete are not allowed even if the user has permissions for these actions * `mfa-disabled` - enabling multi-factor authentication is not allowed. This option cannot be set if the user has MFA already enabled * `password-change-disabled` - changing password is not allowed * `api-key-auth-change-disabled` - enabling/disabling API key authentication is not allowed * `info-change-disabled` - changing info such as email and description is not allowed * `shares-disabled` - sharing files and directories with external users is not allowed * `password-reset-disabled` - resetting the password is not allowed * `shares-without-password-disabled` - creating shares without password protection is not allowed + */ +public enum WebClientOptions { + + PUBLICKEY_CHANGE_DISABLED("publickey-change-disabled"), + + TLS_CERT_CHANGE_DISABLED("tls-cert-change-disabled"), + + WRITE_DISABLED("write-disabled"), + + MFA_DISABLED("mfa-disabled"), + + PASSWORD_CHANGE_DISABLED("password-change-disabled"), + + API_KEY_AUTH_CHANGE_DISABLED("api-key-auth-change-disabled"), + + INFO_CHANGE_DISABLED("info-change-disabled"), + + SHARES_DISABLED("shares-disabled"), + + PASSWORD_RESET_DISABLED("password-reset-disabled"), + + SHARES_WITHOUT_PASSWORD_DISABLED("shares-without-password-disabled"); + + private String value; + + WebClientOptions(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static WebClientOptions fromValue(String value) { + for (WebClientOptions b : WebClientOptions.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVBinding.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVBinding.java new file mode 100644 index 00000000..c1c0892f --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVBinding.java @@ -0,0 +1,340 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import java.util.Objects; +import java.util.Arrays; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.TLSVersions; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * WebDAVBinding + */ +@JsonPropertyOrder({ + WebDAVBinding.JSON_PROPERTY_ADDRESS, + WebDAVBinding.JSON_PROPERTY_PORT, + WebDAVBinding.JSON_PROPERTY_ENABLE_HTTPS, + WebDAVBinding.JSON_PROPERTY_MIN_TLS_VERSION, + WebDAVBinding.JSON_PROPERTY_CLIENT_AUTH_TYPE, + WebDAVBinding.JSON_PROPERTY_TLS_CIPHER_SUITES, + WebDAVBinding.JSON_PROPERTY_PREFIX, + WebDAVBinding.JSON_PROPERTY_PROXY_ALLOWED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class WebDAVBinding { + public static final String JSON_PROPERTY_ADDRESS = "address"; + private String address; + + public static final String JSON_PROPERTY_PORT = "port"; + private Integer port; + + public static final String JSON_PROPERTY_ENABLE_HTTPS = "enable_https"; + private Boolean enableHttps; + + public static final String JSON_PROPERTY_MIN_TLS_VERSION = "min_tls_version"; + private TLSVersions minTlsVersion; + + public static final String JSON_PROPERTY_CLIENT_AUTH_TYPE = "client_auth_type"; + private Integer clientAuthType; + + public static final String JSON_PROPERTY_TLS_CIPHER_SUITES = "tls_cipher_suites"; + private List tlsCipherSuites = new ArrayList<>(); + + public static final String JSON_PROPERTY_PREFIX = "prefix"; + private String prefix; + + public static final String JSON_PROPERTY_PROXY_ALLOWED = "proxy_allowed"; + private List proxyAllowed = new ArrayList<>(); + + public WebDAVBinding() { + } + + public WebDAVBinding address(String address) { + + this.address = address; + return this; + } + + /** + * TCP address the server listen on + * @return address + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAddress() { + return address; + } + + + @JsonProperty(JSON_PROPERTY_ADDRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAddress(String address) { + this.address = address; + } + + public WebDAVBinding port(Integer port) { + + this.port = port; + return this; + } + + /** + * the port used for serving requests + * @return port + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPort() { + return port; + } + + + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPort(Integer port) { + this.port = port; + } + + public WebDAVBinding enableHttps(Boolean enableHttps) { + + this.enableHttps = enableHttps; + return this; + } + + /** + * Get enableHttps + * @return enableHttps + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getEnableHttps() { + return enableHttps; + } + + + @JsonProperty(JSON_PROPERTY_ENABLE_HTTPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnableHttps(Boolean enableHttps) { + this.enableHttps = enableHttps; + } + + public WebDAVBinding minTlsVersion(TLSVersions minTlsVersion) { + + this.minTlsVersion = minTlsVersion; + return this; + } + + /** + * Get minTlsVersion + * @return minTlsVersion + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_TLS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TLSVersions getMinTlsVersion() { + return minTlsVersion; + } + + + @JsonProperty(JSON_PROPERTY_MIN_TLS_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinTlsVersion(TLSVersions minTlsVersion) { + this.minTlsVersion = minTlsVersion; + } + + public WebDAVBinding clientAuthType(Integer clientAuthType) { + + this.clientAuthType = clientAuthType; + return this; + } + + /** + * 1 means that client certificate authentication is required in addition to HTTP basic authentication + * @return clientAuthType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getClientAuthType() { + return clientAuthType; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT_AUTH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClientAuthType(Integer clientAuthType) { + this.clientAuthType = clientAuthType; + } + + public WebDAVBinding tlsCipherSuites(List tlsCipherSuites) { + + this.tlsCipherSuites = tlsCipherSuites; + return this; + } + + public WebDAVBinding addTlsCipherSuitesItem(String tlsCipherSuitesItem) { + if (this.tlsCipherSuites == null) { + this.tlsCipherSuites = new ArrayList<>(); + } + this.tlsCipherSuites.add(tlsCipherSuitesItem); + return this; + } + + /** + * List of supported cipher suites for TLS version 1.2. If empty a default list of secure cipher suites is used, with a preference order based on hardware performance + * @return tlsCipherSuites + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TLS_CIPHER_SUITES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTlsCipherSuites() { + return tlsCipherSuites; + } + + + @JsonProperty(JSON_PROPERTY_TLS_CIPHER_SUITES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTlsCipherSuites(List tlsCipherSuites) { + this.tlsCipherSuites = tlsCipherSuites; + } + + public WebDAVBinding prefix(String prefix) { + + this.prefix = prefix; + return this; + } + + /** + * Prefix for WebDAV resources, if empty WebDAV resources will be available at the `/` URI + * @return prefix + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrefix() { + return prefix; + } + + + @JsonProperty(JSON_PROPERTY_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public WebDAVBinding proxyAllowed(List proxyAllowed) { + + this.proxyAllowed = proxyAllowed; + return this; + } + + public WebDAVBinding addProxyAllowedItem(String proxyAllowedItem) { + if (this.proxyAllowed == null) { + this.proxyAllowed = new ArrayList<>(); + } + this.proxyAllowed.add(proxyAllowedItem); + return this; + } + + /** + * List of IP addresses and IP ranges allowed to set proxy headers + * @return proxyAllowed + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROXY_ALLOWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getProxyAllowed() { + return proxyAllowed; + } + + + @JsonProperty(JSON_PROPERTY_PROXY_ALLOWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProxyAllowed(List proxyAllowed) { + this.proxyAllowed = proxyAllowed; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebDAVBinding webDAVBinding = (WebDAVBinding) o; + return Objects.equals(this.address, webDAVBinding.address) && + Objects.equals(this.port, webDAVBinding.port) && + Objects.equals(this.enableHttps, webDAVBinding.enableHttps) && + Objects.equals(this.minTlsVersion, webDAVBinding.minTlsVersion) && + Objects.equals(this.clientAuthType, webDAVBinding.clientAuthType) && + Objects.equals(this.tlsCipherSuites, webDAVBinding.tlsCipherSuites) && + Objects.equals(this.prefix, webDAVBinding.prefix) && + Objects.equals(this.proxyAllowed, webDAVBinding.proxyAllowed); + } + + @Override + public int hashCode() { + return Objects.hash(address, port, enableHttps, minTlsVersion, clientAuthType, tlsCipherSuites, prefix, proxyAllowed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebDAVBinding {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" enableHttps: ").append(toIndentedString(enableHttps)).append("\n"); + sb.append(" minTlsVersion: ").append(toIndentedString(minTlsVersion)).append("\n"); + sb.append(" clientAuthType: ").append(toIndentedString(clientAuthType)).append("\n"); + sb.append(" tlsCipherSuites: ").append(toIndentedString(tlsCipherSuites)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" proxyAllowed: ").append(toIndentedString(proxyAllowed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVServiceStatus.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVServiceStatus.java new file mode 100644 index 00000000..21d6e1a1 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/client/model/WebDAVServiceStatus.java @@ -0,0 +1,163 @@ +/* + * SFTPGo + * SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + * + * The version of the OpenAPI document: 2.6.4 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.jackson.nullable.JsonNullable; + +import java.util.*; + +/** + * WebDAVServiceStatus + */ +@JsonPropertyOrder({ + WebDAVServiceStatus.JSON_PROPERTY_IS_ACTIVE, + WebDAVServiceStatus.JSON_PROPERTY_BINDINGS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T09:15:17.190691+01:00[Europe/Warsaw]", comments = "Generator version: 7.9.0") +public class WebDAVServiceStatus { + public static final String JSON_PROPERTY_IS_ACTIVE = "is_active"; + public static final String JSON_PROPERTY_BINDINGS = "bindings"; + private Boolean isActive; + private JsonNullable> bindings = JsonNullable.>undefined(); + + public WebDAVServiceStatus() { + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + public WebDAVServiceStatus isActive(Boolean isActive) { + + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * + * @return isActive + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsActive() { + return isActive; + } + + @JsonProperty(JSON_PROPERTY_IS_ACTIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public WebDAVServiceStatus bindings(List bindings) { + this.bindings = JsonNullable.>of(bindings); + + return this; + } + + public WebDAVServiceStatus addBindingsItem(WebDAVBinding bindingsItem) { + if (this.bindings == null || !this.bindings.isPresent()) { + this.bindings = JsonNullable.>of(new ArrayList<>()); + } + try { + this.bindings.get().add(bindingsItem); + } catch (NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get bindings + * + * @return bindings + */ + @javax.annotation.Nullable + @JsonIgnore + + public List getBindings() { + return bindings.orElse(null); + } + + public void setBindings(List bindings) { + this.bindings = JsonNullable.>of(bindings); + } + + @JsonProperty(JSON_PROPERTY_BINDINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getBindings_JsonNullable() { + return bindings; + } + + @JsonProperty(JSON_PROPERTY_BINDINGS) + public void setBindings_JsonNullable(JsonNullable> bindings) { + this.bindings = bindings; + } + + @Override + public int hashCode() { + return Objects.hash(isActive, hashCodeNullable(bindings)); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebDAVServiceStatus webDAVServiceStatus = (WebDAVServiceStatus) o; + return Objects.equals(this.isActive, webDAVServiceStatus.isActive) && + equalsNullable(this.bindings, webDAVServiceStatus.bindings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebDAVServiceStatus {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" bindings: ").append(toIndentedString(bindings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/S3ConnectionsConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/S3ConnectionsConfig.java new file mode 100644 index 00000000..645a601d --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/S3ConnectionsConfig.java @@ -0,0 +1,34 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.config; + +import lombok.Data; +import lombok.extern.log4j.Log4j2; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.validation.annotation.Validated; + +import java.util.List; + +@Log4j2 +@Data +@Validated +@ConfigurationProperties("hello-data") +public class S3ConnectionsConfig { + + private List s3Connections; + + public S3Connection getS3Connection(String contextKey) { + return s3Connections.stream().filter(c -> c.contextKey.equals(contextKey)) + .findFirst().orElseThrow(() -> new RuntimeException(String.format("No s3 config for data domain: %s", contextKey))); + } + + @Data + public static class S3Connection { + private String contextKey; + private String endpoint; + private String bucket; + private String region; + private String accessKey; + private String accessSecret; + private boolean forcePathStyle; + } + +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/WebClientConfig.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/WebClientConfig.java new file mode 100644 index 00000000..8951241b --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/config/WebClientConfig.java @@ -0,0 +1,41 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.config; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.client.reactive.ReactorClientHttpConnector; +import org.springframework.web.reactive.function.client.ExchangeFilterFunction; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClient; + +@Log4j2 +@Configuration +public class WebClientConfig { + + @Value("${hello-data.sftpgo.base-url}") + private String baseUrl; + + private static ExchangeFilterFunction logRequest() { + return ExchangeFilterFunction.ofRequestProcessor(clientRequest -> { + log.info("Request: {} {}", clientRequest.method(), clientRequest.url()); + clientRequest.headers().forEach((name, values) -> values.forEach(value -> log.info("{}={}", name, value))); + return Mono.just(clientRequest); + }); + } + + @Bean + public ApiClient sftpGoApiClient() { + WebClient webClient = WebClient.builder() + .baseUrl(baseUrl) + .clientConnector(new ReactorClientHttpConnector( + HttpClient.create().wiretap(true) + )) + .build(); + ApiClient apiClient = new ApiClient(webClient); + apiClient.setBasePath(baseUrl + apiClient.getBasePath()); + return apiClient; + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoCreateUserConsumer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoCreateUserConsumer.java new file mode 100644 index 00000000..752fffff --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoCreateUserConsumer.java @@ -0,0 +1,42 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.listener; + +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.SubsystemUserUpdate; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.resource.SftpGoUserResourceProviderService; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.CREATE_USER; + +@Log4j2 +@Service +@SuppressWarnings("java:S3516") +@RequiredArgsConstructor +public class SftpGoCreateUserConsumer { + + private final SftpGoService sftpgoService; + private final SftpGoUserResourceProviderService sftpGoUserResourceProviderService; + + + @SuppressWarnings("unused") + @JetStreamSubscribe(event = CREATE_USER, asyncRun = false) + public void createUser(SubsystemUserUpdate subsystemUserUpdate) { + try { + log.info("------- Received SFTPGo user creation request {}", subsystemUserUpdate); + User user = sftpgoService.getUser(subsystemUserUpdate.getUsername()); + log.info("User {} already created", user); + } catch (WebClientResponseException.NotFound notFound) { + log.debug("", notFound); + sftpgoService.createUser(subsystemUserUpdate.getEmail(), subsystemUserUpdate.getUsername(), subsystemUserUpdate.getPassword()); + } catch (Exception e) { + log.error("Could not create user {}", subsystemUserUpdate.getEmail(), e); + } + if (subsystemUserUpdate.isSendBackUsersList()) { + sftpGoUserResourceProviderService.publishUsers(); + } + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoDisableUserConsumer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoDisableUserConsumer.java new file mode 100644 index 00000000..8e59c4b7 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoDisableUserConsumer.java @@ -0,0 +1,34 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.listener; + +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.SubsystemUserUpdate; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.resource.SftpGoUserResourceProviderService; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.DISABLE_USER; + +@Log4j2 +@Service +@SuppressWarnings("java:S3516") +@RequiredArgsConstructor +public class SftpGoDisableUserConsumer { + private final SftpGoService sftpgoService; + private final SftpGoUserResourceProviderService sftpGoUserResourceProviderService; + + @SuppressWarnings("unused") + @JetStreamSubscribe(event = DISABLE_USER, asyncRun = false) + public void disableUser(SubsystemUserUpdate subsystemUserUpdate) { + try { + log.info("------- Received SFTPGo user disable request {}", subsystemUserUpdate); + sftpgoService.disableUser(subsystemUserUpdate.getUsername()); + if (subsystemUserUpdate.isSendBackUsersList()) { + sftpGoUserResourceProviderService.publishUsers(); + } + } catch (Exception e) { + log.error("Could not disable user {}", subsystemUserUpdate.getEmail(), e); + } + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoEnableUserConsumer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoEnableUserConsumer.java new file mode 100644 index 00000000..bbb679aa --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoEnableUserConsumer.java @@ -0,0 +1,34 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.listener; + +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.SubsystemUserUpdate; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.resource.SftpGoUserResourceProviderService; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.ENABLE_USER; + +@Log4j2 +@Service +@SuppressWarnings("java:S3516") +@RequiredArgsConstructor +public class SftpGoEnableUserConsumer { + private final SftpGoService sftpgoService; + private final SftpGoUserResourceProviderService sftpGoUserResourceProviderService; + + @SuppressWarnings("unused") + @JetStreamSubscribe(event = ENABLE_USER, asyncRun = false) + public void enableUser(SubsystemUserUpdate subsystemUserUpdate) { + try { + log.info("------- Received SFTPGo user enable request {}", subsystemUserUpdate); + sftpgoService.enableUser(subsystemUserUpdate.getUsername()); + if (subsystemUserUpdate.isSendBackUsersList()) { + sftpGoUserResourceProviderService.publishUsers(); + } + } catch (Exception e) { + log.error("Could not enable user {}", subsystemUserUpdate.getEmail(), e); + } + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoPublishedAppInfoResourcesConsumer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoPublishedAppInfoResourcesConsumer.java new file mode 100644 index 00000000..585c0386 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoPublishedAppInfoResourcesConsumer.java @@ -0,0 +1,52 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.listener; + +import ch.bedag.dap.hellodata.commons.SlugifyUtil; +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.sidecars.context.HdBusinessContextInfo; +import ch.bedag.dap.hellodata.commons.sidecars.context.HdContextType; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.appinfo.AppInfoResource; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Permission; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.util.List; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.PUBLISH_APP_INFO_RESOURCES; + +@Log4j2 +@Service +@AllArgsConstructor +public class SftpGoPublishedAppInfoResourcesConsumer { + + public static final String ADMIN_GROUP_POSTFIX = "-admin"; + public static final String EDITOR_GROUP_POSTFIX = "-editor"; + public static final String VIEWER_GROUP_POSTFIX = "-viewer"; + + private final SftpGoService sftpGoService; + + @SuppressWarnings("unused") + @JetStreamSubscribe(event = PUBLISH_APP_INFO_RESOURCES) + public void subscribe(AppInfoResource appInfoResource) { + HdBusinessContextInfo businessContextInfo = appInfoResource.getBusinessContextInfo(); + HdBusinessContextInfo subContext = businessContextInfo.getSubContext(); + if (subContext != null && subContext.getType().equalsIgnoreCase(HdContextType.DATA_DOMAIN.getTypeName())) { + log.info("------- Received appInfo resource {}, for the following context config {}", appInfoResource, businessContextInfo); + String dataDomainKey = subContext.getKey(); + log.info("--> Creating missing groups with virtual folders for the data domain: {} ", dataDomainKey); + String groupName = SlugifyUtil.slugify(dataDomainKey, ""); + sftpGoService.createGroup(dataDomainKey, subContext.getName(), groupName + ADMIN_GROUP_POSTFIX, List.of(Permission.STAR)); + sftpGoService.createGroup(dataDomainKey, subContext.getName(), groupName + EDITOR_GROUP_POSTFIX, + List.of(Permission.LIST, + Permission.DOWNLOAD, + Permission.RENAME, + Permission.OVERWRITE, + Permission.RENAME_DIRS, + Permission.COPY, + Permission.CREATE_DIRS)); + sftpGoService.createGroup(dataDomainKey, subContext.getName(), groupName + VIEWER_GROUP_POSTFIX, + List.of(Permission.LIST, Permission.DOWNLOAD)); + } + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoSyncUsersConsumer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoSyncUsersConsumer.java new file mode 100644 index 00000000..b0db6f55 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoSyncUsersConsumer.java @@ -0,0 +1,39 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.listener; + + +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.UserContextRoleUpdate; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.UsersContextRoleUpdate; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.time.StopWatch; +import org.springframework.stereotype.Service; + +import java.util.List; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.SYNC_USERS; + +@Log4j2 +@Service +@AllArgsConstructor +public class SftpGoSyncUsersConsumer { + + private final SftpGoUpdateUserContextRoleConsumer sftpGoUpdateUserContextRoleConsumer; + + @SuppressWarnings("unused") + @JetStreamSubscribe(event = SYNC_USERS, timeoutMinutes = 15L) + public void subscribe(UsersContextRoleUpdate usersContextRoleUpdate) { + StopWatch stopWatch = new StopWatch(); + stopWatch.start(); + log.info("[SYNC_USERS] Started users synchronization"); + List userContextRoleUpdates = usersContextRoleUpdate.getUserContextRoleUpdates(); + for (UserContextRoleUpdate userContextRoleUpdate : userContextRoleUpdates) { + try { + sftpGoUpdateUserContextRoleConsumer.processContextRoleUpdate(userContextRoleUpdate); + } catch (Exception e) { + log.error("Could not synchronize user {}", userContextRoleUpdate.getEmail(), e); + } + } + log.info("[SYNC_USERS] Finished users synchronization. Operation took {}", stopWatch.formatTime()); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoUpdateUserContextRoleConsumer.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoUpdateUserContextRoleConsumer.java new file mode 100644 index 00000000..50463988 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/listener/SftpGoUpdateUserContextRoleConsumer.java @@ -0,0 +1,103 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.listener; + +import ch.bedag.dap.hellodata.commons.SlugifyUtil; +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.sidecars.context.HelloDataContextConfig; +import ch.bedag.dap.hellodata.commons.sidecars.context.role.HdRoleName; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.UserContextRoleUpdate; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.GroupMapping; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.resource.SftpGoUserResourceProviderService; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import java.util.ArrayList; +import java.util.Optional; +import java.util.UUID; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.UPDATE_USER_CONTEXT_ROLE; +import static ch.bedag.dap.hellodata.sidecars.sftpgo.listener.SftpGoPublishedAppInfoResourcesConsumer.*; +import static ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService.ADMIN_GROUP_NAME; + +@Log4j2 +@Service +@AllArgsConstructor +public class SftpGoUpdateUserContextRoleConsumer { + + private final SftpGoService sftpGoService; + private final SftpGoUserResourceProviderService sftpGoUserResourceProviderService; + private final HelloDataContextConfig helloDataContextConfig; + + @SuppressWarnings("unused") + @JetStreamSubscribe(event = UPDATE_USER_CONTEXT_ROLE) + public void processContextRoleUpdate(UserContextRoleUpdate userContextRoleUpdate) { + log.info("-=-=-=-= RECEIVED USER CONTEXT ROLES UPDATE: payload: {}", userContextRoleUpdate); + User user = fetchUser(userContextRoleUpdate); + checkBusinessContextRole(userContextRoleUpdate, user); + checkDataDomainRoles(userContextRoleUpdate, user); + sftpGoService.updateUser(user); + log.info("Updated user {}", user); + if (userContextRoleUpdate.isSendBackUsersList()) { + sftpGoUserResourceProviderService.publishUsers(); + } + } + + private void addUserToGroup(GroupMapping.TypeEnum type, String adminGroupName, User user) { + GroupMapping groupMapping = new GroupMapping(); + groupMapping.type(type); + groupMapping.name(adminGroupName); + user.addGroupsItem(groupMapping); + } + + private void removeUserFromGroup(User user, String adminGroupName) { + user.setGroups(new ArrayList<>(user.getGroups().stream().filter(groupMapping -> !groupMapping.getName().equalsIgnoreCase(adminGroupName)).toList())); + } + + private void checkDataDomainRoles(UserContextRoleUpdate userContextRoleUpdate, User user) { + userContextRoleUpdate.getContextRoles().stream() + .filter(contextRole -> !contextRole.getContextKey().equalsIgnoreCase(helloDataContextConfig.getBusinessContext().getKey())).forEach(userContextRole -> { + String groupName = SlugifyUtil.slugify(userContextRole.getContextKey(), ""); + removeUserFromGroup(user, groupName + ADMIN_GROUP_POSTFIX); + removeUserFromGroup(user, groupName + EDITOR_GROUP_POSTFIX); + removeUserFromGroup(user, groupName + VIEWER_GROUP_POSTFIX); + switch (userContextRole.getRoleName()) { + case DATA_DOMAIN_ADMIN -> + addUserToGroup(GroupMapping.TypeEnum.NUMBER_2, groupName + ADMIN_GROUP_POSTFIX, user); + case DATA_DOMAIN_EDITOR -> + addUserToGroup(GroupMapping.TypeEnum.NUMBER_2, groupName + EDITOR_GROUP_POSTFIX, user); + case DATA_DOMAIN_VIEWER -> + addUserToGroup(GroupMapping.TypeEnum.NUMBER_2, groupName + VIEWER_GROUP_POSTFIX, user); + } + }); + } + + private void checkBusinessContextRole(UserContextRoleUpdate userContextRoleUpdate, User user) { + Optional businessDomainRole = userContextRoleUpdate.getContextRoles().stream() + .filter(contextRole -> contextRole.getContextKey().equalsIgnoreCase(helloDataContextConfig.getBusinessContext().getKey())).findFirst(); + businessDomainRole.ifPresent(businessDomainRoleContext -> { + HdRoleName roleName = businessDomainRoleContext.getRoleName(); + removeUserFromGroup(user, ADMIN_GROUP_NAME); + if (roleName != HdRoleName.NONE) { + addUserToGroup(GroupMapping.TypeEnum.NUMBER_1, ADMIN_GROUP_NAME, user); + } + }); + } + + private User fetchUser(UserContextRoleUpdate userContextRoleUpdate) { + User user = null; + try { + user = sftpGoService.getUser(userContextRoleUpdate.getUsername()); + log.info("User {} already created", user); + } catch (WebClientResponseException.NotFound notFound) { + log.debug("", notFound); + user = sftpGoService.createUser(userContextRoleUpdate.getEmail(), userContextRoleUpdate.getUsername(), UUID.randomUUID().toString()); + } catch (Exception e) { + log.error("Could not create user {}", userContextRoleUpdate.getEmail(), e); + } + return user; + } + +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/SftpGoService.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/SftpGoService.java new file mode 100644 index 00000000..ad7c0afe --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/SftpGoService.java @@ -0,0 +1,252 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.service; + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.api.FoldersApi; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.api.GroupsApi; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.api.TokenApi; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.api.UsersApi; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.ApiClient; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.HttpBasicAuth; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.HttpBearerAuth; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.*; +import ch.bedag.dap.hellodata.sidecars.sftpgo.config.S3ConnectionsConfig; +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.Permission.STAR; +import static org.springframework.web.reactive.function.client.WebClientResponseException.Conflict; +import static org.springframework.web.reactive.function.client.WebClientResponseException.NotFound; + +@Log4j2 +@Service +@RequiredArgsConstructor +public class SftpGoService { + public static final String ADMIN_GROUP_NAME = "Admin"; + private final ApiClient sftpGoApiClient; + private final S3ConnectionsConfig s3ConnectionsConfig; + + @Value("${hello-data.sftpgo.admin-username}") + private String sftpGoAdminUsername; + @Value("${hello-data.sftpgo.admin-password}") + private String sftpGoAdminPassword; + @Value("${hello-data.admin-virtual-folder}") + private String adminVirtualFolder; + + private OffsetDateTime lastRefreshTime; + + @PostConstruct + public void init() { + initAdminGroup(); + } + + public List getAllUsers() { + refreshToken(); + UsersApi usersApi = new UsersApi(sftpGoApiClient); + return usersApi.getUsers(0, Integer.MAX_VALUE, "ASC").collectList().block(); + } + + public User getUser(String username) { + refreshToken(); + UsersApi usersApi = new UsersApi(sftpGoApiClient); + return usersApi.getUserByUsername(username, 0).block(); + } + + public void disableUser(String username) { + refreshToken(); + User user = getUser(username); + user.setStatus(User.StatusEnum.NUMBER_0); + UsersApi usersApi = new UsersApi(sftpGoApiClient); + usersApi.updateUser(username, user, 1).block(); + log.info("User {} disabled", username); + } + + public void updateUser(User user) { + refreshToken(); + UsersApi usersApi = new UsersApi(sftpGoApiClient); + usersApi.updateUser(user.getUsername(), user, 1).block(); + log.info("User {} updated", user.getUsername()); + } + + public void enableUser(String username) { + refreshToken(); + User user = getUser(username); + user.setStatus(User.StatusEnum.NUMBER_1); + UsersApi usersApi = new UsersApi(sftpGoApiClient); + usersApi.updateUser(username, user, 1).block(); + log.info("User {} enabled", username); + } + + public User createUser(String email, String username, String password) { + refreshToken(); + UsersApi usersApi = new UsersApi(sftpGoApiClient); + User user = new User(); + user.setUsername(username); + user.setPassword(password); + user.setEmail(email); + user.setStatus(User.StatusEnum.NUMBER_1); + + HashMap> permissions = new HashMap<>(); + permissions.put("/", List.of(STAR)); + user.permissions(permissions); + + UserFilters filters = new UserFilters(); + filters.setWebClient(List.of(WebClientOptions.MFA_DISABLED)); + user.setFilters(filters); + + User createdUser = usersApi.addUser(user, 0).block(); + if (createdUser != null) { + usersApi.disableUser2fa(createdUser.getUsername()).block(); + log.info("User {} created", username); + } else { + log.info("User {} not created", username); + } + return createdUser; + } + + public void createGroup(String dataDomainKey, String dataDomainName, String groupName, List permissions) { + refreshToken(); + GroupsApi groupsApi = new GroupsApi(sftpGoApiClient); + try { + Group existingGroup = groupsApi.getGroupByName(groupName, 0).block(); + log.info("Group {} already exists", existingGroup.getName()); + } catch (NotFound notFound) { + log.debug("", notFound); + log.info("Group {} not found, creating...", groupName); + Group group = new Group(); + group.setName(groupName); + group.setDescription(dataDomainName); + + VirtualFolder vf = createVirtualFolder(dataDomainKey, dataDomainName, groupName); + group.setVirtualFolders(List.of(vf)); + + GroupUserSettings groupUserSettings = new GroupUserSettings(); + Map> permissionsMap = new HashMap<>(); + permissionsMap.put(vf.getVirtualPath() + "/", permissions); + groupUserSettings.setPermissions(permissionsMap); + group.setUserSettings(groupUserSettings); + + groupsApi.addGroup(group, 0).block(); + log.info("Group {} created", groupName); + } + } + + private void initAdminGroup() { + refreshToken(); + GroupsApi groupsApi = new GroupsApi(sftpGoApiClient); + try { + Group existingGroup = groupsApi.getGroupByName(ADMIN_GROUP_NAME, 0).block(); + log.info("Admin group '{}' already exists", existingGroup); + } catch (NotFound notFound) { + log.debug("", notFound); + log.info("Admin group not found, creating..."); + createAdminGroup(groupsApi); + } + } + + private void createAdminGroup(GroupsApi groupsApi) { + refreshToken(); + BaseVirtualFolder baseVirtualFolder = new BaseVirtualFolder(); + baseVirtualFolder.setName(ADMIN_GROUP_NAME); + baseVirtualFolder.setMappedPath(adminVirtualFolder); + FoldersApi foldersApi = new FoldersApi(sftpGoApiClient); + BaseVirtualFolder createdFolder = foldersApi.addFolder(baseVirtualFolder, 0).block(); + + Group group = getGroup(createdFolder); + groupsApi.addGroup(group, 0).block(); + log.info("Admin group created"); + } + + private Group getGroup(BaseVirtualFolder createdFolder) { + Group group = new Group(); + group.setName(ADMIN_GROUP_NAME); + group.setDescription("Admin group"); + VirtualFolder virtualFolder = new VirtualFolder(); + virtualFolder.setName(createdFolder.getName()); + virtualFolder.setMappedPath(createdFolder.getMappedPath()); + virtualFolder.setVirtualPath(adminVirtualFolder); + virtualFolder.setId(createdFolder.getId()); + List virtualFolders = new ArrayList<>(); + virtualFolders.add(virtualFolder); + group.setVirtualFolders(virtualFolders); + return group; + } + + private VirtualFolder createVirtualFolder(String dataDomainKey, String dataDomainName, String groupName) { + refreshToken(); + S3ConnectionsConfig.S3Connection s3Connection = s3ConnectionsConfig.getS3Connection(dataDomainKey); + S3Config s3Config = new S3Config(); + s3Config.setAccessKey(s3Connection.getAccessKey()); + Secret accessSecret = new Secret(); + accessSecret.setKey(s3Connection.getAccessKey()); + accessSecret.setStatus(Secret.StatusEnum.PLAIN); + accessSecret.setPayload(s3Connection.getAccessSecret()); + s3Config.setAccessSecret(accessSecret); + s3Config.setEndpoint(s3Connection.getEndpoint()); + s3Config.forcePathStyle(s3Connection.isForcePathStyle()); + s3Config.setBucket(s3Connection.getBucket()); + s3Config.setRegion(s3Connection.getRegion()); + FilesystemConfig filesystemConfig = new FilesystemConfig(); + filesystemConfig.s3config(s3Config); + filesystemConfig.setProvider(FsProviders.NUMBER_1); + + BaseVirtualFolder baseVirtualFolder = new BaseVirtualFolder(); + baseVirtualFolder.setName(groupName); + baseVirtualFolder.setDescription(dataDomainName); +// baseVirtualFolder.setMappedPath("/" + groupName); remove mapped path + baseVirtualFolder.setFilesystem(filesystemConfig); + FoldersApi foldersApi = new FoldersApi(sftpGoApiClient); + log.info("Creating folder {}", baseVirtualFolder); + + BaseVirtualFolder createdFolder; + try { + createdFolder = foldersApi.addFolder(baseVirtualFolder, 0).block(); + } catch (Conflict conflict) { + log.info("Folder {} already exists, fetching", baseVirtualFolder); + createdFolder = foldersApi.getFolderByName(groupName, 0).block(); + } + + VirtualFolder vf = new VirtualFolder(); + vf.setName(createdFolder.getName()); + vf.setDescription(createdFolder.getDescription()); + vf.setMappedPath(createdFolder.getMappedPath()); + vf.setVirtualPath("/" + dataDomainName); + vf.setId(createdFolder.getId()); + return vf; + } + + /** + * If the lastRefreshTime is set, check if 20 minutes have passed + */ + private void refreshToken() { + if (lastRefreshTime != null) { + Duration timeSinceLastRefresh = Duration.between(lastRefreshTime, OffsetDateTime.now()); + if (timeSinceLastRefresh.toMinutes() < 25) { + log.info("Token refresh skipped. Last refresh was {} minutes ago.", timeSinceLastRefresh.toMinutes()); + return; + } + } + + HttpBasicAuth basicAuth = (HttpBasicAuth) sftpGoApiClient.getAuthentication("BasicAuth"); + basicAuth.setUsername(sftpGoAdminUsername); + basicAuth.setPassword(sftpGoAdminPassword); + + TokenApi tokenApi = new TokenApi(sftpGoApiClient); + Token token = tokenApi.getToken(null).block(); + + HttpBearerAuth BearerAuth = (HttpBearerAuth) sftpGoApiClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken(token.getAccessToken()); + + lastRefreshTime = OffsetDateTime.now(); + log.info("Token refreshed successfully. Next refresh allowed after 20 minutes."); + } + +} \ No newline at end of file diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/cloud/PodUtilsProvider.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/cloud/PodUtilsProvider.java new file mode 100644 index 00000000..90ecc0db --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/cloud/PodUtilsProvider.java @@ -0,0 +1,50 @@ +/* + * Copyright © 2024, Kanton Bern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package ch.bedag.dap.hellodata.sidecars.sftpgo.service.cloud; + +import io.kubernetes.client.openapi.models.V1Pod; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.cloud.kubernetes.commons.PodUtils; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class PodUtilsProvider { + private final ObjectProvider discoveryClientObjectProvider; + private final ObjectProvider> podUtilsObjectProvider; + + public PodUtils getIfAvailable() { + DiscoveryClient discoveryClient = this.discoveryClientObjectProvider.getIfAvailable(); + if (discoveryClient != null) { + discoveryClient.description(); + discoveryClient.getServices(); + } + return podUtilsObjectProvider.getIfAvailable(); + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoAppInfoResourceProviderService.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoAppInfoResourceProviderService.java new file mode 100644 index 00000000..7a49054a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoAppInfoResourceProviderService.java @@ -0,0 +1,87 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.service.resource; + + +import ch.bedag.dap.hellodata.commons.nats.service.NatsSenderService; +import ch.bedag.dap.hellodata.commons.sidecars.context.HdBusinessContextInfo; +import ch.bedag.dap.hellodata.commons.sidecars.context.HelloDataContextConfig; +import ch.bedag.dap.hellodata.commons.sidecars.modules.ModuleType; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.appinfo.AppInfoResource; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.cloud.PodUtilsProvider; +import io.kubernetes.client.openapi.models.V1Pod; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.kubernetes.commons.PodUtils; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.PUBLISH_APP_INFO_RESOURCES; + +@Log4j2 +@Service +@RequiredArgsConstructor +public class SftpGoAppInfoResourceProviderService { + private final NatsSenderService natsSenderService; + private final PodUtilsProvider podUtilsProvider; + private final HelloDataContextConfig hellodataContextConfig; + + @Value("${hello-data.instance.url}") + private String url; + + @Value("${hello-data.instance.name}") + private String instanceName; + + @Scheduled(fixedDelayString = "${hello-data.sidecar.pubish-interval-minutes:10}", timeUnit = TimeUnit.MINUTES) + public void publishAppInfo() { + log.info("--> publishAppInfo()"); + + PodUtils podUtils = podUtilsProvider.getIfAvailable(); + if (podUtils != null) { + V1Pod current = podUtils.currentPod().get(); + Map details = getDetails(current); + + AppInfoResource appInfoResource = + new AppInfoResource(createBusinessContextInfo(), this.instanceName, current.getMetadata().getNamespace(), ModuleType.SFTPGO, this.url); + appInfoResource.getData().putAll(details); + natsSenderService.publishMessageToJetStream(PUBLISH_APP_INFO_RESOURCES, appInfoResource); + } else { + //dummy info for tests + AppInfoResource appInfoResource = new AppInfoResource(createBusinessContextInfo(), this.instanceName, "local", ModuleType.SFTPGO, this.url); + natsSenderService.publishMessageToJetStream(PUBLISH_APP_INFO_RESOURCES, appInfoResource); + } + } + + private Map getDetails(V1Pod current) { + Map details = new HashMap<>(); + details.put("namespace", current.getMetadata().getNamespace()); + details.put("podName", current.getMetadata().getName()); + details.put("podIp", current.getStatus().getPodIP()); + details.put("serviceAccount", current.getSpec().getServiceAccountName()); + details.put("nodeName", current.getSpec().getNodeName()); + details.put("hostIp", current.getStatus().getHostIP()); + return details; + } + + private HdBusinessContextInfo createBusinessContextInfo() { + HdBusinessContextInfo businessContextInfo = new HdBusinessContextInfo(); + HelloDataContextConfig.BusinessContext businessContext = hellodataContextConfig.getBusinessContext(); + businessContextInfo.setType(businessContext.getType()); + businessContextInfo.setName(businessContext.getName()); + businessContextInfo.setKey(businessContext.getKey()); + businessContextInfo.setExtra(false); + HelloDataContextConfig.Context context = hellodataContextConfig.getContext(); + if (context != null) { + HdBusinessContextInfo subContext = new HdBusinessContextInfo(); + businessContextInfo.setSubContext(subContext); + subContext.setType(context.getType()); + subContext.setName(context.getName()); + subContext.setKey(context.getKey()); + subContext.setExtra(context.isExtra()); + } + return businessContextInfo; + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoUserResourceProviderService.java b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoUserResourceProviderService.java new file mode 100644 index 00000000..cb25bc4a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/java/ch/bedag/dap/hellodata/sidecars/sftpgo/service/resource/SftpGoUserResourceProviderService.java @@ -0,0 +1,81 @@ +package ch.bedag.dap.hellodata.sidecars.sftpgo.service.resource; + +import ch.bedag.dap.hellodata.commons.nats.annotation.JetStreamSubscribe; +import ch.bedag.dap.hellodata.commons.nats.service.NatsSenderService; +import ch.bedag.dap.hellodata.commons.sidecars.modules.ModuleType; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.UserResource; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.SubsystemGetAllUsers; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.SubsystemRole; +import ch.bedag.dap.hellodata.commons.sidecars.resources.v1.user.data.SubsystemUser; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.SftpGoService; +import ch.bedag.dap.hellodata.sidecars.sftpgo.service.cloud.PodUtilsProvider; +import io.kubernetes.client.openapi.models.V1Pod; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.kubernetes.commons.PodUtils; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.GET_ALL_USERS; +import static ch.bedag.dap.hellodata.commons.sidecars.events.HDEvent.PUBLISH_USER_RESOURCES; +import static ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.User.StatusEnum.NUMBER_1; + +@Log4j2 +@Service +@RequiredArgsConstructor +public class SftpGoUserResourceProviderService { + private final NatsSenderService natsSenderService; + private final SftpGoService sftpGoService; + private final PodUtilsProvider podUtilsProvider; + @Value("${hello-data.instance.name}") + private String instanceName; + + @JetStreamSubscribe(event = GET_ALL_USERS) + public void refreshUsers(SubsystemGetAllUsers subsystemGetAllUsers) throws URISyntaxException, IOException { + log.info("--> Publish all users event {}", subsystemGetAllUsers); + publishUsers(); + } + + @Scheduled(fixedDelayString = "${hello-data.sidecar.pubish-interval-minutes:10}", timeUnit = TimeUnit.MINUTES) + public void publishUsers() { + log.info("--> publishUsers()"); + List allUsers = sftpGoService.getAllUsers(); + + PodUtils podUtils = podUtilsProvider.getIfAvailable(); + List subsystemUsers = toSubsystemUsers(allUsers); + if (podUtils != null) { + V1Pod current = podUtils.currentPod().get(); + UserResource userResource = new UserResource(ModuleType.SFTPGO, this.instanceName, current.getMetadata().getNamespace(), subsystemUsers); + natsSenderService.publishMessageToJetStream(PUBLISH_USER_RESOURCES, userResource); + } else { + //dummy info for tests + UserResource userResource = new UserResource(ModuleType.SFTPGO, this.instanceName, "local", subsystemUsers); + natsSenderService.publishMessageToJetStream(PUBLISH_USER_RESOURCES, userResource); + } + } + + private List toSubsystemUsers(List allUsers) { + return allUsers.stream().map(this::toSubsystemUser).toList(); + } + + private SubsystemUser toSubsystemUser(User user) { + SubsystemUser subsystemUser = new SubsystemUser(); + subsystemUser.setActive(user.getStatus() == NUMBER_1); + subsystemUser.setEmail(user.getEmail()); + subsystemUser.setId(user.getId()); + subsystemUser.setUsername(user.getUsername()); + subsystemUser.setRoles(user.getGroups().stream().map(groupMapping -> { + SubsystemRole role = new SubsystemRole(); + role.setName(groupMapping.getName()); + return role; + }).toList()); + return subsystemUser; + } +} diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/README.md b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/README.md new file mode 100644 index 00000000..52e757e5 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/README.md @@ -0,0 +1,447 @@ +# hello-data-sidecar-sftpgo + +Generated with openapi-generator-cli: +```npm install @openapitools/openapi-generator-cli -g``` + +``` +openapi-generator-cli generate \ +-i openapi.yaml \ +--api-package ch.bedag.dap.hellodata.sidecars.sftpgo.client.api \ +--model-package ch.bedag.dap.hellodata.sidecars.sftpgo.client.model \ +--invoker-package ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker \ +--group-id ch.bedag.dap.hellodata \ +--artifact-id hello-data-sidecar-sftpgo \ +--artifact-version develop-SNAPSHOT \ +-g java \ +-p java8=true \ +--library webclient \ +-o spring-openapi-generator-api-client +``` + +SFTPGo + +- API version: 2.6.4 + +- Build date: 2024-12-10T09:15:17.190691+01:00[Europe/Warsaw] + +- Generator version: 7.9.0 + +SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. +Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user +and an S3 bucket (or part of it) for another one. +SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, +for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an +encrypted local filesystem on another one. +Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota +limits for each user. +SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a +group, instead of multiple times to each individual user. +The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and +setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. +From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by +setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP +address, setting an automatic expiration date. + +For more information, please visit [https://github.com/drakkan/sftpgo](https://github.com/drakkan/sftpgo) + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + + ch.bedag.dap.hellodata + hello-data-sidecar-sftpgo + develop-SNAPSHOT + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'hello-data-sidecar-sftpgo' jar has been published to maven central. + mavenLocal() // Needed if the 'hello-data-sidecar-sftpgo' jar has been published to the local maven repo. +} + +dependencies { + implementation "ch.bedag.dap.hellodata:hello-data-sidecar-sftpgo:develop-SNAPSHOT" +} +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/hello-data-sidecar-sftpgo-develop-SNAPSHOT.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.*; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.invoker.auth.*; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.model.*; +import ch.bedag.dap.hellodata.sidecars.sftpgo.client.api.AdminsApi; + +public class AdminsApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("/api/v2"); + + // Configure API key authorization: APIKeyAuth + ApiKeyAuth APIKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyAuth"); + APIKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //APIKeyAuth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: BearerAuth + HttpBearerAuth BearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("BearerAuth"); + BearerAuth.setBearerToken("BEARER TOKEN"); + + AdminsApi apiInstance = new AdminsApi(defaultClient); + Admin admin = new Admin(); // Admin | + try { + Admin result = apiInstance.addAdmin(admin); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AdminsApi#addAdmin"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to */api/v2* + + Class | Method | HTTP request | Description +--------------------|-----------------------------------------------------------------------------------|-------------------------------------------------|--------------------------------------------------------------------- + *AdminsApi* | [**addAdmin**](docs/AdminsApi.md#addAdmin) | **POST** /admins | Add admin + *AdminsApi* | [**adminForgotPassword**](docs/AdminsApi.md#adminForgotPassword) | **POST** /admins/{username}/forgot-password | Send a password reset code by email + *AdminsApi* | [**adminResetPassword**](docs/AdminsApi.md#adminResetPassword) | **POST** /admins/{username}/reset-password | Reset the password + *AdminsApi* | [**changeAdminPassword**](docs/AdminsApi.md#changeAdminPassword) | **PUT** /admin/changepwd | Change admin password + *AdminsApi* | [**deleteAdmin**](docs/AdminsApi.md#deleteAdmin) | **DELETE** /admins/{username} | Delete admin + *AdminsApi* | [**disableAdmin2fa**](docs/AdminsApi.md#disableAdmin2fa) | **PUT** /admins/{username}/2fa/disable | Disable second factor authentication + *AdminsApi* | [**generateAdminRecoveryCodes**](docs/AdminsApi.md#generateAdminRecoveryCodes) | **POST** /admin/2fa/recoverycodes | Generate recovery codes + *AdminsApi* | [**generateAdminTotpSecret**](docs/AdminsApi.md#generateAdminTotpSecret) | **POST** /admin/totp/generate | Generate a new TOTP secret + *AdminsApi* | [**getAdminByUsername**](docs/AdminsApi.md#getAdminByUsername) | **GET** /admins/{username} | Find admins by username + *AdminsApi* | [**getAdminProfile**](docs/AdminsApi.md#getAdminProfile) | **GET** /admin/profile | Get admin profile + *AdminsApi* | [**getAdminRecoveryCodes**](docs/AdminsApi.md#getAdminRecoveryCodes) | **GET** /admin/2fa/recoverycodes | Get recovery codes + *AdminsApi* | [**getAdminTotpConfigs**](docs/AdminsApi.md#getAdminTotpConfigs) | **GET** /admin/totp/configs | Get available TOTP configuration + *AdminsApi* | [**getAdmins**](docs/AdminsApi.md#getAdmins) | **GET** /admins | Get admins + *AdminsApi* | [**saveAdminTotpConfig**](docs/AdminsApi.md#saveAdminTotpConfig) | **POST** /admin/totp/save | Save a TOTP config + *AdminsApi* | [**updateAdmin**](docs/AdminsApi.md#updateAdmin) | **PUT** /admins/{username} | Update admin + *AdminsApi* | [**updateAdminProfile**](docs/AdminsApi.md#updateAdminProfile) | **PUT** /admin/profile | Update admin profile + *AdminsApi* | [**validateAdminTotpSecret**](docs/AdminsApi.md#validateAdminTotpSecret) | **POST** /admin/totp/validate | Validate a one time authentication code + *ApiKeysApi* | [**addApiKey**](docs/ApiKeysApi.md#addApiKey) | **POST** /apikeys | Add API key + *ApiKeysApi* | [**deleteApiKey**](docs/ApiKeysApi.md#deleteApiKey) | **DELETE** /apikeys/{id} | Delete API key + *ApiKeysApi* | [**getApiKeyById**](docs/ApiKeysApi.md#getApiKeyById) | **GET** /apikeys/{id} | Find API key by id + *ApiKeysApi* | [**getApiKeys**](docs/ApiKeysApi.md#getApiKeys) | **GET** /apikeys | Get API keys + *ApiKeysApi* | [**updateApiKey**](docs/ApiKeysApi.md#updateApiKey) | **PUT** /apikeys/{id} | Update API key + *ConnectionsApi* | [**closeConnection**](docs/ConnectionsApi.md#closeConnection) | **DELETE** /connections/{connectionID} | Close connection + *ConnectionsApi* | [**getConnections**](docs/ConnectionsApi.md#getConnections) | **GET** /connections | Get connections details + *DataRetentionApi* | [**getUsersRetentionChecks**](docs/DataRetentionApi.md#getUsersRetentionChecks) | **GET** /retention/users/checks | Get retention checks + *DataRetentionApi* | [**startUserRetentionCheck**](docs/DataRetentionApi.md#startUserRetentionCheck) | **POST** /retention/users/{username}/check | Start a retention check + *DefenderApi* | [**deleteDefenderHostById**](docs/DefenderApi.md#deleteDefenderHostById) | **DELETE** /defender/hosts/{id} | Removes a host from the defender lists + *DefenderApi* | [**getDefenderHostById**](docs/DefenderApi.md#getDefenderHostById) | **GET** /defender/hosts/{id} | Get host by id + *DefenderApi* | [**getDefenderHosts**](docs/DefenderApi.md#getDefenderHosts) | **GET** /defender/hosts | Get hosts + *EventManagerApi* | [**addEventAction**](docs/EventManagerApi.md#addEventAction) | **POST** /eventactions | Add event action + *EventManagerApi* | [**addEventRule**](docs/EventManagerApi.md#addEventRule) | **POST** /eventrules | Add event rule + *EventManagerApi* | [**deleteEventAction**](docs/EventManagerApi.md#deleteEventAction) | **DELETE** /eventactions/{name} | Delete event action + *EventManagerApi* | [**deleteEventRule**](docs/EventManagerApi.md#deleteEventRule) | **DELETE** /eventrules/{name} | Delete event rule + *EventManagerApi* | [**getEventActionByName**](docs/EventManagerApi.md#getEventActionByName) | **GET** /eventactions/{name} | Find event actions by name + *EventManagerApi* | [**getEventActons**](docs/EventManagerApi.md#getEventActons) | **GET** /eventactions | Get event actions + *EventManagerApi* | [**getEventRileByName**](docs/EventManagerApi.md#getEventRileByName) | **GET** /eventrules/{name} | Find event rules by name + *EventManagerApi* | [**getEventRules**](docs/EventManagerApi.md#getEventRules) | **GET** /eventrules | Get event rules + *EventManagerApi* | [**runEventRule**](docs/EventManagerApi.md#runEventRule) | **POST** /eventrules/run/{name} | Run an on-demand event rule + *EventManagerApi* | [**updateEventAction**](docs/EventManagerApi.md#updateEventAction) | **PUT** /eventactions/{name} | Update event action + *EventManagerApi* | [**updateEventRule**](docs/EventManagerApi.md#updateEventRule) | **PUT** /eventrules/{name} | Update event rule + *EventsApi* | [**getFsEvents**](docs/EventsApi.md#getFsEvents) | **GET** /events/fs | Get filesystem events + *EventsApi* | [**getLogEvents**](docs/EventsApi.md#getLogEvents) | **GET** /events/log | Get log events + *EventsApi* | [**getProviderEvents**](docs/EventsApi.md#getProviderEvents) | **GET** /events/provider | Get provider events + *FoldersApi* | [**addFolder**](docs/FoldersApi.md#addFolder) | **POST** /folders | Add folder + *FoldersApi* | [**deleteFolder**](docs/FoldersApi.md#deleteFolder) | **DELETE** /folders/{name} | Delete folder + *FoldersApi* | [**getFolderByName**](docs/FoldersApi.md#getFolderByName) | **GET** /folders/{name} | Find folders by name + *FoldersApi* | [**getFolders**](docs/FoldersApi.md#getFolders) | **GET** /folders | Get folders + *FoldersApi* | [**updateFolder**](docs/FoldersApi.md#updateFolder) | **PUT** /folders/{name} | Update folder + *GroupsApi* | [**addGroup**](docs/GroupsApi.md#addGroup) | **POST** /groups | Add group + *GroupsApi* | [**deleteGroup**](docs/GroupsApi.md#deleteGroup) | **DELETE** /groups/{name} | Delete group + *GroupsApi* | [**getGroupByName**](docs/GroupsApi.md#getGroupByName) | **GET** /groups/{name} | Find groups by name + *GroupsApi* | [**getGroups**](docs/GroupsApi.md#getGroups) | **GET** /groups | Get groups + *GroupsApi* | [**updateGroup**](docs/GroupsApi.md#updateGroup) | **PUT** /groups/{name} | Update group + *HealthcheckApi* | [**healthz**](docs/HealthcheckApi.md#healthz) | **GET** /healthz | health check + *IpListsApi* | [**addIpListEntry**](docs/IpListsApi.md#addIpListEntry) | **POST** /iplists/{type} | Add a new IP list entry + *IpListsApi* | [**deleteIpListEntry**](docs/IpListsApi.md#deleteIpListEntry) | **DELETE** /iplists/{type}/{ipornet} | Delete IP list entry + *IpListsApi* | [**getIpListByIpornet**](docs/IpListsApi.md#getIpListByIpornet) | **GET** /iplists/{type}/{ipornet} | Find entry by ipornet + *IpListsApi* | [**getIpListEntries**](docs/IpListsApi.md#getIpListEntries) | **GET** /iplists/{type} | Get IP list entries + *IpListsApi* | [**updateIpListEntry**](docs/IpListsApi.md#updateIpListEntry) | **PUT** /iplists/{type}/{ipornet} | Update IP list entry + *MaintenanceApi* | [**dumpdata**](docs/MaintenanceApi.md#dumpdata) | **GET** /dumpdata | Dump data + *MaintenanceApi* | [**getStatus**](docs/MaintenanceApi.md#getStatus) | **GET** /status | Get status + *MaintenanceApi* | [**getVersion**](docs/MaintenanceApi.md#getVersion) | **GET** /version | Get version details + *MaintenanceApi* | [**loaddataFromFile**](docs/MaintenanceApi.md#loaddataFromFile) | **GET** /loaddata | Load data from path + *MaintenanceApi* | [**loaddataFromRequestBody**](docs/MaintenanceApi.md#loaddataFromRequestBody) | **POST** /loaddata | Load data + *PublicSharesApi* | [**downloadShareFile**](docs/PublicSharesApi.md#downloadShareFile) | **GET** /shares/{id}/files | Download a single file + *PublicSharesApi* | [**getShare**](docs/PublicSharesApi.md#getShare) | **GET** /shares/{id} | Download shared files and folders as a single zip file + *PublicSharesApi* | [**getShareDirContents**](docs/PublicSharesApi.md#getShareDirContents) | **GET** /shares/{id}/dirs | Read directory contents + *PublicSharesApi* | [**uploadSingleToShare**](docs/PublicSharesApi.md#uploadSingleToShare) | **POST** /shares/{id}/{fileName} | Upload a single file to the shared path + *PublicSharesApi* | [**uploadToShare**](docs/PublicSharesApi.md#uploadToShare) | **POST** /shares/{id} | Upload one or more files to the shared path + *QuotaApi* | [**folderQuotaUpdateUsage**](docs/QuotaApi.md#folderQuotaUpdateUsage) | **PUT** /quotas/folders/{name}/usage | Update folder quota usage limits + *QuotaApi* | [**getFoldersQuotaScans**](docs/QuotaApi.md#getFoldersQuotaScans) | **GET** /quotas/folders/scans | Get active folder quota scans + *QuotaApi* | [**getUsersQuotaScans**](docs/QuotaApi.md#getUsersQuotaScans) | **GET** /quotas/users/scans | Get active user quota scans + *QuotaApi* | [**startFolderQuotaScan**](docs/QuotaApi.md#startFolderQuotaScan) | **POST** /quotas/folders/{name}/scan | Start a folder quota scan + *QuotaApi* | [**startUserQuotaScan**](docs/QuotaApi.md#startUserQuotaScan) | **POST** /quotas/users/{username}/scan | Start a user quota scan + *QuotaApi* | [**userQuotaUpdateUsage**](docs/QuotaApi.md#userQuotaUpdateUsage) | **PUT** /quotas/users/{username}/usage | Update disk quota usage limits + *QuotaApi* | [**userTransferQuotaUpdateUsage**](docs/QuotaApi.md#userTransferQuotaUpdateUsage) | **PUT** /quotas/users/{username}/transfer-usage | Update transfer quota usage limits + *RolesApi* | [**addRole**](docs/RolesApi.md#addRole) | **POST** /roles | Add role + *RolesApi* | [**deleteRole**](docs/RolesApi.md#deleteRole) | **DELETE** /roles/{name} | Delete role + *RolesApi* | [**getRoleByName**](docs/RolesApi.md#getRoleByName) | **GET** /roles/{name} | Find roles by name + *RolesApi* | [**getRoles**](docs/RolesApi.md#getRoles) | **GET** /roles | Get roles + *RolesApi* | [**updateRole**](docs/RolesApi.md#updateRole) | **PUT** /roles/{name} | Update role + *TokenApi* | [**clientLogout**](docs/TokenApi.md#clientLogout) | **GET** /user/logout | Invalidate a user access token + *TokenApi* | [**getToken**](docs/TokenApi.md#getToken) | **GET** /token | Get a new admin access token + *TokenApi* | [**getUserToken**](docs/TokenApi.md#getUserToken) | **GET** /user/token | Get a new user access token + *TokenApi* | [**logout**](docs/TokenApi.md#logout) | **GET** /logout | Invalidate an admin access token + *UserApisApi* | [**addShare**](docs/UserApisApi.md#addShare) | **POST** /user/shares | Add a share + *UserApisApi* | [**changeUserPassword**](docs/UserApisApi.md#changeUserPassword) | **PUT** /user/changepwd | Change user password + *UserApisApi* | [**createUserDir**](docs/UserApisApi.md#createUserDir) | **POST** /user/dirs | Create a directory + *UserApisApi* | [**createUserFile**](docs/UserApisApi.md#createUserFile) | **POST** /user/files/upload | Upload a single file + *UserApisApi* | [**createUserFiles**](docs/UserApisApi.md#createUserFiles) | **POST** /user/files | Upload files + *UserApisApi* | [**deleteUserDir**](docs/UserApisApi.md#deleteUserDir) | **DELETE** /user/dirs | Delete a directory + *UserApisApi* | [**deleteUserFile**](docs/UserApisApi.md#deleteUserFile) | **DELETE** /user/files | Delete a file + *UserApisApi* | [**deleteUserShare**](docs/UserApisApi.md#deleteUserShare) | **DELETE** /user/shares/{id} | Delete share + *UserApisApi* | [**downloadUserFile**](docs/UserApisApi.md#downloadUserFile) | **GET** /user/files | Download a single file + *UserApisApi* | [**generateUserRecoveryCodes**](docs/UserApisApi.md#generateUserRecoveryCodes) | **POST** /user/2fa/recoverycodes | Generate recovery codes + *UserApisApi* | [**generateUserTotpSecret**](docs/UserApisApi.md#generateUserTotpSecret) | **POST** /user/totp/generate | Generate a new TOTP secret + *UserApisApi* | [**getUserDirContents**](docs/UserApisApi.md#getUserDirContents) | **GET** /user/dirs | Read directory contents + *UserApisApi* | [**getUserProfile**](docs/UserApisApi.md#getUserProfile) | **GET** /user/profile | Get user profile + *UserApisApi* | [**getUserRecoveryCodes**](docs/UserApisApi.md#getUserRecoveryCodes) | **GET** /user/2fa/recoverycodes | Get recovery codes + *UserApisApi* | [**getUserShareById**](docs/UserApisApi.md#getUserShareById) | **GET** /user/shares/{id} | Get share by id + *UserApisApi* | [**getUserShares**](docs/UserApisApi.md#getUserShares) | **GET** /user/shares | List user shares + *UserApisApi* | [**getUserTotpConfigs**](docs/UserApisApi.md#getUserTotpConfigs) | **GET** /user/totp/configs | Get available TOTP configuration + *UserApisApi* | [**renameUserDir**](docs/UserApisApi.md#renameUserDir) | **PATCH** /user/dirs | Rename a directory. Deprecated, use \"file-actions/move\" + *UserApisApi* | [**renameUserFile**](docs/UserApisApi.md#renameUserFile) | **PATCH** /user/files | Rename a file + *UserApisApi* | [**saveUserTotpConfig**](docs/UserApisApi.md#saveUserTotpConfig) | **POST** /user/totp/save | Save a TOTP config + *UserApisApi* | [**setpropsUserFile**](docs/UserApisApi.md#setpropsUserFile) | **PATCH** /user/files/metadata | Set metadata for a file/directory + *UserApisApi* | [**streamzip**](docs/UserApisApi.md#streamzip) | **POST** /user/streamzip | Download multiple files and folders as a single zip file + *UserApisApi* | [**updateUserProfile**](docs/UserApisApi.md#updateUserProfile) | **PUT** /user/profile | Update user profile + *UserApisApi* | [**updateUserShare**](docs/UserApisApi.md#updateUserShare) | **PUT** /user/shares/{id} | Update share + *UserApisApi* | [**userFileActionsCopyPost**](docs/UserApisApi.md#userFileActionsCopyPost) | **POST** /user/file-actions/copy | Copy a file or a directory + *UserApisApi* | [**userFileActionsMovePost**](docs/UserApisApi.md#userFileActionsMovePost) | **POST** /user/file-actions/move | Move (rename) a file or a directory + *UserApisApi* | [**validateUserTotpSecret**](docs/UserApisApi.md#validateUserTotpSecret) | **POST** /user/totp/validate | Validate a one time authentication code + *UsersApi* | [**addUser**](docs/UsersApi.md#addUser) | **POST** /users | Add user + *UsersApi* | [**deleteUser**](docs/UsersApi.md#deleteUser) | **DELETE** /users/{username} | Delete user + *UsersApi* | [**disableUser2fa**](docs/UsersApi.md#disableUser2fa) | **PUT** /users/{username}/2fa/disable | Disable second factor authentication + *UsersApi* | [**getUserByUsername**](docs/UsersApi.md#getUserByUsername) | **GET** /users/{username} | Find users by username + *UsersApi* | [**getUsers**](docs/UsersApi.md#getUsers) | **GET** /users | Get users + *UsersApi* | [**updateUser**](docs/UsersApi.md#updateUser) | **PUT** /users/{username} | Update user + *UsersApi* | [**userForgotPassword**](docs/UsersApi.md#userForgotPassword) | **POST** /users/{username}/forgot-password | Send a password reset code by email + *UsersApi* | [**userResetPassword**](docs/UsersApi.md#userResetPassword) | **POST** /users/{username}/reset-password | Reset the password + +## Documentation for Models + +- [APIKey](docs/APIKey.md) +- [APIKeyScope](docs/APIKeyScope.md) +- [AddApiKey201Response](docs/AddApiKey201Response.md) +- [Admin](docs/Admin.md) +- [AdminFilters](docs/AdminFilters.md) +- [AdminGroupMapping](docs/AdminGroupMapping.md) +- [AdminGroupMappingOptions](docs/AdminGroupMappingOptions.md) +- [AdminPermissions](docs/AdminPermissions.md) +- [AdminPreferences](docs/AdminPreferences.md) +- [AdminProfile](docs/AdminProfile.md) +- [AdminResetPasswordRequest](docs/AdminResetPasswordRequest.md) +- [AdminTOTPConfig](docs/AdminTOTPConfig.md) +- [AzureBlobFsConfig](docs/AzureBlobFsConfig.md) +- [BackupData](docs/BackupData.md) +- [BandwidthLimit](docs/BandwidthLimit.md) +- [BaseEventAction](docs/BaseEventAction.md) +- [BaseEventActionOptions](docs/BaseEventActionOptions.md) +- [BaseEventRule](docs/BaseEventRule.md) +- [BaseTOTPConfig](docs/BaseTOTPConfig.md) +- [BaseUserFilters](docs/BaseUserFilters.md) +- [BaseVirtualFolder](docs/BaseVirtualFolder.md) +- [ConditionOptions](docs/ConditionOptions.md) +- [ConditionPattern](docs/ConditionPattern.md) +- [ConnectionStatus](docs/ConnectionStatus.md) +- [CryptFsConfig](docs/CryptFsConfig.md) +- [DataProviderStatus](docs/DataProviderStatus.md) +- [DefenderEntry](docs/DefenderEntry.md) +- [DirEntry](docs/DirEntry.md) +- [DumpDataScopes](docs/DumpDataScopes.md) +- [Dumpdata200Response](docs/Dumpdata200Response.md) +- [EventAction](docs/EventAction.md) +- [EventActionCommandConfig](docs/EventActionCommandConfig.md) +- [EventActionDataRetentionConfig](docs/EventActionDataRetentionConfig.md) +- [EventActionEmailConfig](docs/EventActionEmailConfig.md) +- [EventActionFilesystemConfig](docs/EventActionFilesystemConfig.md) +- [EventActionFsCompress](docs/EventActionFsCompress.md) +- [EventActionHTTPConfig](docs/EventActionHTTPConfig.md) +- [EventActionIDPAccountCheck](docs/EventActionIDPAccountCheck.md) +- [EventActionMinimal](docs/EventActionMinimal.md) +- [EventActionOptions](docs/EventActionOptions.md) +- [EventActionPasswordExpiration](docs/EventActionPasswordExpiration.md) +- [EventActionTypes](docs/EventActionTypes.md) +- [EventActionUserInactivity](docs/EventActionUserInactivity.md) +- [EventConditions](docs/EventConditions.md) +- [EventProtocols](docs/EventProtocols.md) +- [EventRule](docs/EventRule.md) +- [EventRuleMinimal](docs/EventRuleMinimal.md) +- [EventTriggerTypes](docs/EventTriggerTypes.md) +- [FTPDBinding](docs/FTPDBinding.md) +- [FTPPassivePortRange](docs/FTPPassivePortRange.md) +- [FTPServiceStatus](docs/FTPServiceStatus.md) +- [FilesystemActionTypes](docs/FilesystemActionTypes.md) +- [FilesystemConfig](docs/FilesystemConfig.md) +- [FolderQuotaScan](docs/FolderQuotaScan.md) +- [FolderRetention](docs/FolderRetention.md) +- [FsEvent](docs/FsEvent.md) +- [FsEventAction](docs/FsEventAction.md) +- [FsEventStatus](docs/FsEventStatus.md) +- [FsProviders](docs/FsProviders.md) +- [GCSConfig](docs/GCSConfig.md) +- [GenerateAdminTotpSecret200Response](docs/GenerateAdminTotpSecret200Response.md) +- [GenerateAdminTotpSecretRequest](docs/GenerateAdminTotpSecretRequest.md) +- [GenerateUserTotpSecret200Response](docs/GenerateUserTotpSecret200Response.md) +- [Group](docs/Group.md) +- [GroupMapping](docs/GroupMapping.md) +- [GroupUserSettings](docs/GroupUserSettings.md) +- [HTTPFsConfig](docs/HTTPFsConfig.md) +- [HTTPPart](docs/HTTPPart.md) +- [HooksFilter](docs/HooksFilter.md) +- [IPListEntry](docs/IPListEntry.md) +- [IPListMode](docs/IPListMode.md) +- [IPListType](docs/IPListType.md) +- [KeyValue](docs/KeyValue.md) +- [LogEvent](docs/LogEvent.md) +- [LogEventType](docs/LogEventType.md) +- [LoginMethods](docs/LoginMethods.md) +- [MFAProtocols](docs/MFAProtocols.md) +- [MFAStatus](docs/MFAStatus.md) +- [ModelApiResponse](docs/ModelApiResponse.md) +- [OSFsConfig](docs/OSFsConfig.md) +- [PassiveIPOverride](docs/PassiveIPOverride.md) +- [PatternsFilter](docs/PatternsFilter.md) +- [Permission](docs/Permission.md) +- [ProviderEvent](docs/ProviderEvent.md) +- [ProviderEventAction](docs/ProviderEventAction.md) +- [ProviderEventObjectType](docs/ProviderEventObjectType.md) +- [PwdChange](docs/PwdChange.md) +- [QuotaScan](docs/QuotaScan.md) +- [QuotaUsage](docs/QuotaUsage.md) +- [RecoveryCode](docs/RecoveryCode.md) +- [RetentionCheck](docs/RetentionCheck.md) +- [RetentionCheckNotification](docs/RetentionCheckNotification.md) +- [Role](docs/Role.md) +- [S3Config](docs/S3Config.md) +- [SFTPFsConfig](docs/SFTPFsConfig.md) +- [SSHAuthentications](docs/SSHAuthentications.md) +- [SSHBinding](docs/SSHBinding.md) +- [SSHHostKey](docs/SSHHostKey.md) +- [SSHServiceStatus](docs/SSHServiceStatus.md) +- [Schedule](docs/Schedule.md) +- [Secret](docs/Secret.md) +- [ServicesStatus](docs/ServicesStatus.md) +- [ServicesStatusDefender](docs/ServicesStatusDefender.md) +- [ServicesStatusRateLimiters](docs/ServicesStatusRateLimiters.md) +- [SetpropsUserFileRequest](docs/SetpropsUserFileRequest.md) +- [Share](docs/Share.md) +- [ShareScope](docs/ShareScope.md) +- [SupportedProtocols](docs/SupportedProtocols.md) +- [TLSVersions](docs/TLSVersions.md) +- [TOTPConfig](docs/TOTPConfig.md) +- [TOTPHMacAlgo](docs/TOTPHMacAlgo.md) +- [TimePeriod](docs/TimePeriod.md) +- [Token](docs/Token.md) +- [Transfer](docs/Transfer.md) +- [TransferQuotaUsage](docs/TransferQuotaUsage.md) +- [User](docs/User.md) +- [UserFilters](docs/UserFilters.md) +- [UserProfile](docs/UserProfile.md) +- [UserTOTPConfig](docs/UserTOTPConfig.md) +- [UserType](docs/UserType.md) +- [ValidateAdminTotpSecretRequest](docs/ValidateAdminTotpSecretRequest.md) +- [VersionInfo](docs/VersionInfo.md) +- [VirtualFolder](docs/VirtualFolder.md) +- [WebClientOptions](docs/WebClientOptions.md) +- [WebDAVBinding](docs/WebDAVBinding.md) +- [WebDAVServiceStatus](docs/WebDAVServiceStatus.md) + + + +## Documentation for Authorization + +Authentication schemes defined for the API: + + +### BasicAuth + +- **Type**: HTTP basic authentication + + + +### BearerAuth + +- **Type**: HTTP Bearer Token authentication (JWT) + + + +### APIKeyAuth + +- **Type**: API key +- **API key parameter name**: X-SFTPGO-API-KEY +- **Location**: HTTP header + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential +issues. + +## Author + + + diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/openapi.yaml b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/openapi.yaml new file mode 100644 index 00000000..6413e06a --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/openapi/openapi.yaml @@ -0,0 +1,7455 @@ +openapi: 3.0.3 +tags: + - name: healthcheck + - name: token + - name: maintenance + - name: admins + - name: API keys + - name: connections + - name: IP Lists + - name: defender + - name: quota + - name: folders + - name: groups + - name: roles + - name: users + - name: data retention + - name: events + - name: metadata + - name: user APIs + - name: public shares + - name: event manager +info: + title: SFTPGo + description: | + SFTPGo allows you to securely share your files over SFTP and optionally over HTTP/S, FTP/S and WebDAV as well. + Several storage backends are supported and they are configurable per-user, so you can serve a local directory for a user and an S3 bucket (or part of it) for another one. + SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, a user with the S3 backend mapping a Google Cloud Storage bucket (or part of it) on a specified path and an encrypted local filesystem on another one. + Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. + SFTPGo supports groups to simplify the administration of multiple accounts by letting you assign settings once to a group, instead of multiple times to each individual user. + The SFTPGo WebClient allows end users to change their credentials, browse and manage their files in the browser and setup two-factor authentication which works with Authy, Google Authenticator and other compatible apps. + From the WebClient each authorized user can also create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. + version: 2.6.4 + contact: + name: API support + url: 'https://github.com/drakkan/sftpgo' + license: + name: AGPL-3.0-only + url: 'https://www.gnu.org/licenses/agpl-3.0.en.html' +servers: + - url: /api/v2 +security: + - BearerAuth: [ ] + - APIKeyAuth: [ ] +paths: + /healthz: + get: + security: [ ] + servers: + - url: / + tags: + - healthcheck + summary: health check + description: This endpoint can be used to check if the application is running and responding to requests + operationId: healthz + responses: + '200': + description: successful operation + content: + text/plain; charset=utf-8: + schema: + type: string + example: ok + /shares/{id}: + parameters: + - name: id + in: path + description: the share id + required: true + schema: + type: string + get: + security: + - BasicAuth: [ ] + tags: + - public shares + summary: Download shared files and folders as a single zip file + description: A zip file, containing the shared files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip. The share must be defined with the read scope and the associated user must have list and download permissions + operationId: get_share + parameters: + - in: query + name: compress + schema: + type: boolean + default: true + required: false + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: string + format: binary + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + security: + - BasicAuth: [ ] + tags: + - public shares + summary: Upload one or more files to the shared path + description: The share must be defined with the write scope and the associated user must have the upload permission + operationId: upload_to_share + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + filenames: + type: array + items: + type: string + format: binary + minItems: 1 + uniqueItems: true + required: true + responses: + '201': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '413': + $ref: '#/components/responses/RequestEntityTooLarge' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /shares/{id}/files: + parameters: + - name: id + in: path + description: the share id + required: true + schema: + type: string + get: + security: + - BasicAuth: [ ] + tags: + - public shares + summary: Download a single file + description: Returns the file contents as response body. The share must have exactly one path defined and it must be a directory for this to work + operationId: download_share_file + parameters: + - in: query + name: path + required: true + description: Path to the file to download. It must be URL encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt" + schema: + type: string + - in: query + name: inline + required: false + description: 'If set, the response will not have the Content-Disposition header set to `attachment`' + schema: + type: string + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: string + format: binary + '206': + description: successful operation + content: + '*/*': + schema: + type: string + format: binary + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /shares/{id}/dirs: + parameters: + - name: id + in: path + description: the share id + required: true + schema: + type: string + get: + security: + - BasicAuth: [ ] + tags: + - public shares + summary: Read directory contents + description: Returns the contents of the specified directory for the specified share. The share must have exactly one path defined and it must be a directory for this to work + operationId: get_share_dir_contents + parameters: + - in: query + name: path + description: Path to the folder to read. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + schema: + type: string + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DirEntry' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /shares/{id}/{fileName}: + parameters: + - name: id + in: path + description: the share id + required: true + schema: + type: string + - name: fileName + in: path + description: the name of the new file. It must be path encoded. Sub directories are not accepted + required: true + schema: + type: string + - name: X-SFTPGO-MTIME + in: header + schema: + type: integer + description: File modification time as unix timestamp in milliseconds + post: + security: + - BasicAuth: [ ] + tags: + - public shares + summary: Upload a single file to the shared path + description: The share must be defined with the write scope and the associated user must have the upload/overwrite permissions + operationId: upload_single_to_share + requestBody: + content: + application/*: + schema: + type: string + format: binary + text/*: + schema: + type: string + format: binary + image/*: + schema: + type: string + format: binary + audio/*: + schema: + type: string + format: binary + video/*: + schema: + type: string + format: binary + required: true + responses: + '201': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '413': + $ref: '#/components/responses/RequestEntityTooLarge' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /token: + get: + security: + - BasicAuth: [ ] + tags: + - token + summary: Get a new admin access token + description: Returns an access token and its expiration + operationId: get_token + parameters: + - in: header + name: X-SFTPGO-OTP + schema: + type: string + required: false + description: 'If you have 2FA configured for the admin attempting to log in you need to set the authentication code using this header parameter' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /logout: + get: + security: + - BearerAuth: [ ] + tags: + - token + summary: Invalidate an admin access token + description: Allows to invalidate an admin token before its expiration + operationId: logout + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/token: + get: + security: + - BasicAuth: [ ] + tags: + - token + summary: Get a new user access token + description: Returns an access token and its expiration + operationId: get_user_token + parameters: + - in: header + name: X-SFTPGO-OTP + schema: + type: string + required: false + description: 'If you have 2FA configured, for the HTTP protocol, for the user attempting to log in you need to set the authentication code using this header parameter' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Token' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/logout: + get: + security: + - BearerAuth: [ ] + tags: + - token + summary: Invalidate a user access token + description: Allows to invalidate a client token before its expiration + operationId: client_logout + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /version: + get: + tags: + - maintenance + summary: Get version details + description: 'Returns version details such as the version number, build date, commit hash and enabled features' + operationId: get_version + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VersionInfo' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/changepwd: + put: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Change admin password + description: Changes the password for the logged in admin + operationId: change_admin_password + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PwdChange' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/profile: + get: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Get admin profile + description: 'Returns the profile for the logged in admin' + operationId: get_admin_profile + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProfile' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Update admin profile + description: 'Allows to update the profile for the logged in admin' + operationId: update_admin_profile + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AdminProfile' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/2fa/recoverycodes: + get: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Get recovery codes + description: 'Returns the recovery codes for the logged in admin. Recovery codes can be used if the admin loses access to their second factor auth device. Recovery codes are returned unencrypted' + operationId: get_admin_recovery_codes + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecoveryCode' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Generate recovery codes + description: 'Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones' + operationId: generate_admin_recovery_codes + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/totp/configs: + get: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Get available TOTP configuration + description: Returns the available TOTP configurations for the logged in admin + operationId: get_admin_totp_configs + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TOTPConfig' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/totp/generate: + post: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Generate a new TOTP secret + description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in admin' + operationId: generate_admin_totp_secret + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + config_name: + type: string + description: 'name of the configuration to use to generate the secret' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + config_name: + type: string + issuer: + type: string + secret: + type: string + url: + type: string + qr_code: + type: string + format: byte + description: 'QR code png encoded as BASE64' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/totp/validate: + post: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Validate a one time authentication code + description: 'Checks if the given authentication code can be validated using the specified secret and config name' + operationId: validate_admin_totp_secret + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + config_name: + type: string + description: 'name of the configuration to use to validate the passcode' + passcode: + type: string + description: 'passcode to validate' + secret: + type: string + description: 'secret to use to validate the passcode' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Passcode successfully validated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admin/totp/save: + post: + security: + - BearerAuth: [ ] + tags: + - admins + summary: Save a TOTP config + description: 'Saves the specified TOTP config for the logged in admin' + operationId: save_admin_totp_config + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTOTPConfig' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: TOTP configuration saved + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /connections: + get: + tags: + - connections + summary: Get connections details + description: Returns the active users and info about their current uploads/downloads + operationId: get_connections + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ConnectionStatus' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/connections/{connectionID}': + delete: + tags: + - connections + summary: Close connection + description: Terminates an active connection + operationId: close_connection + parameters: + - name: connectionID + in: path + description: ID of the connection to close + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Connection closed + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /iplists/{type}: + parameters: + - name: type + in: path + description: IP list type + required: true + schema: + $ref: '#/components/schemas/IPListType' + get: + tags: + - IP Lists + summary: Get IP list entries + description: Returns an array with one or more IP list entry + operationId: get_ip_list_entries + parameters: + - in: query + name: filter + schema: + type: string + description: restrict results to ipornet matching or starting with this filter + - in: query + name: from + schema: + type: string + description: ipornet to start from + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering entries by ipornet field. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IPListEntry' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - IP Lists + summary: Add a new IP list entry + description: Add an IP address or a CIDR network to a supported list + operationId: add_ip_list_entry + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IPListEntry' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Entry added + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /iplists/{type}/{ipornet}: + parameters: + - name: type + in: path + description: IP list type + required: true + schema: + $ref: '#/components/schemas/IPListType' + - name: ipornet + in: path + required: true + schema: + type: string + get: + tags: + - IP Lists + summary: Find entry by ipornet + description: Returns the entry with the given ipornet if it exists. + operationId: get_ip_list_by_ipornet + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/IPListEntry' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - IP Lists + summary: Update IP list entry + description: Updates an existing IP list entry + operationId: update_ip_list_entry + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IPListEntry' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Entry updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - IP Lists + summary: Delete IP list entry + description: Deletes an existing IP list entry + operationId: delete_ip_list_entry + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Entry deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /defender/hosts: + get: + tags: + - defender + summary: Get hosts + description: Returns hosts that are banned or for which some violations have been detected + operationId: get_defender_hosts + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DefenderEntry' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /defender/hosts/{id}: + parameters: + - name: id + in: path + description: host id + required: true + schema: + type: string + get: + tags: + - defender + summary: Get host by id + description: Returns the host with the given id, if it exists + operationId: get_defender_host_by_id + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DefenderEntry' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - defender + summary: Removes a host from the defender lists + description: Unbans the specified host or clears its violations + operationId: delete_defender_host_by_id + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /retention/users/checks: + get: + tags: + - data retention + summary: Get retention checks + description: Returns the active retention checks + operationId: get_users_retention_checks + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RetentionCheck' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /retention/users/{username}/check: + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + - name: notifications + in: query + description: 'specify how to notify results' + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/RetentionCheckNotification' + post: + tags: + - data retention + summary: Start a retention check + description: 'Starts a new retention check for the given user. If a retention check for this user is already active a 409 status code is returned' + operationId: start_user_retention_check + requestBody: + required: true + description: 'Defines virtual paths to check and their retention time in hours' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FolderRetention' + responses: + '202': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Check started + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/users/scans: + get: + tags: + - quota + summary: Get active user quota scans + description: Returns the active user quota scans + operationId: get_users_quota_scans + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/QuotaScan' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/users/{username}/scan: + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + post: + tags: + - quota + summary: Start a user quota scan + description: Starts a new quota scan for the given user. A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota + operationId: start_user_quota_scan + responses: + '202': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Scan started + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/users/{username}/usage: + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + - in: query + name: mode + required: false + description: the update mode specifies if the given quota usage values should be added or replace the current ones + schema: + type: string + enum: + - add + - reset + description: | + Update type: + * `add` - add the specified quota limits to the current used ones + * `reset` - reset the values to the specified ones. This is the default + example: reset + put: + tags: + - quota + summary: Update disk quota usage limits + description: Sets the current used quota limits for the given user + operationId: user_quota_update_usage + requestBody: + required: true + description: 'If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is "add" the current value, for the missing field, will remain unchanged, if mode is "reset" the missing field is set to 0' + content: + application/json: + schema: + $ref: '#/components/schemas/QuotaUsage' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Quota updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/users/{username}/transfer-usage: + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + - in: query + name: mode + required: false + description: the update mode specifies if the given quota usage values should be added or replace the current ones + schema: + type: string + enum: + - add + - reset + description: | + Update type: + * `add` - add the specified quota limits to the current used ones + * `reset` - reset the values to the specified ones. This is the default + example: reset + put: + tags: + - quota + summary: Update transfer quota usage limits + description: Sets the current used transfer quota limits for the given user + operationId: user_transfer_quota_update_usage + requestBody: + required: true + description: 'If used_upload_data_transfer and used_download_data_transfer are missing they will default to 0, this means that if mode is "add" the current value, for the missing field, will remain unchanged, if mode is "reset" the missing field is set to 0' + content: + application/json: + schema: + $ref: '#/components/schemas/TransferQuotaUsage' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Quota updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/folders/scans: + get: + tags: + - quota + summary: Get active folder quota scans + description: Returns the active folder quota scans + operationId: get_folders_quota_scans + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FolderQuotaScan' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/folders/{name}/scan: + parameters: + - name: name + in: path + description: folder name + required: true + schema: + type: string + post: + tags: + - quota + summary: Start a folder quota scan + description: Starts a new quota scan for the given folder. A quota scan update the number of files and their total size for the specified folder + operationId: start_folder_quota_scan + responses: + '202': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Scan started + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /quotas/folders/{name}/usage: + parameters: + - name: name + in: path + description: folder name + required: true + schema: + type: string + - in: query + name: mode + required: false + description: the update mode specifies if the given quota usage values should be added or replace the current ones + schema: + type: string + enum: + - add + - reset + description: | + Update type: + * `add` - add the specified quota limits to the current used ones + * `reset` - reset the values to the specified ones. This is the default + example: reset + put: + tags: + - quota + summary: Update folder quota usage limits + description: Sets the current used quota limits for the given folder + operationId: folder_quota_update_usage + parameters: + - in: query + name: mode + required: false + description: the update mode specifies if the given quota usage values should be added or replace the current ones + schema: + type: string + enum: + - add + - reset + description: | + Update type: + * `add` - add the specified quota limits to the current used ones + * `reset` - reset the values to the specified ones. This is the default + example: reset + requestBody: + required: true + description: 'If used_quota_size and used_quota_files are missing they will default to 0, this means that if mode is "add" the current value, for the missing field, will remain unchanged, if mode is "reset" the missing field is set to 0' + content: + application/json: + schema: + $ref: '#/components/schemas/QuotaUsage' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Quota updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /folders: + get: + tags: + - folders + summary: Get folders + description: Returns an array with one or more folders + operationId: get_folders + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering folders by name. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseVirtualFolder' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - folders + summary: Add folder + operationId: add_folder + description: Adds a new folder. A quota scan is required to update the used files/size + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BaseVirtualFolder' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/BaseVirtualFolder' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/folders/{name}': + parameters: + - name: name + in: path + description: folder name + required: true + schema: + type: string + get: + tags: + - folders + summary: Find folders by name + description: Returns the folder with the given name if it exists. + operationId: get_folder_by_name + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/BaseVirtualFolder' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - folders + summary: Update folder + description: Updates an existing folder + operationId: update_folder + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BaseVirtualFolder' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Folder updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - folders + summary: Delete folder + description: Deletes an existing folder + operationId: delete_folder + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: User deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /groups: + get: + tags: + - groups + summary: Get groups + description: Returns an array with one or more groups + operationId: get_groups + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering groups by name. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Group' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - groups + summary: Add group + operationId: add_group + description: Adds a new group + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/groups/{name}': + parameters: + - name: name + in: path + description: group name + required: true + schema: + type: string + get: + tags: + - groups + summary: Find groups by name + description: Returns the group with the given name if it exists. + operationId: get_group_by_name + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - groups + summary: Update group + description: Updates an existing group + operationId: update_group + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Group' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Group updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - groups + summary: Delete group + description: Deletes an existing group + operationId: delete_group + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Group deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /roles: + get: + tags: + - roles + summary: Get roles + description: Returns an array with one or more roles + operationId: get_roles + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering groups by name. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - roles + summary: Add role + operationId: add_role + description: Adds a new role + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/roles/{name}': + parameters: + - name: name + in: path + description: role name + required: true + schema: + type: string + get: + tags: + - roles + summary: Find roles by name + description: Returns the role with the given name if it exists. + operationId: get_role_by_name + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - roles + summary: Update role + description: Updates an existing role + operationId: update_role + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Group updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - roles + summary: Delete role + description: Deletes an existing role + operationId: delete_role + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Group deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /eventactions: + get: + tags: + - event manager + summary: Get event actions + description: Returns an array with one or more event actions + operationId: get_event_actons + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering actions by name. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BaseEventAction' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - event manager + summary: Add event action + operationId: add_event_action + description: Adds a new event actions + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BaseEventAction' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/BaseEventAction' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/eventactions/{name}': + parameters: + - name: name + in: path + description: action name + required: true + schema: + type: string + get: + tags: + - event manager + summary: Find event actions by name + description: Returns the event action with the given name if it exists. + operationId: get_event_action_by_name + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/BaseEventAction' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - event manager + summary: Update event action + description: Updates an existing event action + operationId: update_event_action + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BaseEventAction' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Event action updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - event manager + summary: Delete event action + description: Deletes an existing event action + operationId: delete_event_action + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Event action deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /eventrules: + get: + tags: + - event manager + summary: Get event rules + description: Returns an array with one or more event rules + operationId: get_event_rules + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering rules by name. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EventRule' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - event manager + summary: Add event rule + operationId: add_event_rule + description: Adds a new event rule + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventRuleMinimal' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/EventRule' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/eventrules/{name}': + parameters: + - name: name + in: path + description: rule name + required: true + schema: + type: string + get: + tags: + - event manager + summary: Find event rules by name + description: Returns the event rule with the given name if it exists. + operationId: get_event_rile_by_name + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/EventRule' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - event manager + summary: Update event rule + description: Updates an existing event rule + operationId: update_event_rule + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventRuleMinimal' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Event rules updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - event manager + summary: Delete event rule + description: Deletes an existing event rule + operationId: delete_event_rule + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Event rules deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/eventrules/run/{name}': + parameters: + - name: name + in: path + description: on-demand rule name + required: true + schema: + type: string + post: + tags: + - event manager + summary: Run an on-demand event rule + description: The rule's actions will run in background. SFTPGo will not monitor any concurrency and such. If you want to be notified at the end of the execution please add an appropriate action + operationId: run_event_rule + responses: + '202': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Event rule started + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /events/fs: + get: + tags: + - events + summary: Get filesystem events + description: 'Returns an array with one or more filesystem events applying the specified filters. This API is only available if you configure an "eventsearcher" plugin' + operationId: get_fs_events + parameters: + - in: query + name: start_timestamp + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + required: false + description: 'the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter' + - in: query + name: end_timestamp + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + required: false + description: 'the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter' + - in: query + name: actions + schema: + type: array + items: + $ref: '#/components/schemas/FsEventAction' + description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated' + explode: false + required: false + - in: query + name: username + schema: + type: string + description: 'the event username must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: ip + schema: + type: string + description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: ssh_cmd + schema: + type: string + description: 'the event SSH command must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: fs_provider + schema: + $ref: '#/components/schemas/FsProviders' + description: 'the event filesystem provider must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: bucket + schema: + type: string + description: 'the bucket must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: endpoint + schema: + type: string + description: 'the endpoint must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: protocols + schema: + type: array + items: + $ref: '#/components/schemas/EventProtocols' + description: 'the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: statuses + schema: + type: array + items: + $ref: '#/components/schemas/FsEventStatus' + description: 'the event status must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: instance_ids + schema: + type: array + items: + type: string + description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: from_id + schema: + type: string + description: 'the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter.' + required: false + - in: query + name: role + schema: + type: string + description: 'User role. Empty or missing means omit this filter. Ignored if the admin has a role' + required: false + - in: query + name: csv_export + schema: + type: boolean + default: false + required: false + description: 'If enabled, events are exported as a CSV file' + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 1000, default is 100' + - in: query + name: order + required: false + description: Ordering events by timestamp. Default DESC + schema: + type: string + enum: + - ASC + - DESC + example: DESC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FsEvent' + text/csv: + schema: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /events/provider: + get: + tags: + - events + summary: Get provider events + description: 'Returns an array with one or more provider events applying the specified filters. This API is only available if you configure an "eventsearcher" plugin' + operationId: get_provider_events + parameters: + - in: query + name: start_timestamp + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + required: false + description: 'the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter' + - in: query + name: end_timestamp + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + required: false + description: 'the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter' + - in: query + name: actions + schema: + type: array + items: + $ref: '#/components/schemas/ProviderEventAction' + description: 'the event action must be included among those specified. Empty or missing means omit this filter. Actions must be specified comma separated' + explode: false + required: false + - in: query + name: username + schema: + type: string + description: 'the event username must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: ip + schema: + type: string + description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: object_name + schema: + type: string + description: 'the event object name must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: object_types + schema: + type: array + items: + $ref: '#/components/schemas/ProviderEventObjectType' + description: 'the event object type must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: instance_ids + schema: + type: array + items: + type: string + description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: from_id + schema: + type: string + description: 'the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter.' + required: false + - in: query + name: role + schema: + type: string + description: 'Admin role. Empty or missing means omit this filter. Ignored if the admin has a role' + required: false + - in: query + name: csv_export + schema: + type: boolean + default: false + required: false + description: 'If enabled, events are exported as a CSV file' + - in: query + name: omit_object_data + schema: + type: boolean + default: false + required: false + description: 'If enabled, returned events will not contain the `object_data` field' + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 1000, default is 100' + - in: query + name: order + required: false + description: Ordering events by timestamp. Default DESC + schema: + type: string + enum: + - ASC + - DESC + example: DESC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ProviderEvent' + text/csv: + schema: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /events/log: + get: + tags: + - events + summary: Get log events + description: 'Returns an array with one or more log events applying the specified filters. This API is only available if you configure an "eventsearcher" plugin' + operationId: get_log_events + parameters: + - in: query + name: start_timestamp + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + required: false + description: 'the event timestamp, unix timestamp in nanoseconds, must be greater than or equal to the specified one. 0 or missing means omit this filter' + - in: query + name: end_timestamp + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + required: false + description: 'the event timestamp, unix timestamp in nanoseconds, must be less than or equal to the specified one. 0 or missing means omit this filter' + - in: query + name: events + schema: + type: array + items: + $ref: '#/components/schemas/LogEventType' + description: 'the log events must be included among those specified. Empty or missing means omit this filter. Events must be specified comma separated' + explode: false + required: false + - in: query + name: username + schema: + type: string + description: 'the event username must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: ip + schema: + type: string + description: 'the event IP must be the same as the one specified. Empty or missing means omit this filter' + required: false + - in: query + name: protocols + schema: + type: array + items: + $ref: '#/components/schemas/EventProtocols' + description: 'the event protocol must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: instance_ids + schema: + type: array + items: + type: string + description: 'the event instance id must be included among those specified. Empty or missing means omit this filter. Values must be specified comma separated' + explode: false + required: false + - in: query + name: from_id + schema: + type: string + description: 'the event id to start from. This is useful for cursor based pagination. Empty or missing means omit this filter.' + required: false + - in: query + name: role + schema: + type: string + description: 'User role. Empty or missing means omit this filter. Ignored if the admin has a role' + required: false + - in: query + name: csv_export + schema: + type: boolean + default: false + required: false + description: 'If enabled, events are exported as a CSV file' + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 1000, default is 100' + - in: query + name: order + required: false + description: Ordering events by timestamp. Default DESC + schema: + type: string + enum: + - ASC + - DESC + example: DESC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LogEvent' + text/csv: + schema: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /apikeys: + get: + security: + - BearerAuth: [ ] + tags: + - API keys + summary: Get API keys + description: Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response + operationId: get_api_keys + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering API keys by id. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIKey' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + security: + - BearerAuth: [ ] + tags: + - API keys + summary: Add API key + description: Adds a new API key + operationId: add_api_key + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/APIKey' + responses: + '201': + description: successful operation + headers: + X-Object-ID: + schema: + type: string + description: ID for the new created API key + Location: + schema: + type: string + description: URI to retrieve the details for the new created API key + content: + application/json: + schema: + type: object + properties: + mesage: + type: string + example: 'API key created. This is the only time the API key is visible, please save it.' + key: + type: string + description: 'generated API key' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/apikeys/{id}': + parameters: + - name: id + in: path + description: the key id + required: true + schema: + type: string + get: + security: + - BearerAuth: [ ] + tags: + - API keys + summary: Find API key by id + description: Returns the API key with the given id, if it exists. For security reasons the hashed key is omitted in the response + operationId: get_api_key_by_id + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/APIKey' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + security: + - BearerAuth: [ ] + tags: + - API keys + summary: Update API key + description: Updates an existing API key. You cannot update the key itself, the creation date and the last use + operationId: update_api_key + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/APIKey' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: API key updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + security: + - BearerAuth: [ ] + tags: + - API keys + summary: Delete API key + description: Deletes an existing API key + operationId: delete_api_key + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Admin deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /admins: + get: + tags: + - admins + summary: Get admins + description: Returns an array with one or more admins. For security reasons hashed passwords are omitted in the response + operationId: get_admins + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering admins by username. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Admin' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - admins + summary: Add admin + description: 'Adds a new admin. Recovery codes and TOTP configuration cannot be set using this API: each admin must use the specific APIs' + operationId: add_admin + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Admin' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/Admin' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/admins/{username}': + parameters: + - name: username + in: path + description: the admin username + required: true + schema: + type: string + get: + tags: + - admins + summary: Find admins by username + description: 'Returns the admin with the given username, if it exists. For security reasons the hashed password is omitted in the response' + operationId: get_admin_by_username + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Admin' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - admins + summary: Update admin + description: 'Updates an existing admin. Recovery codes and TOTP configuration cannot be set/updated using this API: each admin must use the specific APIs. You are not allowed to update the admin impersonated using an API key' + operationId: update_admin + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Admin' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Admin updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - admins + summary: Delete admin + description: Deletes an existing admin + operationId: delete_admin + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Admin deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/admins/{username}/2fa/disable': + parameters: + - name: username + in: path + description: the admin username + required: true + schema: + type: string + put: + tags: + - admins + summary: Disable second factor authentication + description: 'Disables second factor authentication for the given admin. This API must be used if the admin loses access to their second factor auth device and has no recovery codes' + operationId: disable_admin_2fa + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: 2FA disabled + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/admins/{username}/forgot-password': + parameters: + - name: username + in: path + description: the admin username + required: true + schema: + type: string + post: + security: [ ] + tags: + - admins + summary: Send a password reset code by email + description: 'You must set up an SMTP server and the account must have a valid email address, in which case SFTPGo will send a code via email to reset the password. If the specified admin does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing admins' + operationId: admin_forgot_password + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/admins/{username}/reset-password': + parameters: + - name: username + in: path + description: the admin username + required: true + schema: + type: string + post: + security: [ ] + tags: + - admins + summary: Reset the password + description: 'Set a new password using the code received via email' + operationId: admin_reset_password + requestBody: + content: + application/json: + schema: + type: object + properties: + code: + type: string + password: + type: string + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /users: + get: + tags: + - users + summary: Get users + description: Returns an array with one or more users. For security reasons hashed passwords are omitted in the response + operationId: get_users + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering users by username. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - users + summary: Add user + description: 'Adds a new user.Recovery codes and TOTP configuration cannot be set using this API: each user must use the specific APIs' + operationId: add_user + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + '201': + description: successful operation + headers: + Location: + schema: + type: string + description: 'URI of the newly created object' + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/users/{username}': + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + get: + tags: + - users + summary: Find users by username + description: Returns the user with the given username if it exists. For security reasons the hashed password is omitted in the response + operationId: get_user_by_username + parameters: + - in: query + name: confidential_data + schema: + type: integer + description: 'If set to 1 confidential data will not be hidden. This means that the response will contain the hash of the password and the key and additional data for secrets. If a master key is not set or an external KMS is used, the data returned are enough to get the secrets in cleartext. Ignored if the * permission is not granted.' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - users + summary: Update user + description: 'Updates an existing user and optionally disconnects it, if connected, to apply the new settings. The current password will be preserved if the password field is omitted in the request body. Recovery codes and TOTP configuration cannot be set/updated using this API: each user must use the specific APIs' + operationId: update_user + parameters: + - in: query + name: disconnect + schema: + type: integer + enum: + - 0 + - 1 + description: | + Disconnect: + * `0` The user will not be disconnected and it will continue to use the old configuration until connected. This is the default + * `1` The user will be disconnected after a successful update. It must login again and so it will be forced to use the new configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: User updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - users + summary: Delete user + description: Deletes an existing user + operationId: delete_user + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: User deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/users/{username}/2fa/disable': + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + put: + tags: + - users + summary: Disable second factor authentication + description: 'Disables second factor authentication for the given user. This API must be used if the user loses access to their second factor auth device and has no recovery codes' + operationId: disable_user_2fa + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: 2FA disabled + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/users/{username}/forgot-password': + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + post: + security: [ ] + tags: + - users + summary: Send a password reset code by email + description: 'You must configure an SMTP server, the account must have a valid email address and must not have the "reset-password-disabled" restriction, in which case SFTPGo will send a code via email to reset the password. If the specified user does not exist, the request will be silently ignored (a success response will be returned) to avoid disclosing existing users' + operationId: user_forgot_password + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/users/{username}/reset-password': + parameters: + - name: username + in: path + description: the username + required: true + schema: + type: string + post: + security: [ ] + tags: + - users + summary: Reset the password + description: 'Set a new password using the code received via email' + operationId: user_reset_password + requestBody: + content: + application/json: + schema: + type: object + properties: + code: + type: string + password: + type: string + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /status: + get: + tags: + - maintenance + summary: Get status + description: Retrieves the status of the active services + operationId: get_status + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ServicesStatus' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /dumpdata: + get: + tags: + - maintenance + summary: Dump data + description: 'Backups data as data provider independent JSON. The backup can be saved in a local file on the server, to avoid exposing sensitive data over the network, or returned as response body. The output of dumpdata can be used as input for loaddata' + operationId: dumpdata + parameters: + - in: query + name: output-file + schema: + type: string + description: Path for the file to write the JSON serialized data to. This path is relative to the configured "backups_path". If this file already exists it will be overwritten. To return the backup as response body set `output_data` to true instead. + - in: query + name: output-data + schema: + type: integer + enum: + - 0 + - 1 + description: | + output data: + * `0` or any other value != 1, the backup will be saved to a file on the server, `output_file` is required + * `1` the backup will be returned as response body + - in: query + name: indent + schema: + type: integer + enum: + - 0 + - 1 + description: | + indent: + * `0` no indentation. This is the default + * `1` format the output JSON + - in: query + name: scopes + schema: + type: array + items: + $ref: '#/components/schemas/DumpDataScopes' + description: 'You can limit the dump contents to the specified scopes. Empty or missing means any supported scope. Scopes must be specified comma separated' + explode: false + required: false + responses: + '200': + description: successful operation + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ApiResponse' + - $ref: '#/components/schemas/BackupData' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /loaddata: + parameters: + - in: query + name: scan-quota + schema: + type: integer + enum: + - 0 + - 1 + - 2 + description: | + Quota scan: + * `0` no quota scan is done, the imported users/folders will have used_quota_size and used_quota_files = 0 or the existing values if they already exists. This is the default + * `1` scan quota + * `2` scan quota if the user has quota restrictions + required: false + - in: query + name: mode + schema: + type: integer + enum: + - 0 + - 1 + - 2 + description: | + Mode: + * `0` New objects are added, existing ones are updated. This is the default + * `1` New objects are added, existing ones are not modified + * `2` New objects are added, existing ones are updated and connected users are disconnected and so forced to use the new configuration + get: + tags: + - maintenance + summary: Load data from path + description: 'Restores SFTPGo data from a JSON backup file on the server. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore' + operationId: loaddata_from_file + parameters: + - in: query + name: input-file + schema: + type: string + required: true + description: Path for the file to read the JSON serialized data from. This can be an absolute path or a path relative to the configured "backups_path". The max allowed file size is 10MB + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Data restored + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - maintenance + summary: Load data + description: 'Restores SFTPGo data from a JSON backup. Objects will be restored one by one and the restore is stopped if a object cannot be added or updated, so it could happen a partial restore' + operationId: loaddata_from_request_body + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BackupData' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Data restored + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/changepwd: + put: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Change user password + description: Changes the password for the logged in user + operationId: change_user_password + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PwdChange' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/profile: + get: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Get user profile + description: 'Returns the profile for the logged in user' + operationId: get_user_profile + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfile' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Update user profile + description: 'Allows to update the profile for the logged in user' + operationId: update_user_profile + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfile' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/2fa/recoverycodes: + get: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Get recovery codes + description: 'Returns the recovery codes for the logged in user. Recovery codes can be used if the user loses access to their second factor auth device. Recovery codes are returned unencrypted' + operationId: get_user_recovery_codes + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RecoveryCode' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Generate recovery codes + description: 'Generates new recovery codes for the logged in user. Generating new recovery codes you automatically invalidate old ones' + operationId: generate_user_recovery_codes + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/totp/configs: + get: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Get available TOTP configuration + description: Returns the available TOTP configurations for the logged in user + operationId: get_user_totp_configs + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TOTPConfig' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/totp/generate: + post: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Generate a new TOTP secret + description: 'Generates a new TOTP secret, including the QR code as png, using the specified configuration for the logged in user' + operationId: generate_user_totp_secret + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + config_name: + type: string + description: 'name of the configuration to use to generate the secret' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + config_name: + type: string + issuer: + type: string + secret: + type: string + qr_code: + type: string + format: byte + description: 'QR code png encoded as BASE64' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/totp/validate: + post: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Validate a one time authentication code + description: 'Checks if the given authentication code can be validated using the specified secret and config name' + operationId: validate_user_totp_secret + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + config_name: + type: string + description: 'name of the configuration to use to validate the passcode' + passcode: + type: string + description: 'passcode to validate' + secret: + type: string + description: 'secret to use to validate the passcode' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Passcode successfully validated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/totp/save: + post: + security: + - BearerAuth: [ ] + tags: + - user APIs + summary: Save a TOTP config + description: 'Saves the specified TOTP config for the logged in user' + operationId: save_user_totp_config + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserTOTPConfig' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: TOTP configuration saved + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/shares: + get: + tags: + - user APIs + summary: List user shares + description: Returns the share for the logged in user + operationId: get_user_shares + parameters: + - in: query + name: offset + schema: + type: integer + minimum: 0 + default: 0 + required: false + - in: query + name: limit + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + required: false + description: 'The maximum number of items to return. Max value is 500, default is 100' + - in: query + name: order + required: false + description: Ordering shares by ID. Default ASC + schema: + type: string + enum: + - ASC + - DESC + example: ASC + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Share' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - user APIs + summary: Add a share + operationId: add_share + description: 'Adds a new share. The share id will be auto-generated' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Share' + responses: + '201': + description: successful operation + headers: + X-Object-ID: + schema: + type: string + description: ID for the new created share + Location: + schema: + type: string + description: URI to retrieve the details for the new created share + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + '/user/shares/{id}': + parameters: + - name: id + in: path + description: the share id + required: true + schema: + type: string + get: + tags: + - user APIs + summary: Get share by id + description: Returns a share by id for the logged in user + operationId: get_user_share_by_id + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Share' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + put: + tags: + - user APIs + summary: Update share + description: 'Updates an existing share belonging to the logged in user' + operationId: update_user_share + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Share' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Share updated + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - user APIs + summary: Delete share + description: 'Deletes an existing share belonging to the logged in user' + operationId: delete_user_share + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + message: Share deleted + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/file-actions/copy: + parameters: + - in: query + name: path + description: Path to the file/folder to copy. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + - in: query + name: target + description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + post: + tags: + - user APIs + summary: 'Copy a file or a directory' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/file-actions/move: + parameters: + - in: query + name: path + description: Path to the file/folder to rename. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + - in: query + name: target + description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + post: + tags: + - user APIs + summary: 'Move (rename) a file or a directory' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/dirs: + get: + tags: + - user APIs + summary: Read directory contents + description: Returns the contents of the specified directory for the logged in user + operationId: get_user_dir_contents + parameters: + - in: query + name: path + description: Path to the folder to read. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir". If empty or missing the user's start directory is assumed. If relative, the user's start directory is used as the base + schema: + type: string + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DirEntry' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - user APIs + summary: Create a directory + description: Create a directory for the logged in user + operationId: create_user_dir + parameters: + - in: query + name: path + description: Path to the folder to create. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + - in: query + name: mkdir_parents + description: Create parent directories if they do not exist? + schema: + type: boolean + required: false + responses: + '201': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + patch: + tags: + - user APIs + deprecated: true + summary: 'Rename a directory. Deprecated, use "file-actions/move"' + description: Rename a directory for the logged in user. The rename is allowed for empty directory or for non empty local directories, with no virtual folders inside + operationId: rename_user_dir + parameters: + - in: query + name: path + description: Path to the folder to rename. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + - in: query + name: target + description: New name. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - user APIs + summary: Delete a directory + description: Delete a directory and any children it contains for the logged in user + operationId: delete_user_dir + parameters: + - in: query + name: path + description: Path to the folder to delete. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir" + schema: + type: string + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/files: + get: + tags: + - user APIs + summary: Download a single file + description: Returns the file contents as response body + operationId: download_user_file + parameters: + - in: query + name: path + required: true + description: Path to the file to download. It must be URL encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt" + schema: + type: string + - in: query + name: inline + required: false + description: 'If set, the response will not have the Content-Disposition header set to `attachment`' + schema: + type: string + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: string + format: binary + '206': + description: successful operation + content: + '*/*': + schema: + type: string + format: binary + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + post: + tags: + - user APIs + summary: Upload files + description: Upload one or more files for the logged in user + operationId: create_user_files + parameters: + - in: query + name: path + description: Parent directory for the uploaded files. It must be URL encoded, for example the path "my dir/àdir" must be sent as "my%20dir%2F%C3%A0dir". If empty or missing the root path is assumed. If a file with the same name already exists, it will be overwritten + schema: + type: string + - in: query + name: mkdir_parents + description: Create parent directories if they do not exist? + schema: + type: boolean + required: false + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + filenames: + type: array + items: + type: string + format: binary + minItems: 1 + uniqueItems: true + required: true + responses: + '201': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '413': + $ref: '#/components/responses/RequestEntityTooLarge' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + patch: + tags: + - user APIs + deprecated: true + summary: Rename a file + description: 'Rename a file for the logged in user. Deprecated, use "file-actions/move"' + operationId: rename_user_file + parameters: + - in: query + name: path + description: Path to the file to rename. It must be URL encoded + schema: + type: string + required: true + - in: query + name: target + description: New name. It must be URL encoded + schema: + type: string + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + delete: + tags: + - user APIs + summary: Delete a file + description: Delete a file for the logged in user. + operationId: delete_user_file + parameters: + - in: query + name: path + description: Path to the file to delete. It must be URL encoded + schema: + type: string + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/files/upload: + post: + tags: + - user APIs + summary: Upload a single file + description: 'Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body' + operationId: create_user_file + parameters: + - in: query + name: path + description: Full file path. It must be path encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt". The parent directory must exist. If a file with the same name already exists, it will be overwritten + schema: + type: string + required: true + - in: query + name: mkdir_parents + description: Create parent directories if they do not exist? + schema: + type: boolean + required: false + - in: header + name: X-SFTPGO-MTIME + schema: + type: integer + description: File modification time as unix timestamp in milliseconds + requestBody: + content: + application/*: + schema: + type: string + format: binary + text/*: + schema: + type: string + format: binary + image/*: + schema: + type: string + format: binary + audio/*: + schema: + type: string + format: binary + video/*: + schema: + type: string + format: binary + required: true + responses: + '201': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '413': + $ref: '#/components/responses/RequestEntityTooLarge' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/files/metadata: + patch: + tags: + - user APIs + summary: Set metadata for a file/directory + description: 'Set supported metadata attributes for the specified file or directory' + operationId: setprops_user_file + parameters: + - in: query + name: path + description: Full file/directory path. It must be URL encoded, for example the path "my dir/àdir/file.txt" must be sent as "my%20dir%2F%C3%A0dir%2Ffile.txt" + schema: + type: string + required: true + requestBody: + content: + application/json: + schema: + type: object + properties: + modification_time: + type: integer + description: File modification time as unix timestamp in milliseconds + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '413': + $ref: '#/components/responses/RequestEntityTooLarge' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' + /user/streamzip: + post: + tags: + - user APIs + summary: Download multiple files and folders as a single zip file + description: A zip file, containing the specified files and folders, will be generated on the fly and returned as response body. Only folders and regular files will be included in the zip + operationId: streamzip + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + description: Absolute file or folder path + responses: + '200': + description: successful operation + content: + 'application/zip': + schema: + type: string + format: binary + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + default: + $ref: '#/components/responses/DefaultResponse' +components: + responses: + BadRequest: + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + Unauthorized: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + Forbidden: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + NotFound: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + Conflict: + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + RequestEntityTooLarge: + description: Request Entity Too Large, max allowed size exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + InternalServerError: + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + DefaultResponse: + description: Unexpected Error + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + schemas: + Permission: + type: string + enum: + - '*' + - list + - download + - upload + - overwrite + - delete + - delete_files + - delete_dirs + - rename + - rename_files + - rename_dirs + - create_dirs + - create_symlinks + - chmod + - chown + - chtimes + - copy + description: | + Permissions: + * `*` - all permissions are granted + * `list` - list items is allowed + * `download` - download files is allowed + * `upload` - upload files is allowed + * `overwrite` - overwrite an existing file, while uploading, is allowed. upload permission is required to allow file overwrite + * `delete` - delete files or directories is allowed + * `delete_files` - delete files is allowed + * `delete_dirs` - delete directories is allowed + * `rename` - rename files or directories is allowed + * `rename_files` - rename files is allowed + * `rename_dirs` - rename directories is allowed + * `create_dirs` - create directories is allowed + * `create_symlinks` - create links is allowed + * `chmod` changing file or directory permissions is allowed + * `chown` changing file or directory owner and group is allowed + * `chtimes` changing file or directory access and modification time is allowed + * `copy`, copying files or directories is allowed + AdminPermissions: + type: string + enum: + - '*' + - add_users + - edit_users + - del_users + - view_users + - view_conns + - close_conns + - view_status + - manage_folders + - manage_groups + - quota_scans + - manage_defender + - view_defender + - view_events + - disable_mfa + description: | + Admin permissions: + * `*` - super admin permissions are granted + * `add_users` - add new users is allowed + * `edit_users` - change existing users is allowed + * `del_users` - remove users is allowed + * `view_users` - list users is allowed + * `view_conns` - list active connections is allowed + * `close_conns` - close active connections is allowed + * `view_status` - view the server status is allowed + * `manage_folders` - manage folders is allowed + * `manage_groups` - manage groups is allowed + * `quota_scans` - view and start quota scans is allowed + * `manage_defender` - remove ip from the dynamic blocklist is allowed + * `view_defender` - list the dynamic blocklist is allowed + * `view_events` - view and search filesystem and provider events is allowed + * `disable_mfa` - allow to disable two-factor authentication for users and admins + FsProviders: + type: integer + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + description: | + Filesystem providers: + * `0` - Local filesystem + * `1` - S3 Compatible Object Storage + * `2` - Google Cloud Storage + * `3` - Azure Blob Storage + * `4` - Local filesystem encrypted + * `5` - SFTP + * `6` - HTTP filesystem + EventActionTypes: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 11 + - 12 + - 13 + - 14 + - 15 + description: | + Supported event action types: + * `1` - HTTP + * `2` - Command + * `3` - Email + * `4` - Backup + * `5` - User quota reset + * `6` - Folder quota reset + * `7` - Transfer quota reset + * `8` - Data retention check + * `9` - Filesystem + * `11` - Password expiration check + * `12` - User expiration check + * `13` - Identity Provider account check + * `14` - User inactivity check + * `15` - Rotate log file + FilesystemActionTypes: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + description: | + Supported filesystem action types: + * `1` - Rename + * `2` - Delete + * `3` - Mkdis + * `4` - Exist + * `5` - Compress + * `6` - Copy + EventTriggerTypes: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + description: | + Supported event trigger types: + * `1` - Filesystem event + * `2` - Provider event + * `3` - Schedule + * `4` - IP blocked + * `5` - Certificate renewal + * `6` - On demand, like schedule but executed on demand + * `7` - Identity provider login + LoginMethods: + type: string + enum: + - publickey + - password + - password-over-SSH + - keyboard-interactive + - publickey+password + - publickey+keyboard-interactive + - TLSCertificate + - TLSCertificate+password + description: | + Available login methods. To enable multi-step authentication you have to allow only multi-step login methods + * `publickey` + * `password`, password for all the supported protocols + * `password-over-SSH`, password over SSH protocol (SSH/SFTP/SCP) + * `keyboard-interactive` + * `publickey+password` - multi-step auth: public key and password + * `publickey+keyboard-interactive` - multi-step auth: public key and keyboard interactive + * `TLSCertificate` + * `TLSCertificate+password` - multi-step auth: TLS client certificate and password + SupportedProtocols: + type: string + enum: + - SSH + - FTP + - DAV + - HTTP + description: | + Protocols: + * `SSH` - includes both SFTP and SSH commands + * `FTP` - plain FTP and FTPES/FTPS + * `DAV` - WebDAV over HTTP/HTTPS + * `HTTP` - WebClient/REST API + MFAProtocols: + type: string + enum: + - SSH + - FTP + - HTTP + description: | + Protocols: + * `SSH` - includes both SFTP and SSH commands + * `FTP` - plain FTP and FTPES/FTPS + * `HTTP` - WebClient/REST API + EventProtocols: + type: string + enum: + - SSH + - SFTP + - SCP + - FTP + - DAV + - HTTP + - HTTPShare + - DataRetention + - EventAction + - OIDC + description: | + Protocols: + * `SSH` - SSH commands + * `SFTP` - SFTP protocol + * `SCP` - SCP protocol + * `FTP` - plain FTP and FTPES/FTPS + * `DAV` - WebDAV + * `HTTP` - WebClient/REST API + * `HTTPShare` - the event is generated in a public share + * `DataRetention` - the event is generated by a data retention check + * `EventAction` - the event is generated by an EventManager action + * `OIDC` - OpenID Connect + WebClientOptions: + type: string + enum: + - publickey-change-disabled + - tls-cert-change-disabled + - write-disabled + - mfa-disabled + - password-change-disabled + - api-key-auth-change-disabled + - info-change-disabled + - shares-disabled + - password-reset-disabled + - shares-without-password-disabled + description: | + Options: + * `publickey-change-disabled` - changing SSH public keys is not allowed + * `tls-cert-change-disabled` - changing TLS certificates is not allowed + * `write-disabled` - upload, rename, delete are not allowed even if the user has permissions for these actions + * `mfa-disabled` - enabling multi-factor authentication is not allowed. This option cannot be set if the user has MFA already enabled + * `password-change-disabled` - changing password is not allowed + * `api-key-auth-change-disabled` - enabling/disabling API key authentication is not allowed + * `info-change-disabled` - changing info such as email and description is not allowed + * `shares-disabled` - sharing files and directories with external users is not allowed + * `password-reset-disabled` - resetting the password is not allowed + * `shares-without-password-disabled` - creating shares without password protection is not allowed + RetentionCheckNotification: + type: string + enum: + - Hook + - Email + description: | + Options: + * `Hook` - notify result using the defined hook. A "data_retention_hook" must be defined in your configuration file for this to work + * `Email` - notify results by email. The admin starting the retention check must have an associated email address and the SMTP server must be configured for this to work + APIKeyScope: + type: integer + enum: + - 1 + - 2 + description: | + Options: + * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin + * `2` - user scope. The API key will be used to impersonate an SFTPGo user + ShareScope: + type: integer + enum: + - 1 + - 2 + description: | + Options: + * `1` - read scope + * `2` - write scope + TOTPHMacAlgo: + type: string + enum: + - sha1 + - sha256 + - sha512 + description: 'Supported HMAC algorithms for Time-based one time passwords' + UserType: + type: string + enum: + - '' + - LDAPUser + - OSUser + description: This is an hint for authentication plugins. It is ignored when using SFTPGo internal authentication + DumpDataScopes: + type: string + enum: + - users + - folders + - groups + - admins + - api_keys + - shares + - actions + - rules + - roles + - ip_lists + - configs + LogEventType: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + description: > + Event status: + * `1` - Login failed + * `2` - Login failed non-existent user + * `3` - No login tried + * `4` - Algorithm negotiation failed + * `5` - Login succeeded + FsEventStatus: + type: integer + enum: + - 1 + - 2 + - 3 + description: > + Event status: + * `1` - no error + * `2` - generic error + * `3` - quota exceeded error + FsEventAction: + type: string + enum: + - download + - upload + - first-upload + - first-download + - delete + - rename + - mkdir + - rmdir + - ssh_cmd + ProviderEventAction: + type: string + enum: + - add + - update + - delete + ProviderEventObjectType: + type: string + enum: + - user + - folder + - group + - admin + - api_key + - share + - event_action + - event_rule + - role + SSHAuthentications: + type: string + enum: + - publickey + - password + - keyboard-interactive + - publickey+password + - publickey+keyboard-interactive + TLSVersions: + type: integer + enum: + - 12 + - 13 + description: > + TLS version: + * `12` - TLS 1.2 + * `13` - TLS 1.3 + IPListType: + type: integer + enum: + - 1 + - 2 + - 3 + description: > + IP List types: + * `1` - allow list + * `2` - defender + * `3` - rate limiter safe list + IPListMode: + type: integer + enum: + - 1 + - 2 + description: > + IP list modes + * `1` - allow + * `2` - deny, supported for defender list type only + TOTPConfig: + type: object + properties: + name: + type: string + issuer: + type: string + algo: + $ref: '#/components/schemas/TOTPHMacAlgo' + RecoveryCode: + type: object + properties: + secret: + $ref: '#/components/schemas/Secret' + used: + type: boolean + description: 'Recovery codes to use if the user loses access to their second factor auth device. Each code can only be used once, you should use these codes to login and disable or reset 2FA for your account' + BaseTOTPConfig: + type: object + properties: + enabled: + type: boolean + config_name: + type: string + description: 'This name must be defined within the "totp" section of the SFTPGo configuration file. You will be unable to save a user/admin referencing a missing config_name' + secret: + $ref: '#/components/schemas/Secret' + AdminTOTPConfig: + allOf: + - $ref: '#/components/schemas/BaseTOTPConfig' + UserTOTPConfig: + allOf: + - $ref: '#/components/schemas/BaseTOTPConfig' + - type: object + properties: + protocols: + type: array + items: + $ref: '#/components/schemas/MFAProtocols' + description: 'TOTP will be required for the specified protocols. SSH protocol (SFTP/SCP/SSH commands) will ask for the TOTP passcode if the client uses keyboard interactive authentication. FTP has no standard way to support two factor authentication, if you enable the FTP support, you have to add the TOTP passcode after the password. For example if your password is "password" and your one time passcode is "123456" you have to use "password123456" as password. WebDAV is not supported since each single request must be authenticated and a passcode cannot be reused.' + PatternsFilter: + type: object + properties: + path: + type: string + description: 'virtual path as seen by users, if no other specific filter is defined, the filter applies for sub directories too. For example if filters are defined for the paths "/" and "/sub" then the filters for "/" are applied for any file outside the "/sub" directory' + allowed_patterns: + type: array + items: + type: string + description: 'list of, case insensitive, allowed shell like patterns. Allowed patterns are evaluated before the denied ones' + example: + - '*.jpg' + - a*b?.png + denied_patterns: + type: array + items: + type: string + description: 'list of, case insensitive, denied shell like patterns' + example: + - '*.zip' + deny_policy: + type: integer + enum: + - 0 + - 1 + description: | + Policies for denied patterns + * `0` - default policy. Denied files/directories matching the filters are visible in directory listing but cannot be uploaded/downloaded/overwritten/renamed + * `1` - deny policy hide. This policy applies the same restrictions as the default one and denied files/directories matching the filters will also be hidden in directory listing. This mode may cause performance issues for large directories + HooksFilter: + type: object + properties: + external_auth_disabled: + type: boolean + example: false + description: If true, the external auth hook, if defined, will not be executed + pre_login_disabled: + type: boolean + example: false + description: If true, the pre-login hook, if defined, will not be executed + check_password_disabled: + type: boolean + example: false + description: If true, the check password hook, if defined, will not be executed + description: User specific hook overrides + BandwidthLimit: + type: object + properties: + sources: + type: array + items: + type: string + description: 'Source networks in CIDR notation as defined in RFC 4632 and RFC 4291 for example `192.0.2.0/24` or `2001:db8::/32`. The limit applies if the defined networks contain the client IP' + upload_bandwidth: + type: integer + format: int32 + description: 'Maximum upload bandwidth as KB/s, 0 means unlimited' + download_bandwidth: + type: integer + format: int32 + description: 'Maximum download bandwidth as KB/s, 0 means unlimited' + TimePeriod: + type: object + properties: + day_of_week: + type: integer + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + description: Day of week, 0 Sunday, 6 Saturday + from: + type: string + description: Start time in HH:MM format + to: + type: string + description: End time in HH:MM format + BaseUserFilters: + type: object + properties: + allowed_ip: + type: array + items: + type: string + description: 'only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32"' + example: + - 192.0.2.0/24 + - '2001:db8::/32' + denied_ip: + type: array + items: + type: string + description: clients connecting from these IP/Mask are not allowed. Denied rules are evaluated before allowed ones + example: + - 172.16.0.0/16 + denied_login_methods: + type: array + items: + $ref: '#/components/schemas/LoginMethods' + description: if null or empty any available login method is allowed + denied_protocols: + type: array + items: + $ref: '#/components/schemas/SupportedProtocols' + description: if null or empty any available protocol is allowed + file_patterns: + type: array + items: + $ref: '#/components/schemas/PatternsFilter' + description: 'filters based on shell like file patterns. These restrictions do not apply to files listing for performance reasons, so a denied file cannot be downloaded/overwritten/renamed but it will still be in the list of files. Please note that these restrictions can be easily bypassed' + max_upload_file_size: + type: integer + format: int64 + description: 'maximum allowed size, as bytes, for a single file upload. The upload will be aborted if/when the size of the file being sent exceeds this limit. 0 means unlimited. This restriction does not apply for SSH system commands such as `git` and `rsync`' + tls_username: + type: string + description: 'defines the TLS certificate field to use as username. For FTP clients it must match the name provided using the "USER" command. For WebDAV, if no username is provided, the CN will be used as username. For WebDAV clients it must match the implicit or provided username. Ignored if mutual TLS is disabled. Currently the only supported value is `CommonName`' + tls_certs: + type: array + items: + type: string + hooks: + $ref: '#/components/schemas/HooksFilter' + disable_fs_checks: + type: boolean + example: false + description: Disable checks for existence and automatic creation of home directory and virtual folders. SFTPGo requires that the user's home directory, virtual folder root, and intermediate paths to virtual folders exist to work properly. If you already know that the required directories exist, disabling these checks will speed up login. You could, for example, disable these checks after the first login + web_client: + type: array + items: + $ref: '#/components/schemas/WebClientOptions' + description: WebClient/user REST API related configuration options + allow_api_key_auth: + type: boolean + description: 'API key authentication allows to impersonate this user with an API key' + user_type: + $ref: '#/components/schemas/UserType' + bandwidth_limits: + type: array + items: + $ref: '#/components/schemas/BandwidthLimit' + external_auth_cache_time: + type: integer + description: 'Defines the cache time, in seconds, for users authenticated using an external auth hook. 0 means no cache' + start_directory: + type: string + description: 'Specifies an alternate starting directory. If not set, the default is "/". This option is supported for SFTP/SCP, FTP and HTTP (WebClient/REST API) protocols. Relative paths will use this directory as base.' + two_factor_protocols: + type: array + items: + $ref: '#/components/schemas/MFAProtocols' + description: 'Defines protocols that require two factor authentication' + ftp_security: + type: integer + enum: + - 0 + - 1 + description: 'Set to `1` to require TLS for both data and control connection. his setting is useful if you want to allow both encrypted and plain text FTP sessions globally and then you want to require encrypted sessions on a per-user basis. It has no effect if TLS is already required for all users in the configuration file.' + is_anonymous: + type: boolean + description: 'If enabled the user can login with any password or no password at all. Anonymous users are supported for FTP and WebDAV protocols and permissions will be automatically set to "list" and "download" (read only)' + default_shares_expiration: + type: integer + description: 'Defines the default expiration for newly created shares as number of days. 0 means no expiration' + max_shares_expiration: + type: integer + description: 'Defines the maximum allowed expiration, as a number of days, when a user creates or updates a share. 0 means no expiration' + password_expiration: + type: integer + description: 'The password expires after the defined number of days. 0 means no expiration' + password_strength: + type: integer + description: 'Defines the minimum password strength. 0 means disabled, any password will be accepted. Values in the 50-70 range are suggested for common use cases' + access_time: + type: array + items: + $ref: '#/components/schemas/TimePeriod' + description: Additional user options + UserFilters: + allOf: + - $ref: '#/components/schemas/BaseUserFilters' + - type: object + properties: + require_password_change: + type: boolean + description: 'User must change password from WebClient/REST API at next login' + totp_config: + $ref: '#/components/schemas/UserTOTPConfig' + recovery_codes: + type: array + items: + $ref: '#/components/schemas/RecoveryCode' + Secret: + type: object + properties: + status: + type: string + enum: + - Plain + - AES-256-GCM + - Secretbox + - GCP + - AWS + - VaultTransit + - AzureKeyVault + - Redacted + description: 'Set to "Plain" to add or update an existing secret, set to "Redacted" to preserve the existing value' + payload: + type: string + key: + type: string + additional_data: + type: string + mode: + type: integer + description: 1 means encrypted using a master key + description: The secret is encrypted before saving, so to set a new secret you must provide a payload and set the status to "Plain". The encryption key and additional data will be generated automatically. If you set the status to "Redacted" the existing secret will be preserved + S3Config: + type: object + properties: + bucket: + type: string + minLength: 1 + region: + type: string + minLength: 1 + access_key: + type: string + access_secret: + $ref: '#/components/schemas/Secret' + role_arn: + type: string + description: 'Optional IAM Role ARN to assume' + session_token: + type: string + description: 'Optional Session token that is a part of temporary security credentials provisioned by AWS STS' + endpoint: + type: string + description: optional endpoint + storage_class: + type: string + acl: + type: string + description: 'The canned ACL to apply to uploaded objects. Leave empty to use the default ACL. For more information and available ACLs, see here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl' + upload_part_size: + type: integer + description: 'the buffer size (in MB) to use for multipart uploads. The minimum allowed part size is 5MB, and if this value is set to zero, the default value (5MB) for the AWS SDK will be used. The minimum allowed value is 5.' + upload_concurrency: + type: integer + description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used' + upload_part_max_time: + type: integer + description: 'the maximum time allowed, in seconds, to upload a single chunk (the chunk size is defined via "upload_part_size"). 0 means no timeout' + download_part_size: + type: integer + description: 'the buffer size (in MB) to use for multipart downloads. The minimum allowed part size is 5MB, and if this value is set to zero, the default value (5MB) for the AWS SDK will be used. The minimum allowed value is 5. Ignored for partial downloads' + download_concurrency: + type: integer + description: 'the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used. Ignored for partial downloads' + download_part_max_time: + type: integer + description: 'the maximum time allowed, in seconds, to download a single chunk (the chunk size is defined via "download_part_size"). 0 means no timeout. Ignored for partial downloads.' + force_path_style: + type: boolean + description: 'Set this to "true" to force the request to use path-style addressing, i.e., "http://s3.amazonaws.com/BUCKET/KEY". By default, the S3 client will use virtual hosted bucket addressing when possible ("http://BUCKET.s3.amazonaws.com/KEY")' + key_prefix: + type: string + description: 'key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole bucket contents will be available' + example: folder/subfolder/ + description: S3 Compatible Object Storage configuration details + GCSConfig: + type: object + properties: + bucket: + type: string + minLength: 1 + credentials: + $ref: '#/components/schemas/Secret' + automatic_credentials: + type: integer + enum: + - 0 + - 1 + description: | + Automatic credentials: + * `0` - disabled, explicit credentials, using a JSON credentials file, must be provided. This is the default value if the field is null + * `1` - enabled, we try to use the Application Default Credentials (ADC) strategy to find your application's credentials + storage_class: + type: string + acl: + type: string + description: 'The ACL to apply to uploaded objects. Leave empty to use the default ACL. For more information and available ACLs, refer to the JSON API here: https://cloud.google.com/storage/docs/access-control/lists#predefined-acl' + key_prefix: + type: string + description: 'key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole bucket contents will be available' + example: folder/subfolder/ + upload_part_size: + type: integer + description: 'The buffer size (in MB) to use for multipart uploads. The default value is 16MB. 0 means use the default' + upload_part_max_time: + type: integer + description: 'The maximum time allowed, in seconds, to upload a single chunk. The default value is 32. 0 means use the default' + description: 'Google Cloud Storage configuration details. The "credentials" field must be populated only when adding/updating a user. It will be always omitted, since there are sensitive data, when you search/get users' + AzureBlobFsConfig: + type: object + properties: + container: + type: string + account_name: + type: string + description: 'Storage Account Name, leave blank to use SAS URL' + account_key: + $ref: '#/components/schemas/Secret' + sas_url: + $ref: '#/components/schemas/Secret' + endpoint: + type: string + description: 'optional endpoint. Default is "blob.core.windows.net". If you use the emulator the endpoint must include the protocol, for example "http://127.0.0.1:10000"' + upload_part_size: + type: integer + description: 'the buffer size (in MB) to use for multipart uploads. If this value is set to zero, the default value (5MB) will be used.' + upload_concurrency: + type: integer + description: 'the number of parts to upload in parallel. If this value is set to zero, the default value (5) will be used' + download_part_size: + type: integer + description: 'the buffer size (in MB) to use for multipart downloads. If this value is set to zero, the default value (5MB) will be used.' + download_concurrency: + type: integer + description: 'the number of parts to download in parallel. If this value is set to zero, the default value (5) will be used' + access_tier: + type: string + enum: + - '' + - Archive + - Hot + - Cool + key_prefix: + type: string + description: 'key_prefix is similar to a chroot directory for a local filesystem. If specified the user will only see contents that starts with this prefix and so you can restrict access to a specific virtual folder. The prefix, if not empty, must not start with "/" and must end with "/". If empty the whole container contents will be available' + example: folder/subfolder/ + use_emulator: + type: boolean + description: Azure Blob Storage configuration details + OSFsConfig: + type: object + properties: + read_buffer_size: + type: integer + minimum: 0 + maximum: 10 + description: "The read buffer size, as MB, to use for downloads. 0 means no buffering, that's fine in most use cases." + write_buffer_size: + type: integer + minimum: 0 + maximum: 10 + description: "The write buffer size, as MB, to use for uploads. 0 means no buffering, that's fine in most use cases." + CryptFsConfig: + type: object + properties: + passphrase: + $ref: '#/components/schemas/Secret' + read_buffer_size: + type: integer + minimum: 0 + maximum: 10 + description: "The read buffer size, as MB, to use for downloads. 0 means no buffering, that's fine in most use cases." + write_buffer_size: + type: integer + minimum: 0 + maximum: 10 + description: "The write buffer size, as MB, to use for uploads. 0 means no buffering, that's fine in most use cases." + description: Crypt filesystem configuration details + SFTPFsConfig: + type: object + properties: + endpoint: + type: string + description: 'remote SFTP endpoint as host:port' + username: + type: string + description: you can specify a password or private key or both. In the latter case the private key will be tried first. + password: + $ref: '#/components/schemas/Secret' + private_key: + $ref: '#/components/schemas/Secret' + key_passphrase: + $ref: '#/components/schemas/Secret' + fingerprints: + type: array + items: + type: string + description: 'SHA256 fingerprints to use for host key verification. If you don''t provide any fingerprint the remote host key will not be verified, this is a security risk' + prefix: + type: string + description: Specifying a prefix you can restrict all operations to a given path within the remote SFTP server. + disable_concurrent_reads: + type: boolean + description: Concurrent reads are safe to use and disabling them will degrade performance. Some servers automatically delete files once they are downloaded. Using concurrent reads is problematic with such servers. + buffer_size: + type: integer + minimum: 0 + maximum: 16 + example: 2 + description: The size of the buffer (in MB) to use for transfers. By enabling buffering, the reads and writes, from/to the remote SFTP server, are split in multiple concurrent requests and this allows data to be transferred at a faster rate, over high latency networks, by overlapping round-trip times. With buffering enabled, resuming uploads is not supported and a file cannot be opened for both reading and writing at the same time. 0 means disabled. + equality_check_mode: + type: integer + enum: + - 0 + - 1 + description: | + Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed: + * `0` username and endpoint must match. This is the default + * `1` only the endpoint must match + HTTPFsConfig: + type: object + properties: + endpoint: + type: string + description: 'HTTP/S endpoint URL. SFTPGo will use this URL as base, for example for the `stat` API, SFTPGo will add `/stat/{name}`' + username: + type: string + password: + $ref: '#/components/schemas/Secret' + api_key: + $ref: '#/components/schemas/Secret' + skip_tls_verify: + type: boolean + equality_check_mode: + type: integer + enum: + - 0 + - 1 + description: | + Defines how to check if this config points to the same server as another config. If different configs point to the same server the renaming between the fs configs is allowed: + * `0` username and endpoint must match. This is the default + * `1` only the endpoint must match + FilesystemConfig: + type: object + properties: + provider: + $ref: '#/components/schemas/FsProviders' + osconfig: + $ref: '#/components/schemas/OSFsConfig' + s3config: + $ref: '#/components/schemas/S3Config' + gcsconfig: + $ref: '#/components/schemas/GCSConfig' + azblobconfig: + $ref: '#/components/schemas/AzureBlobFsConfig' + cryptconfig: + $ref: '#/components/schemas/CryptFsConfig' + sftpconfig: + $ref: '#/components/schemas/SFTPFsConfig' + httpconfig: + $ref: '#/components/schemas/HTTPFsConfig' + description: Storage filesystem details + BaseVirtualFolder: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + name: + type: string + description: unique name for this virtual folder + mapped_path: + type: string + description: absolute filesystem path to use as virtual folder + description: + type: string + description: optional description + used_quota_size: + type: integer + format: int64 + used_quota_files: + type: integer + format: int32 + last_quota_update: + type: integer + format: int64 + description: Last quota update as unix timestamp in milliseconds + users: + type: array + items: + type: string + description: list of usernames associated with this virtual folder + filesystem: + $ref: '#/components/schemas/FilesystemConfig' + description: 'Defines the filesystem for the virtual folder and the used quota limits. The same folder can be shared among multiple users and each user can have different quota limits or a different virtual path.' + VirtualFolder: + allOf: + - $ref: '#/components/schemas/BaseVirtualFolder' + - type: object + properties: + virtual_path: + type: string + quota_size: + type: integer + format: int64 + description: 'Quota as size in bytes. 0 means unlimited, -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed' + quota_files: + type: integer + format: int32 + description: 'Quota as number of files. 0 means unlimited, , -1 means included in user quota. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed' + required: + - virtual_path + description: 'A virtual folder is a mapping between a SFTPGo virtual path and a filesystem path outside the user home directory. The specified paths must be absolute and the virtual path cannot be "/", it must be a sub directory. The parent directory for the specified virtual path must exist. SFTPGo will try to automatically create any missing parent directory for the configured virtual folders at user login.' + User: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + status: + type: integer + enum: + - 0 + - 1 + description: | + status: + * `0` user is disabled, login is not allowed + * `1` user is enabled + username: + type: string + description: username is unique + email: + type: string + format: email + description: + type: string + description: 'optional description, for example the user full name' + expiration_date: + type: integer + format: int64 + description: expiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration + password: + type: string + format: password + description: If the password has no known hashing algo prefix it will be stored, by default, using bcrypt, argon2id is supported too. You can send a password hashed as bcrypt ($2a$ prefix), argon2id, pbkdf2 or unix crypt and it will be stored as is. For security reasons this field is omitted when you search/get users + public_keys: + type: array + items: + type: string + example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host + description: Public keys in OpenSSH format. + has_password: + type: boolean + description: Indicates whether the password is set + home_dir: + type: string + description: path to the user home directory. The user cannot upload or download files outside this directory. SFTPGo tries to automatically create this folder if missing. Must be an absolute path + virtual_folders: + type: array + items: + $ref: '#/components/schemas/VirtualFolder' + description: mapping between virtual SFTPGo paths and virtual folders + uid: + type: integer + format: int32 + minimum: 0 + maximum: 2147483647 + description: 'if you run SFTPGo as root user, the created files and directories will be assigned to this uid. 0 means no change, the owner will be the user that runs SFTPGo. Ignored on windows' + gid: + type: integer + format: int32 + minimum: 0 + maximum: 2147483647 + description: 'if you run SFTPGo as root user, the created files and directories will be assigned to this gid. 0 means no change, the group will be the one of the user that runs SFTPGo. Ignored on windows' + max_sessions: + type: integer + format: int32 + description: Limit the sessions that a user can open. 0 means unlimited + quota_size: + type: integer + format: int64 + description: Quota as size in bytes. 0 means unlimited. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + quota_files: + type: integer + format: int32 + description: Quota as number of files. 0 means unlimited. Please note that quota is updated if files are added/removed via SFTPGo otherwise a quota scan or a manual quota update is needed + permissions: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/Permission' + minItems: 1 + minProperties: 1 + description: 'hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory ("/") are required' + example: + /: + - '*' + /somedir: + - list + - download + used_quota_size: + type: integer + format: int64 + used_quota_files: + type: integer + format: int32 + last_quota_update: + type: integer + format: int64 + description: Last quota update as unix timestamp in milliseconds + upload_bandwidth: + type: integer + description: 'Maximum upload bandwidth as KB/s, 0 means unlimited' + download_bandwidth: + type: integer + description: 'Maximum download bandwidth as KB/s, 0 means unlimited' + upload_data_transfer: + type: integer + description: 'Maximum data transfer allowed for uploads as MB. 0 means no limit' + download_data_transfer: + type: integer + description: 'Maximum data transfer allowed for downloads as MB. 0 means no limit' + total_data_transfer: + type: integer + description: 'Maximum total data transfer as MB. 0 means unlimited. You can set a total data transfer instead of the individual values for uploads and downloads' + used_upload_data_transfer: + type: integer + description: 'Uploaded size, as bytes, since the last reset' + used_download_data_transfer: + type: integer + description: 'Downloaded size, as bytes, since the last reset' + created_at: + type: integer + format: int64 + description: 'creation time as unix timestamp in milliseconds. It will be 0 for users created before v2.2.0' + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in milliseconds + last_login: + type: integer + format: int64 + description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes + first_download: + type: integer + format: int64 + description: first download time as unix timestamp in milliseconds + first_upload: + type: integer + format: int64 + description: first upload time as unix timestamp in milliseconds + last_password_change: + type: integer + format: int64 + description: last password change time as unix timestamp in milliseconds + filters: + $ref: '#/components/schemas/UserFilters' + filesystem: + $ref: '#/components/schemas/FilesystemConfig' + additional_info: + type: string + description: Free form text field for external systems + groups: + type: array + items: + $ref: '#/components/schemas/GroupMapping' + oidc_custom_fields: + type: object + additionalProperties: true + description: 'This field is passed to the pre-login hook if custom OIDC token fields have been configured. Field values can be of any type (this is a free form object) and depend on the type of the configured OIDC token fields' + role: + type: string + AdminPreferences: + type: object + properties: + hide_user_page_sections: + type: integer + description: 'Allow to hide some sections from the user page. These are not security settings and are not enforced server side in any way. They are only intended to simplify the user page in the WebAdmin UI. 1 means hide groups section, 2 means hide filesystem section, "users_base_dir" must be set in the config file otherwise this setting is ignored, 4 means hide virtual folders section, 8 means hide profile section, 16 means hide ACLs section, 32 means hide disk and bandwidth quota limits section, 64 means hide advanced settings section. The settings can be combined' + default_users_expiration: + type: integer + description: 'Defines the default expiration for newly created users as number of days. 0 means no expiration' + AdminFilters: + type: object + properties: + allow_list: + type: array + items: + type: string + description: 'only clients connecting from these IP/Mask are allowed. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32"' + example: + - 192.0.2.0/24 + - '2001:db8::/32' + allow_api_key_auth: + type: boolean + description: 'API key auth allows to impersonate this administrator with an API key' + require_two_factor: + type: boolean + require_password_change: + type: boolean + totp_config: + $ref: '#/components/schemas/AdminTOTPConfig' + recovery_codes: + type: array + items: + $ref: '#/components/schemas/RecoveryCode' + preferences: + $ref: '#/components/schemas/AdminPreferences' + Admin: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + status: + type: integer + enum: + - 0 + - 1 + description: | + status: + * `0` user is disabled, login is not allowed + * `1` user is enabled + username: + type: string + description: username is unique + description: + type: string + description: 'optional description, for example the admin full name' + password: + type: string + format: password + description: Admin password. For security reasons this field is omitted when you search/get admins + email: + type: string + format: email + permissions: + type: array + items: + $ref: '#/components/schemas/AdminPermissions' + filters: + $ref: '#/components/schemas/AdminFilters' + additional_info: + type: string + description: Free form text field + groups: + type: array + items: + $ref: '#/components/schemas/AdminGroupMapping' + description: 'Groups automatically selected for new users created by this admin. The admin will still be able to choose different groups. These settings are only used for this admin UI and they will be ignored in REST API/hooks.' + created_at: + type: integer + format: int64 + description: 'creation time as unix timestamp in milliseconds. It will be 0 for admins created before v2.2.0' + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in milliseconds + last_login: + type: integer + format: int64 + description: Last user login as unix timestamp in milliseconds. It is saved at most once every 10 minutes + role: + type: string + description: 'If set the admin can only administer users with the same role. Role admins cannot have the "*" permission' + AdminProfile: + type: object + properties: + email: + type: string + format: email + description: + type: string + allow_api_key_auth: + type: boolean + description: 'If enabled, you can impersonate this admin, in REST API, using an API key. If disabled admin credentials are required for impersonation' + UserProfile: + type: object + properties: + email: + type: string + format: email + description: + type: string + allow_api_key_auth: + type: boolean + description: 'If enabled, you can impersonate this user, in REST API, using an API key. If disabled user credentials are required for impersonation' + public_keys: + type: array + items: + type: string + example: ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEUWwDwEWhTbF0MqAsp/oXK1HR2cElhM8oo1uVmL3ZeDKDiTm4ljMr92wfTgIGDqIoxmVqgYIkAOAhuykAVWBzc= user@host + description: Public keys in OpenSSH format + APIKey: + type: object + properties: + id: + type: string + description: unique key identifier + name: + type: string + description: User friendly key name + key: + type: string + format: password + description: We store the hash of the key. This is just like a password. For security reasons this field is omitted when you search/get API keys + scope: + $ref: '#/components/schemas/APIKeyScope' + created_at: + type: integer + format: int64 + description: creation time as unix timestamp in milliseconds + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in milliseconds + last_use_at: + type: integer + format: int64 + description: last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes + expires_at: + type: integer + format: int64 + description: expiration time as unix timestamp in milliseconds + description: + type: string + description: optional description + user: + type: string + description: username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user + admin: + type: string + description: admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin + QuotaUsage: + type: object + properties: + used_quota_size: + type: integer + format: int64 + used_quota_files: + type: integer + format: int32 + TransferQuotaUsage: + type: object + properties: + used_upload_data_transfer: + type: integer + format: int64 + description: 'The value must be specified as bytes' + used_download_data_transfer: + type: integer + format: int64 + description: 'The value must be specified as bytes' + Transfer: + type: object + properties: + operation_type: + type: string + enum: + - upload + - download + description: | + Operations: + * `upload` + * `download` + path: + type: string + description: file path for the upload/download + start_time: + type: integer + format: int64 + description: start time as unix timestamp in milliseconds + size: + type: integer + format: int64 + description: bytes transferred + ConnectionStatus: + type: object + properties: + username: + type: string + description: connected username + connection_id: + type: string + description: unique connection identifier + client_version: + type: string + description: client version + remote_address: + type: string + description: Remote address for the connected client + connection_time: + type: integer + format: int64 + description: connection time as unix timestamp in milliseconds + command: + type: string + description: Last SSH/FTP command or WebDAV method + last_activity: + type: integer + format: int64 + description: last client activity as unix timestamp in milliseconds + protocol: + type: string + enum: + - SFTP + - SCP + - SSH + - FTP + - DAV + active_transfers: + type: array + items: + $ref: '#/components/schemas/Transfer' + node: + type: string + description: 'Node identifier, omitted for single node installations' + FolderRetention: + type: object + properties: + path: + type: string + description: 'virtual directory path as seen by users, if no other specific retention is defined, the retention applies for sub directories too. For example if retention is defined for the paths "/" and "/sub" then the retention for "/" is applied for any file outside the "/sub" directory' + example: '/' + retention: + type: integer + description: retention time in hours. All the files with a modification time older than the defined value will be deleted. 0 means exclude this path + example: 24 + delete_empty_dirs: + type: boolean + description: if enabled, empty directories will be deleted + ignore_user_permissions: + type: boolean + description: 'if enabled, files will be deleted even if the user does not have the delete permission. The default is "false" which means that files will be skipped if the user does not have permission to delete them. File patterns filters will always be silently ignored' + RetentionCheck: + type: object + properties: + username: + type: string + description: username to which the retention check refers + folders: + type: array + items: + $ref: '#/components/schemas/FolderRetention' + start_time: + type: integer + format: int64 + description: check start time as unix timestamp in milliseconds + notifications: + type: array + items: + $ref: '#/components/schemas/RetentionCheckNotification' + email: + type: string + format: email + description: 'if the notification method is set to "Email", this is the e-mail address that receives the retention check report. This field is automatically set to the email address associated with the administrator starting the check' + QuotaScan: + type: object + properties: + username: + type: string + description: username to which the quota scan refers + start_time: + type: integer + format: int64 + description: scan start time as unix timestamp in milliseconds + FolderQuotaScan: + type: object + properties: + name: + type: string + description: folder name to which the quota scan refers + start_time: + type: integer + format: int64 + description: scan start time as unix timestamp in milliseconds + DefenderEntry: + type: object + properties: + id: + type: string + ip: + type: string + score: + type: integer + description: the score increases whenever a violation is detected, such as an attempt to log in using an incorrect password or invalid username. If the score exceeds the configured threshold, the IP is banned. Omitted for banned IPs + ban_time: + type: string + format: date-time + description: date time until the IP is banned. For already banned hosts, the ban time is increased each time a new violation is detected. Omitted if the IP is not banned + SSHHostKey: + type: object + properties: + path: + type: string + fingerprint: + type: string + algorithms: + type: array + items: + type: string + SSHBinding: + type: object + properties: + address: + type: string + description: TCP address the server listen on + port: + type: integer + description: the port used for serving requests + apply_proxy_config: + type: boolean + description: 'apply the proxy configuration, if any' + WebDAVBinding: + type: object + properties: + address: + type: string + description: TCP address the server listen on + port: + type: integer + description: the port used for serving requests + enable_https: + type: boolean + min_tls_version: + $ref: '#/components/schemas/TLSVersions' + client_auth_type: + type: integer + description: 1 means that client certificate authentication is required in addition to HTTP basic authentication + tls_cipher_suites: + type: array + items: + type: string + description: 'List of supported cipher suites for TLS version 1.2. If empty a default list of secure cipher suites is used, with a preference order based on hardware performance' + prefix: + type: string + description: 'Prefix for WebDAV resources, if empty WebDAV resources will be available at the `/` URI' + proxy_allowed: + type: array + items: + type: string + description: 'List of IP addresses and IP ranges allowed to set proxy headers' + PassiveIPOverride: + type: object + properties: + networks: + type: array + items: + type: string + ip: + type: string + FTPDBinding: + type: object + properties: + address: + type: string + description: TCP address the server listen on + port: + type: integer + description: the port used for serving requests + apply_proxy_config: + type: boolean + description: 'apply the proxy configuration, if any' + tls_mode: + type: integer + enum: + - 0 + - 1 + - 2 + description: | + TLS mode: + * `0` - clear or explicit TLS + * `1` - explicit TLS required + * `2` - implicit TLS + min_tls_version: + $ref: '#/components/schemas/TLSVersions' + force_passive_ip: + type: string + description: External IP address for passive connections + passive_ip_overrides: + type: array + items: + $ref: '#/components/schemas/PassiveIPOverride' + client_auth_type: + type: integer + description: 1 means that client certificate authentication is required in addition to FTP authentication + tls_cipher_suites: + type: array + items: + type: string + description: 'List of supported cipher suites for TLS version 1.2. If empty a default list of secure cipher suites is used, with a preference order based on hardware performance' + passive_connections_security: + type: integer + enum: + - 0 + - 1 + description: | + Active connections security: + * `0` - require matching peer IP addresses of control and data connection + * `1` - disable any checks + active_connections_security: + type: integer + enum: + - 0 + - 1 + description: | + Active connections security: + * `0` - require matching peer IP addresses of control and data connection + * `1` - disable any checks + ignore_ascii_transfer_type: + type: integer + enum: + - 0 + - 1 + description: | + Ignore client requests to perform ASCII translations: + * `0` - ASCII translations are enabled + * `1` - ASCII translations are silently ignored + debug: + type: boolean + description: 'If enabled any FTP command will be logged' + SSHServiceStatus: + type: object + properties: + is_active: + type: boolean + bindings: + type: array + items: + $ref: '#/components/schemas/SSHBinding' + nullable: true + host_keys: + type: array + items: + $ref: '#/components/schemas/SSHHostKey' + nullable: true + ssh_commands: + type: array + items: + type: string + authentications: + type: array + items: + $ref: '#/components/schemas/SSHAuthentications' + public_key_algorithms: + type: array + items: + type: string + macs: + type: array + items: + type: string + kex_algorithms: + type: array + items: + type: string + ciphers: + type: array + items: + type: string + FTPPassivePortRange: + type: object + properties: + start: + type: integer + end: + type: integer + FTPServiceStatus: + type: object + properties: + is_active: + type: boolean + bindings: + type: array + items: + $ref: '#/components/schemas/FTPDBinding' + nullable: true + passive_port_range: + $ref: '#/components/schemas/FTPPassivePortRange' + WebDAVServiceStatus: + type: object + properties: + is_active: + type: boolean + bindings: + type: array + items: + $ref: '#/components/schemas/WebDAVBinding' + nullable: true + DataProviderStatus: + type: object + properties: + is_active: + type: boolean + driver: + type: string + error: + type: string + MFAStatus: + type: object + properties: + is_active: + type: boolean + totp_configs: + type: array + items: + $ref: '#/components/schemas/TOTPConfig' + ServicesStatus: + type: object + properties: + ssh: + $ref: '#/components/schemas/SSHServiceStatus' + ftp: + $ref: '#/components/schemas/FTPServiceStatus' + webdav: + $ref: '#/components/schemas/WebDAVServiceStatus' + data_provider: + $ref: '#/components/schemas/DataProviderStatus' + defender: + type: object + properties: + is_active: + type: boolean + mfa: + $ref: '#/components/schemas/MFAStatus' + allow_list: + type: object + properties: + is_active: + type: boolean + rate_limiters: + type: object + properties: + is_active: + type: boolean + protocols: + type: array + items: + type: string + example: SSH + Share: + type: object + properties: + id: + type: string + description: auto-generated unique share identifier + name: + type: string + description: + type: string + description: optional description + scope: + $ref: '#/components/schemas/ShareScope' + paths: + type: array + items: + type: string + description: 'paths to files or directories, for share scope write this array must contain exactly one directory. Paths will not be validated on save so you can also create them after creating the share' + example: + - '/dir1' + - '/dir2/file.txt' + - '/dir3/subdir' + username: + type: string + created_at: + type: integer + format: int64 + description: 'creation time as unix timestamp in milliseconds' + updated_at: + type: integer + format: int64 + description: 'last update time as unix timestamp in milliseconds' + last_use_at: + type: integer + format: int64 + description: last use time as unix timestamp in milliseconds + expires_at: + type: integer + format: int64 + description: 'optional share expiration, as unix timestamp in milliseconds. 0 means no expiration' + password: + type: string + description: 'optional password to protect the share. The special value "[**redacted**]" means that a password has been set, you can use this value if you want to preserve the current password when you update a share' + max_tokens: + type: integer + description: 'maximum allowed access tokens. 0 means no limit' + used_tokens: + type: integer + allow_from: + type: array + items: + type: string + description: 'Limit the share availability to these IP/Mask. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32". An empty list means no restrictions' + example: + - 192.0.2.0/24 + - '2001:db8::/32' + GroupUserSettings: + type: object + properties: + home_dir: + type: string + max_sessions: + type: integer + format: int32 + quota_size: + type: integer + format: int64 + quota_files: + type: integer + format: int32 + permissions: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/Permission' + minItems: 1 + minProperties: 1 + description: 'hash map with directory as key and an array of permissions as value. Directories must be absolute paths, permissions for root directory ("/") are required' + example: + /: + - '*' + /somedir: + - list + - download + upload_bandwidth: + type: integer + description: 'Maximum upload bandwidth as KB/s' + download_bandwidth: + type: integer + description: 'Maximum download bandwidth as KB/s' + upload_data_transfer: + type: integer + description: 'Maximum data transfer allowed for uploads as MB' + download_data_transfer: + type: integer + description: 'Maximum data transfer allowed for downloads as MB' + total_data_transfer: + type: integer + description: 'Maximum total data transfer as MB' + expires_in: + type: integer + description: 'Account expiration in number of days from creation. 0 means no expiration' + filters: + $ref: '#/components/schemas/BaseUserFilters' + filesystem: + $ref: '#/components/schemas/FilesystemConfig' + Role: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + name: + type: string + description: name is unique + description: + type: string + description: 'optional description' + created_at: + type: integer + format: int64 + description: creation time as unix timestamp in milliseconds + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in milliseconds + users: + type: array + items: + type: string + description: list of usernames associated with this group + admins: + type: array + items: + type: string + description: list of admins usernames associated with this group + Group: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + name: + type: string + description: name is unique + description: + type: string + description: 'optional description' + created_at: + type: integer + format: int64 + description: creation time as unix timestamp in milliseconds + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in milliseconds + user_settings: + $ref: '#/components/schemas/GroupUserSettings' + virtual_folders: + type: array + items: + $ref: '#/components/schemas/VirtualFolder' + description: mapping between virtual SFTPGo paths and folders + users: + type: array + items: + type: string + description: list of usernames associated with this group + admins: + type: array + items: + type: string + description: list of admins usernames associated with this group + GroupMapping: + type: object + properties: + name: + type: string + description: group name + type: + enum: + - 1 + - 2 + - 3 + description: | + Group type: + * `1` - Primary group + * `2` - Secondary group + * `3` - Membership only, no settings are inherited from this group type + AdminGroupMappingOptions: + type: object + properties: + add_to_users_as: + enum: + - 0 + - 1 + - 2 + description: | + Add to new users as: + * `0` - the admin's group will be added as membership group for new users + * `1` - the admin's group will be added as primary group for new users + * `2` - the admin's group will be added as secondary group for new users + AdminGroupMapping: + type: object + properties: + name: + type: string + description: group name + options: + $ref: '#/components/schemas/AdminGroupMappingOptions' + BackupData: + type: object + properties: + users: + type: array + items: + $ref: '#/components/schemas/User' + folders: + type: array + items: + $ref: '#/components/schemas/BaseVirtualFolder' + groups: + type: array + items: + $ref: '#/components/schemas/Group' + admins: + type: array + items: + $ref: '#/components/schemas/Admin' + api_keys: + type: array + items: + $ref: '#/components/schemas/APIKey' + shares: + type: array + items: + $ref: '#/components/schemas/Share' + event_actions: + type: array + items: + $ref: '#/components/schemas/EventAction' + event_rules: + type: array + items: + $ref: '#/components/schemas/EventRule' + roles: + type: array + items: + $ref: '#/components/schemas/Role' + version: + type: integer + PwdChange: + type: object + properties: + current_password: + type: string + new_password: + type: string + DirEntry: + type: object + properties: + name: + type: string + description: name of the file (or subdirectory) described by the entry. This name is the final element of the path (the base name), not the entire path + size: + type: integer + format: int64 + description: file size, omitted for folders and non regular files + mode: + type: integer + description: | + File mode and permission bits. More details here: https://golang.org/pkg/io/fs/#FileMode. + Let's see some examples: + - for a directory mode&2147483648 != 0 + - for a symlink mode&134217728 != 0 + - for a regular file mode&2401763328 == 0 + last_modified: + type: string + format: date-time + FsEvent: + type: object + properties: + id: + type: string + timestamp: + type: integer + format: int64 + description: 'unix timestamp in nanoseconds' + action: + $ref: '#/components/schemas/FsEventAction' + username: + type: string + fs_path: + type: string + fs_target_path: + type: string + virtual_path: + type: string + virtual_target_path: + type: string + ssh_cmd: + type: string + file_size: + type: integer + format: int64 + elapsed: + type: integer + format: int64 + description: elapsed time as milliseconds + status: + $ref: '#/components/schemas/FsEventStatus' + protocol: + $ref: '#/components/schemas/EventProtocols' + ip: + type: string + session_id: + type: string + fs_provider: + $ref: '#/components/schemas/FsProviders' + bucket: + type: string + endpoint: + type: string + open_flags: + type: string + role: + type: string + instance_id: + type: string + ProviderEvent: + type: object + properties: + id: + type: string + timestamp: + type: integer + format: int64 + description: 'unix timestamp in nanoseconds' + action: + $ref: '#/components/schemas/ProviderEventAction' + username: + type: string + ip: + type: string + object_type: + $ref: '#/components/schemas/ProviderEventObjectType' + object_name: + type: string + object_data: + type: string + format: byte + description: 'base64 of the JSON serialized object with sensitive fields removed' + role: + type: string + instance_id: + type: string + LogEvent: + type: object + properties: + id: + type: string + timestamp: + type: integer + format: int64 + description: 'unix timestamp in nanoseconds' + event: + $ref: '#/components/schemas/LogEventType' + protocol: + $ref: '#/components/schemas/EventProtocols' + username: + type: string + ip: + type: string + message: + type: string + role: + type: string + instance_id: + type: string + KeyValue: + type: object + properties: + key: + type: string + value: + type: string + HTTPPart: + type: object + properties: + name: + type: string + headers: + type: array + items: + $ref: '#/components/schemas/KeyValue' + description: 'Additional headers. Content-Disposition header is automatically set. Content-Type header is automatically detect for files to attach' + filepath: + type: string + description: 'path to the file to be sent as an attachment' + body: + type: string + EventActionHTTPConfig: + type: object + properties: + endpoint: + type: string + description: HTTP endpoint + example: https://example.com + username: + type: string + password: + $ref: '#/components/schemas/Secret' + headers: + type: array + items: + $ref: '#/components/schemas/KeyValue' + description: headers to add + timeout: + type: integer + minimum: 1 + maximum: 180 + description: 'Ignored for multipart requests with files as attachments' + skip_tls_verify: + type: boolean + description: 'if enabled the HTTP client accepts any TLS certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. This should be used only for testing.' + method: + type: string + enum: + - GET + - POST + - PUT + - DELETE + query_parameters: + type: array + items: + $ref: '#/components/schemas/KeyValue' + body: + type: string + description: HTTP POST/PUT body + parts: + type: array + items: + $ref: '#/components/schemas/HTTPPart' + description: 'Multipart requests allow to combine one or more sets of data into a single body. For each part, you can set a file path or a body as text. Placeholders are supported in file path, body, header values.' + EventActionCommandConfig: + type: object + properties: + cmd: + type: string + description: absolute path to the command to execute + args: + type: array + items: + type: string + description: 'command line arguments' + timeout: + type: integer + minimum: 1 + maximum: 120 + env_vars: + type: array + items: + $ref: '#/components/schemas/KeyValue' + EventActionEmailConfig: + type: object + properties: + recipients: + type: array + items: + type: string + bcc: + type: array + items: + type: string + subject: + type: string + body: + type: string + content_type: + type: integer + enum: + - 0 + - 1 + description: | + Content type: + * `0` text/plain + * `1` text/html + attachments: + type: array + items: + type: string + description: 'list of file paths to attach. The total size is limited to 10 MB' + EventActionDataRetentionConfig: + type: object + properties: + folders: + type: array + items: + $ref: '#/components/schemas/FolderRetention' + EventActionFsCompress: + type: object + properties: + name: + type: string + description: 'Full path to the (zip) archive to create. The parent dir must exist' + paths: + type: array + items: + type: string + description: 'paths to add the archive' + EventActionFilesystemConfig: + type: object + properties: + type: + $ref: '#/components/schemas/FilesystemActionTypes' + renames: + type: array + items: + $ref: '#/components/schemas/KeyValue' + mkdirs: + type: array + items: + type: string + deletes: + type: array + items: + type: string + exist: + type: array + items: + type: string + copy: + type: array + items: + $ref: '#/components/schemas/KeyValue' + compress: + $ref: '#/components/schemas/EventActionFsCompress' + EventActionPasswordExpiration: + type: object + properties: + threshold: + type: integer + description: 'An email notification will be generated for users whose password expires in a number of days less than or equal to this threshold' + EventActionUserInactivity: + type: object + properties: + disable_threshold: + type: integer + description: 'Inactivity threshold, in days, before disabling the account' + delete_threshold: + type: integer + description: 'Inactivity threshold, in days, before deleting the account' + EventActionIDPAccountCheck: + type: object + properties: + mode: + type: integer + enum: + - 0 + - 1 + description: | + Account check mode: + * `0` Create or update the account + * `1` Create the account if it doesn't exist + template_user: + type: string + description: 'SFTPGo user template in JSON format' + template_admin: + type: string + description: 'SFTPGo admin template in JSON format' + BaseEventActionOptions: + type: object + properties: + http_config: + $ref: '#/components/schemas/EventActionHTTPConfig' + cmd_config: + $ref: '#/components/schemas/EventActionCommandConfig' + email_config: + $ref: '#/components/schemas/EventActionEmailConfig' + retention_config: + $ref: '#/components/schemas/EventActionDataRetentionConfig' + fs_config: + $ref: '#/components/schemas/EventActionFilesystemConfig' + pwd_expiration_config: + $ref: '#/components/schemas/EventActionPasswordExpiration' + user_inactivity_config: + $ref: '#/components/schemas/EventActionUserInactivity' + idp_config: + $ref: '#/components/schemas/EventActionIDPAccountCheck' + BaseEventAction: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + name: + type: string + description: unique name + description: + type: string + description: optional description + type: + $ref: '#/components/schemas/EventActionTypes' + options: + $ref: '#/components/schemas/BaseEventActionOptions' + rules: + type: array + items: + type: string + description: list of event rules names associated with this action + EventActionOptions: + type: object + properties: + is_failure_action: + type: boolean + stop_on_failure: + type: boolean + execute_sync: + type: boolean + EventAction: + allOf: + - $ref: '#/components/schemas/BaseEventAction' + - type: object + properties: + order: + type: integer + description: execution order + relation_options: + $ref: '#/components/schemas/EventActionOptions' + EventActionMinimal: + type: object + properties: + name: + type: string + order: + type: integer + description: execution order + relation_options: + $ref: '#/components/schemas/EventActionOptions' + ConditionPattern: + type: object + properties: + pattern: + type: string + inverse_match: + type: boolean + ConditionOptions: + type: object + properties: + names: + type: array + items: + $ref: '#/components/schemas/ConditionPattern' + group_names: + type: array + items: + $ref: '#/components/schemas/ConditionPattern' + role_names: + type: array + items: + $ref: '#/components/schemas/ConditionPattern' + fs_paths: + type: array + items: + $ref: '#/components/schemas/ConditionPattern' + protocols: + type: array + items: + type: string + enum: + - SFTP + - SCP + - SSH + - FTP + - DAV + - HTTP + - HTTPShare + - OIDC + provider_objects: + type: array + items: + type: string + enum: + - user + - group + - admin + - api_key + - share + - event_action + - event_rule + min_size: + type: integer + format: int64 + max_size: + type: integer + format: int64 + concurrent_execution: + type: boolean + description: allow concurrent execution from multiple nodes + Schedule: + type: object + properties: + hour: + type: string + day_of_week: + type: string + day_of_month: + type: string + month: + type: string + EventConditions: + type: object + properties: + fs_events: + type: array + items: + type: string + enum: + - upload + - download + - delete + - rename + - mkdir + - rmdir + - copy + - ssh_cmd + - pre-upload + - pre-download + - pre-delete + - first-upload + - first-download + provider_events: + type: array + items: + type: string + enum: + - add + - update + - delete + schedules: + type: array + items: + $ref: '#/components/schemas/Schedule' + idp_login_event: + type: integer + enum: + - 0 + - 1 + - 2 + description: | + IDP login events: + - `0` any login event + - `1` user login event + - `2` admin login event + options: + $ref: '#/components/schemas/ConditionOptions' + BaseEventRule: + type: object + properties: + id: + type: integer + format: int32 + minimum: 1 + name: + type: string + description: unique name + status: + type: integer + enum: + - 0 + - 1 + description: | + status: + * `0` disabled + * `1` enabled + description: + type: string + description: optional description + created_at: + type: integer + format: int64 + description: creation time as unix timestamp in milliseconds + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in millisecond + trigger: + $ref: '#/components/schemas/EventTriggerTypes' + conditions: + $ref: '#/components/schemas/EventConditions' + EventRule: + allOf: + - $ref: '#/components/schemas/BaseEventRule' + - type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/EventAction' + EventRuleMinimal: + allOf: + - $ref: '#/components/schemas/BaseEventRule' + - type: object + properties: + actions: + type: array + items: + $ref: '#/components/schemas/EventActionMinimal' + IPListEntry: + type: object + properties: + ipornet: + type: string + description: IP address or network in CIDR format, for example `192.168.1.2/32`, `192.168.0.0/24`, `2001:db8::/32` + description: + type: string + description: optional description + type: + $ref: '#/components/schemas/IPListType' + mode: + $ref: '#/components/schemas/IPListMode' + protocols: + type: integer + description: Defines the protocol the entry applies to. `0` means all the supported protocols, 1 SSH, 2 FTP, 4 WebDAV, 8 HTTP. Protocols can be combined, for example 3 means SSH and FTP + created_at: + type: integer + format: int64 + description: creation time as unix timestamp in milliseconds + updated_at: + type: integer + format: int64 + description: last update time as unix timestamp in millisecond + ApiResponse: + type: object + properties: + message: + type: string + description: 'message, can be empty' + error: + type: string + description: error description if any + VersionInfo: + type: object + properties: + version: + type: string + build_date: + type: string + commit_hash: + type: string + features: + type: array + items: + type: string + description: 'Features for the current build. Available features are `portable`, `bolt`, `mysql`, `sqlite`, `pgsql`, `s3`, `gcs`, `azblob`, `metrics`, `unixcrypt`. If a feature is available it has a `+` prefix, otherwise a `-` prefix' + Token: + type: object + properties: + access_token: + type: string + expires_at: + type: string + format: date-time + securitySchemes: + BasicAuth: + type: http + scheme: basic + BearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + APIKeyAuth: + type: apiKey + in: header + name: X-SFTPGO-API-KEY + description: 'API key to use for authentication. API key authentication is intrinsically less secure than using a short lived JWT token. You should prefer API key authentication only for machine-to-machine communications in trusted environments. If no admin/user is associated to the provided key you need to add ".username" at the end of the key. For example if your API key is "6ajKLwswLccVBGpZGv596G.ySAXc8vtp9hMiwAuaLtzof" and you want to impersonate the admin with username "myadmin" you have to use "6ajKLwswLccVBGpZGv596G.ySAXc8vtp9hMiwAuaLtzof.myadmin" as API key. When using API key authentication you cannot manage API keys, update the impersonated admin, change password or public keys for the impersonated user.' \ No newline at end of file diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/application.yaml b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/application.yaml new file mode 100644 index 00000000..c6d75e03 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/application.yaml @@ -0,0 +1,133 @@ +# +# Copyright © 2024, Kanton Bern +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +#custom props +hello-data: + # code: 'type | key | name' + business-context: 'Business Domain | HelloDATA_Product_Development | HelloDATA Product Development' + instance: + name: "SFTPGo File Browser" + url: filebrowser.local + sftpgo: + base-url: http://localhost:8090 + admin-username: admin + admin-password: admin + s3-connections: + - context-key: Default_Data_Domain + endpoint: http://minio:9000 + bucket: default-data-domain #lower case context key, dashes only + region: eu-central-2 + access-key: minioadmin + access-secret: minioadmin + force-path-style: true + - context-key: Extra_Data_Domain + endpoint: http://minio:9000 + bucket: extra-data-domain #lower case context key, dashes only + region: eu-central-2 + access-key: minioadmin + access-secret: minioadmin + force-path-style: true + admin-virtual-folder: /storage + sidecar: + pubish-interval-minutes: 10 + +spring: + application: + name: HelloDATA Sidecar for SFTPGo + cloud: + kubernetes: + discovery: + enabled: false + boot: + admin: + client: + url: http://localhost:9090 + username: "user" #These two are needed so that the client + password: "password" #can register at the protected server api + instance: + metadata: + user.name: "user" #These two are needed so that the server + user.password: "password" #can access the protected client endpoints + +nats: + spring: + server: nats://0.0.0.0:4222 + +#swagger props +springdoc: + show-actuator: true + packagesToScan: ch.bedag.dap.hellodata.sidecars + paths-to-match: /** + swagger-ui: + oauth: + clientId: ${hello-data.auth-server.client-id} + + +management: + endpoint: + health: + access: read_only + # show-details: always #if we need some details + info: + access: read_only + endpoints: + web: + exposure: + include: info, health + health: + nats: + enabled: false + mail: + enabled: false + kubernetes: + enabled: false + ldap: + enabled: false # Disable this when not using ldap connection + info: + env: + enabled: true + java: + enabled: true + os: + enabled: true + kubernetes: + enabled: false + metrics: + distribution: + percentiles-histogram: + spring.data.repository.invocations: true + http.server.requests: true + server: + port: 8082 + +#server props +server: + port: 8093 + +logging: + level: + reactor.netty.http.client.HttpClient: INFO # change that to DEBUG to see request/response body, headers and status \ No newline at end of file diff --git a/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/banner.txt b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/banner.txt new file mode 100644 index 00000000..76ff3230 --- /dev/null +++ b/hello-data-sidecars/hello-data-sidecar-sftpgo/src/main/resources/banner.txt @@ -0,0 +1,12 @@ + + + _ _ _ _ _____ _______ ____ ______ + | | | | | | | | __ \ /\|__ __|/\ | _ \| ____| + | |__| | ___| | | ___ | | | | / \ | | / \ ______| |_) | |__ + | __ |/ _ \ | |/ _ \| | | |/ /\ \ | | / /\ \______| _ <| __| + | | | | __/ | | (_) | |__| / ____ \| |/ ____ \ | |_) | |____ + |_| |_|\___|_|_|\___/|_____/_/ \_\_/_/ \_\ |____/|______| + +${application.title} ${application.version} +${AnsiColor.BRIGHT_BLUE}:: HelloDATA-BE :: Startup profile(s) ${spring.profiles.active} :: +:: https://github.com/kanton-bern/hellodata-be ::${AnsiColor.DEFAULT} diff --git a/hello-data-sidecars/pom.xml b/hello-data-sidecars/pom.xml index 62d003eb..2818365d 100644 --- a/hello-data-sidecars/pom.xml +++ b/hello-data-sidecars/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 @@ -20,6 +21,7 @@ hello-data-sidecar-dbt-docs hello-data-sidecar-cloudbeaver hello-data-sidecar-jupyterhub + hello-data-sidecar-sftpgo