Merge remote-tracking branch 'origin/5.4.x' into 6.0.x

This commit is contained in:
WILLIAM CHENG
2021-11-01 00:54:44 +08:00
288 changed files with 4107 additions and 2113 deletions

View File

@@ -3,7 +3,7 @@
#
# Generated by: OpenAPI Generator Team
#
# Generated on: 30-11-2020
# Generated on: 10/30/2021
#
@{
@@ -45,7 +45,7 @@ PowerShellVersion = '5.0'
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# ClrVersion = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
@@ -128,6 +128,15 @@ PrivateData = @{
# ReleaseNotes of this module
ReleaseNotes = 'This is a sample project'
# Prerelease string of this module
# Prerelease = ''
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false
# External dependent modules of this module
# ExternalModuleDependencies = @()
} # End of PSData hashtable
} # End of PrivateData hashtable

View File

@@ -62,9 +62,15 @@ function Invoke-PSApiClient {
$HeaderParameters['Accept'] = $Accept
}
[string]$MultiPartBoundary = $null
$ContentType= SelectHeaders -Headers $ContentTypes
if ($ContentType) {
$HeaderParameters['Content-Type'] = $ContentType
if ($ContentType -eq 'multipart/form-data') {
[string]$MultiPartBoundary = [System.Guid]::NewGuid()
$MultiPartBoundary = "---------------------------$MultiPartBoundary"
$HeaderParameters['Content-Type'] = "$ContentType; boundary=$MultiPartBoundary"
}
}
# add default headers if any
@@ -72,7 +78,6 @@ function Invoke-PSApiClient {
$HeaderParameters[$header.Name] = $header.Value
}
# construct URL query string
$HttpValues = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
foreach ($Parameter in $QueryParameters.GetEnumerator()) {
@@ -90,9 +95,34 @@ function Invoke-PSApiClient {
# include form parameters in the request body
if ($FormParameters -and $FormParameters.Count -gt 0) {
$RequestBody = $FormParameters
if (![string]::IsNullOrEmpty($MultiPartBoundary)) {
$RequestBody = ""
$LF = "`r`n"
$FormParameters.Keys | ForEach-Object {
$value = $FormParameters[$_]
$isFile = $value.GetType().FullName -eq "System.IO.FileInfo"
$RequestBody += "--$MultiPartBoundary$LF"
$RequestBody += "Content-Disposition: form-data; name=`"$_`""
if ($isFile) {
$fileName = $value.Name
$RequestBody += "; filename=`"$fileName`"$LF"
$RequestBody += "Content-Type: application/octet-stream$LF$LF"
$RequestBody += Get-Content -Path $value.FullName
} else {
$RequestBody += "$LF$LF"
$RequestBody += ([string]$value)
}
$RequestBody += "$LF--$MultiPartBoundary"
}
$RequestBody += "--"
} else {
$RequestBody = $FormParameters
}
}
if ($Body -or $IsBodyNullable) {
$RequestBody = $Body
if ([string]::IsNullOrEmpty($RequestBody) -and $IsBodyNullable -eq $true) {