[PS][Experimental] add withHttpInfo support, fix "null" return (#5811)

* add with http support

* use full name in tests

* using full name in test

* skip type check
This commit is contained in:
William Cheng
2020-04-03 15:47:04 +08:00
committed by GitHub
parent bc12ada4c0
commit 281d154ff4
8 changed files with 284 additions and 68 deletions

View File

@@ -15,6 +15,10 @@
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
{{/allParams}}
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}None{{/returnType}}
@@ -26,9 +30,11 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
[Parameter(Position = {{vendorExtensions.x-index}}{{#-first}}, ValueFromPipeline = $true{{/-first}}, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[{{{vendorExtensions.x-powershell-data-type}}}]
{{=<% %>=}}
${<%paramName%>}<%^-last%>,<%/-last%>
${<%paramName%>},
<%={{ }}=%>
{{/allParams}}
[Switch]
$WithHttpInfo
)
Process {
@@ -42,7 +48,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-{{{apiNamePrefix}}}Configuration
{{#hasProduces}}
@@ -194,7 +200,11 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "{{#returnType}}{{{.}}}{{/returnType}}"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}

View File

@@ -110,7 +110,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient {
return @{
Response = DeserializeResponse -Response $Response -ReturnType $ReturnType
StatusCode = $Response.StatusCode
Headers = $Response.ResponseHeaders
Headers = $Response.Headers
}
}

View File

@@ -17,6 +17,10 @@ No description available.
.PARAMETER Pet
Pet object that needs to be added to the store
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Pet
@@ -26,7 +30,9 @@ function Add-PSPet {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject]
${Pet}
${Pet},
[Switch]
$WithHttpInfo
)
Process {
@@ -40,7 +46,7 @@ function Add-PSPet {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -69,7 +75,11 @@ function Add-PSPet {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Pet"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -88,6 +98,10 @@ Pet id to delete
.PARAMETER ApiKey
No description available.
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -100,7 +114,9 @@ function Remove-Pet {
${PetId},
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String]
${ApiKey}
${ApiKey},
[Switch]
$WithHttpInfo
)
Process {
@@ -114,7 +130,7 @@ function Remove-Pet {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
$LocalVarUri = '/pet/{petId}'
@@ -139,7 +155,11 @@ function Remove-Pet {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -155,6 +175,10 @@ No description available.
.PARAMETER Status
Status values that need to be considered for filter
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Pet[]
@@ -164,7 +188,9 @@ function Find-PSPetsByStatus {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String[]]
${Status}
${Status},
[Switch]
$WithHttpInfo
)
Process {
@@ -178,7 +204,7 @@ function Find-PSPetsByStatus {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -203,7 +229,11 @@ function Find-PSPetsByStatus {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Pet[]"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -219,6 +249,10 @@ No description available.
.PARAMETER Tags
Tags to filter by
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Pet[]
@@ -228,7 +262,9 @@ function Find-PSPetsByTags {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String[]]
${Tags}
${Tags},
[Switch]
$WithHttpInfo
)
Process {
@@ -242,7 +278,7 @@ function Find-PSPetsByTags {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -267,7 +303,11 @@ function Find-PSPetsByTags {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Pet[]"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -283,6 +323,10 @@ No description available.
.PARAMETER PetId
ID of pet to return
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Pet
@@ -292,7 +336,9 @@ function Get-PSPetById {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[Int64]
${PetId}
${PetId},
[Switch]
$WithHttpInfo
)
Process {
@@ -306,7 +352,7 @@ function Get-PSPetById {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -334,7 +380,11 @@ function Get-PSPetById {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Pet"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -350,6 +400,10 @@ No description available.
.PARAMETER Pet
Pet object that needs to be added to the store
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Pet
@@ -359,7 +413,9 @@ function Update-PSPet {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject]
${Pet}
${Pet},
[Switch]
$WithHttpInfo
)
Process {
@@ -373,7 +429,7 @@ function Update-PSPet {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -402,7 +458,11 @@ function Update-PSPet {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Pet"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -424,6 +484,10 @@ Updated name of the pet
.PARAMETER Status
Updated status of the pet
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -439,7 +503,9 @@ function Update-PSPetWithForm {
${Name},
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String]
${Status}
${Status},
[Switch]
$WithHttpInfo
)
Process {
@@ -453,7 +519,7 @@ function Update-PSPetWithForm {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Content-Type'
@@ -485,7 +551,11 @@ function Update-PSPetWithForm {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -507,6 +577,10 @@ Additional data to pass to server
.PARAMETER File
file to upload
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
ApiResponse
@@ -522,7 +596,9 @@ function Invoke-PSUploadFile {
${AdditionalMetadata},
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[System.IO.FileInfo]
${File}
${File},
[Switch]
$WithHttpInfo
)
Process {
@@ -536,7 +612,7 @@ function Invoke-PSUploadFile {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -571,7 +647,11 @@ function Invoke-PSUploadFile {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "ApiResponse"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}

View File

@@ -17,6 +17,10 @@ No description available.
.PARAMETER OrderId
ID of the order that needs to be deleted
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -26,7 +30,9 @@ function Remove-PSOrder {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String]
${OrderId}
${OrderId},
[Switch]
$WithHttpInfo
)
Process {
@@ -40,7 +46,7 @@ function Remove-PSOrder {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
$LocalVarUri = '/store/order/{orderId}'
@@ -60,7 +66,11 @@ function Remove-PSOrder {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -73,6 +83,10 @@ Returns pet inventories by status
No description available.
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
System.Collections.Hashtable
@@ -80,6 +94,8 @@ System.Collections.Hashtable
function Get-PSInventory {
[CmdletBinding()]
Param (
[Switch]
$WithHttpInfo
)
Process {
@@ -93,7 +109,7 @@ function Get-PSInventory {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -117,7 +133,11 @@ function Get-PSInventory {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "System.Collections.Hashtable"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -133,6 +153,10 @@ No description available.
.PARAMETER OrderId
ID of pet that needs to be fetched
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Order
@@ -142,7 +166,9 @@ function Get-PSOrderById {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[Int64]
${OrderId}
${OrderId},
[Switch]
$WithHttpInfo
)
Process {
@@ -156,7 +182,7 @@ function Get-PSOrderById {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -179,7 +205,11 @@ function Get-PSOrderById {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Order"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -195,6 +225,10 @@ No description available.
.PARAMETER Order
order placed for purchasing the pet
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
Order
@@ -204,7 +238,9 @@ function Invoke-PSPlaceOrder {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject]
${Order}
${Order},
[Switch]
$WithHttpInfo
)
Process {
@@ -218,7 +254,7 @@ function Invoke-PSPlaceOrder {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -246,7 +282,11 @@ function Invoke-PSPlaceOrder {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "Order"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}

View File

@@ -17,6 +17,10 @@ No description available.
.PARAMETER User
Created user object
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -26,7 +30,9 @@ function New-PSUser {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject]
${User}
${User},
[Switch]
$WithHttpInfo
)
Process {
@@ -40,7 +46,7 @@ function New-PSUser {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Content-Type'
@@ -70,7 +76,11 @@ function New-PSUser {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -86,6 +96,10 @@ No description available.
.PARAMETER User
List of user object
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -95,7 +109,9 @@ function New-PSUsersWithArrayInput {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject[]]
${User}
${User},
[Switch]
$WithHttpInfo
)
Process {
@@ -109,7 +125,7 @@ function New-PSUsersWithArrayInput {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Content-Type'
@@ -139,7 +155,11 @@ function New-PSUsersWithArrayInput {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -155,6 +175,10 @@ No description available.
.PARAMETER User
List of user object
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -164,7 +188,9 @@ function New-PSUsersWithListInput {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject[]]
${User}
${User},
[Switch]
$WithHttpInfo
)
Process {
@@ -178,7 +204,7 @@ function New-PSUsersWithListInput {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Content-Type'
@@ -208,7 +234,11 @@ function New-PSUsersWithListInput {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -224,6 +254,10 @@ No description available.
.PARAMETER Username
The name that needs to be deleted
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -233,7 +267,9 @@ function Remove-PSUser {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String]
${Username}
${Username},
[Switch]
$WithHttpInfo
)
Process {
@@ -247,7 +283,7 @@ function Remove-PSUser {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
$LocalVarUri = '/user/{username}'
@@ -272,7 +308,11 @@ function Remove-PSUser {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -288,6 +328,10 @@ No description available.
.PARAMETER Username
The name that needs to be fetched. Use user1 for testing.
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
User
@@ -297,7 +341,9 @@ function Get-PSUserByName {
Param (
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String]
${Username}
${Username},
[Switch]
$WithHttpInfo
)
Process {
@@ -311,7 +357,7 @@ function Get-PSUserByName {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -334,7 +380,11 @@ function Get-PSUserByName {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "User"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -353,6 +403,10 @@ The user name for login
.PARAMETER Password
The password for login in clear text
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
String
@@ -365,7 +419,9 @@ function Invoke-PSLoginUser {
${Username},
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[String]
${Password}
${Password},
[Switch]
$WithHttpInfo
)
Process {
@@ -379,7 +435,7 @@ function Invoke-PSLoginUser {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Accept' (if needed)
@@ -408,7 +464,11 @@ function Invoke-PSLoginUser {
-CookieParameters $LocalVarCookieParameters `
-ReturnType "String"
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -421,6 +481,10 @@ Logs out current logged in user session
No description available.
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -428,6 +492,8 @@ None
function Invoke-PSLogoutUser {
[CmdletBinding()]
Param (
[Switch]
$WithHttpInfo
)
Process {
@@ -441,7 +507,7 @@ function Invoke-PSLogoutUser {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
$LocalVarUri = '/user/logout'
@@ -462,7 +528,11 @@ function Invoke-PSLogoutUser {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}
@@ -481,6 +551,10 @@ name that need to be deleted
.PARAMETER User
Updated user object
.PARAMETER WithHttpInfo
A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response
.OUTPUTS
None
@@ -493,7 +567,9 @@ function Update-PSUser {
${Username},
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)]
[PSCustomObject]
${User}
${User},
[Switch]
$WithHttpInfo
)
Process {
@@ -507,7 +583,7 @@ function Update-PSUser {
$LocalVarFormParameters = @{}
$LocalVarPathParameters = @{}
$LocalVarCookieParameters = @{}
$LocalVarBodyParameter
$LocalVarBodyParameter = $null
$Configuration = Get-PSConfiguration
# HTTP header 'Content-Type'
@@ -541,7 +617,11 @@ function Update-PSUser {
-CookieParameters $LocalVarCookieParameters `
-ReturnType ""
return $LocalVarResult["Response"]
if ($WithHttpInfo.IsPresent) {
return $LocalVarResult
} else {
return $LocalVarResult["Response"]
}
}
}

View File

@@ -3,7 +3,7 @@
#
# Generated by: OpenAPI Generator Team
#
# Generated on: 4/2/20
# Generated on: 4/3/20
#
@{

View File

@@ -116,7 +116,7 @@ function Invoke-PSApiClient {
return @{
Response = DeserializeResponse -Response $Response -ReturnType $ReturnType
StatusCode = $Response.StatusCode
Headers = $Response.ResponseHeaders
Headers = $Response.Headers
}
}

View File

@@ -27,6 +27,8 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' {
$Result."name" | Should Be "PowerShell"
$Result."status" | Should Be "Available"
$Result.GetType().fullname | Should Be "System.Management.Automation.PSCustomObject"
# Update (form)
$Result = Update-PSPetWithForm -petId $Id -Name "PowerShell Update" -Status "Pending"
@@ -46,10 +48,14 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' {
) -Status Sold
$Result = Update-PSPet -Pet $NewPet
$Result = Get-PSPetById -petId $Id
$Result."id" | Should Be 38369
$Result."name" | Should Be "PowerShell2"
$Result."status" | Should Be "Sold"
$Result = Get-PSPetById -petId $Id -WithHttpInfo
$Result.GetType().fullname | Should Be "System.Collections.Hashtable"
#$Result["Response"].GetType().fullanme | Should Be "System.Management.Automation.PSCustomObject"
$Result["Response"]."id" | Should Be 38369
$Result["Response"]."name" | Should Be "PowerShell2"
$Result["Response"]."status" | Should Be "Sold"
$Result["StatusCode"] | Should Be 200
$Result["Headers"]["Content-Type"] | Should Be "application/json"
# upload file
$file = Get-Item "./plus.gif"