Model/HTTPSConfig.ps1
# # SMServer V6 # Syncplify Server! REST API # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER Certificates reference to a valid TLSCertificate. This field is required when adding a new config .PARAMETER MinTlsVersion No description available. .PARAMETER MaxTlsVersion No description available. .PARAMETER AllowedCipherSuites This field is required when adding a new config .PARAMETER JwtLifeSpan JWT lifespan as minutes. This field is required when adding a new config and must be > 0 .PARAMETER JwtSecretWc No description available. .PARAMETER JwtSecretShare No description available. .PARAMETER JwtAutoRefresh No description available. .PARAMETER JwtAutoRefreshMaxTimes No description available. .PARAMETER TrustedProxies optional IPv4/6 addresses of trusted proxies .PARAMETER SecurityConf No description available. .PARAMETER CorsConf No description available. .PARAMETER WebClientRateLimit req/sec. 0 means unlimited. If omitted 0 is assumed .PARAMETER MaxUploadSize If this is 0 or invalid, a default value of ""1 GB"" will be used by the worker process. Use the SI notation, for example ""2 MiB"" or ""4 GB"" .PARAMETER MaxZipFiles Maximum number of files to be downloaded as a single zip archive .PARAMETER MaxZipDataSize Maximum data (in SI units) to be downloaded as a single zip archive (ex: 10 MB, 1 GB, ...) - empty=no-limit .PARAMETER WebClientUiLogo Logo to be displayed in the WebClient UI .PARAMETER WebClientUiLogoType MIME-Type of the logo to be displayed in the WebClient UI .PARAMETER WebClientUiDisclaimer Legal disclaimer (free text) to be displayed on the WebClient UI's login page .OUTPUTS HTTPSConfig<PSCustomObject> #> function Initialize-SS6HTTPSConfig { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [String[]] ${Certificates}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${MinTlsVersion}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${MaxTlsVersion}, [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${AllowedCipherSuites}, [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${JwtLifeSpan}, [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${JwtSecretWc}, [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${JwtSecretShare}, [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${JwtAutoRefresh}, [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${JwtAutoRefreshMaxTimes}, [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true)] [String[]] ${TrustedProxies}, [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SecurityConf}, [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${CorsConf}, [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${WebClientRateLimit}, [Parameter(Position = 13, ValueFromPipelineByPropertyName = $true)] [String] ${MaxUploadSize}, [Parameter(Position = 14, ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int32]] ${MaxZipFiles}, [Parameter(Position = 15, ValueFromPipelineByPropertyName = $true)] [String] ${MaxZipDataSize}, [Parameter(Position = 16, ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${WebClientUiLogo}, [Parameter(Position = 17, ValueFromPipelineByPropertyName = $true)] [String] ${WebClientUiLogoType}, [Parameter(Position = 18, ValueFromPipelineByPropertyName = $true)] [String] ${WebClientUiDisclaimer} ) Process { 'Creating PSCustomObject: SS6AdminModule => SS6HTTPSConfig' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "certificates" = ${Certificates} "minTlsVersion" = ${MinTlsVersion} "maxTlsVersion" = ${MaxTlsVersion} "allowedCipherSuites" = ${AllowedCipherSuites} "jwtLifeSpan" = ${JwtLifeSpan} "jwtSecretWc" = ${JwtSecretWc} "jwtSecretShare" = ${JwtSecretShare} "jwtAutoRefresh" = ${JwtAutoRefresh} "jwtAutoRefreshMaxTimes" = ${JwtAutoRefreshMaxTimes} "trustedProxies" = ${TrustedProxies} "securityConf" = ${SecurityConf} "corsConf" = ${CorsConf} "webClientRateLimit" = ${WebClientRateLimit} "maxUploadSize" = ${MaxUploadSize} "maxZipFiles" = ${MaxZipFiles} "maxZipDataSize" = ${MaxZipDataSize} "webClientUiLogo" = ${WebClientUiLogo} "webClientUiLogoType" = ${WebClientUiLogoType} "webClientUiDisclaimer" = ${WebClientUiDisclaimer} } return $PSO } } <# .SYNOPSIS Convert from JSON to HTTPSConfig<PSCustomObject> .DESCRIPTION Convert from JSON to HTTPSConfig<PSCustomObject> .PARAMETER Json Json object .OUTPUTS HTTPSConfig<PSCustomObject> #> function ConvertFrom-SS6JsonToHTTPSConfig { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: SS6AdminModule => SS6HTTPSConfig' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in SS6HTTPSConfig $AllProperties = ("certificates", "minTlsVersion", "maxTlsVersion", "allowedCipherSuites", "jwtLifeSpan", "jwtSecretWc", "jwtSecretShare", "jwtAutoRefresh", "jwtAutoRefreshMaxTimes", "trustedProxies", "securityConf", "corsConf", "webClientRateLimit", "maxUploadSize", "maxZipFiles", "maxZipDataSize", "webClientUiLogo", "webClientUiLogoType", "webClientUiDisclaimer") foreach ($name in $JsonParameters.PsObject.Properties.Name) { if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } } if (!([bool]($JsonParameters.PSobject.Properties.name -match "certificates"))) { #optional property not found $Certificates = $null } else { $Certificates = $JsonParameters.PSobject.Properties["certificates"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "minTlsVersion"))) { #optional property not found $MinTlsVersion = $null } else { $MinTlsVersion = $JsonParameters.PSobject.Properties["minTlsVersion"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxTlsVersion"))) { #optional property not found $MaxTlsVersion = $null } else { $MaxTlsVersion = $JsonParameters.PSobject.Properties["maxTlsVersion"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "allowedCipherSuites"))) { #optional property not found $AllowedCipherSuites = $null } else { $AllowedCipherSuites = $JsonParameters.PSobject.Properties["allowedCipherSuites"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "jwtLifeSpan"))) { #optional property not found $JwtLifeSpan = $null } else { $JwtLifeSpan = $JsonParameters.PSobject.Properties["jwtLifeSpan"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "jwtSecretWc"))) { #optional property not found $JwtSecretWc = $null } else { $JwtSecretWc = $JsonParameters.PSobject.Properties["jwtSecretWc"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "jwtSecretShare"))) { #optional property not found $JwtSecretShare = $null } else { $JwtSecretShare = $JsonParameters.PSobject.Properties["jwtSecretShare"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "jwtAutoRefresh"))) { #optional property not found $JwtAutoRefresh = $null } else { $JwtAutoRefresh = $JsonParameters.PSobject.Properties["jwtAutoRefresh"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "jwtAutoRefreshMaxTimes"))) { #optional property not found $JwtAutoRefreshMaxTimes = $null } else { $JwtAutoRefreshMaxTimes = $JsonParameters.PSobject.Properties["jwtAutoRefreshMaxTimes"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "trustedProxies"))) { #optional property not found $TrustedProxies = $null } else { $TrustedProxies = $JsonParameters.PSobject.Properties["trustedProxies"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "securityConf"))) { #optional property not found $SecurityConf = $null } else { $SecurityConf = $JsonParameters.PSobject.Properties["securityConf"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "corsConf"))) { #optional property not found $CorsConf = $null } else { $CorsConf = $JsonParameters.PSobject.Properties["corsConf"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "webClientRateLimit"))) { #optional property not found $WebClientRateLimit = $null } else { $WebClientRateLimit = $JsonParameters.PSobject.Properties["webClientRateLimit"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxUploadSize"))) { #optional property not found $MaxUploadSize = $null } else { $MaxUploadSize = $JsonParameters.PSobject.Properties["maxUploadSize"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxZipFiles"))) { #optional property not found $MaxZipFiles = $null } else { $MaxZipFiles = $JsonParameters.PSobject.Properties["maxZipFiles"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "maxZipDataSize"))) { #optional property not found $MaxZipDataSize = $null } else { $MaxZipDataSize = $JsonParameters.PSobject.Properties["maxZipDataSize"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "webClientUiLogo"))) { #optional property not found $WebClientUiLogo = $null } else { $WebClientUiLogo = $JsonParameters.PSobject.Properties["webClientUiLogo"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "webClientUiLogoType"))) { #optional property not found $WebClientUiLogoType = $null } else { $WebClientUiLogoType = $JsonParameters.PSobject.Properties["webClientUiLogoType"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "webClientUiDisclaimer"))) { #optional property not found $WebClientUiDisclaimer = $null } else { $WebClientUiDisclaimer = $JsonParameters.PSobject.Properties["webClientUiDisclaimer"].value } $PSO = [PSCustomObject]@{ "certificates" = ${Certificates} "minTlsVersion" = ${MinTlsVersion} "maxTlsVersion" = ${MaxTlsVersion} "allowedCipherSuites" = ${AllowedCipherSuites} "jwtLifeSpan" = ${JwtLifeSpan} "jwtSecretWc" = ${JwtSecretWc} "jwtSecretShare" = ${JwtSecretShare} "jwtAutoRefresh" = ${JwtAutoRefresh} "jwtAutoRefreshMaxTimes" = ${JwtAutoRefreshMaxTimes} "trustedProxies" = ${TrustedProxies} "securityConf" = ${SecurityConf} "corsConf" = ${CorsConf} "webClientRateLimit" = ${WebClientRateLimit} "maxUploadSize" = ${MaxUploadSize} "maxZipFiles" = ${MaxZipFiles} "maxZipDataSize" = ${MaxZipDataSize} "webClientUiLogo" = ${WebClientUiLogo} "webClientUiLogoType" = ${WebClientUiLogoType} "webClientUiDisclaimer" = ${WebClientUiDisclaimer} } return $PSO } } |