mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
use write verbose in auth, better api doc (#5804)
This commit is contained in:
parent
7d35268414
commit
bc12ada4c0
@ -253,9 +253,6 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// additional common verbs mapping
|
|
||||||
commonVerbs.put("Delete", "Remove");
|
|
||||||
|
|
||||||
powershellVerbs = new HashSet<String>(Arrays.asList(
|
powershellVerbs = new HashSet<String>(Arrays.asList(
|
||||||
"Add",
|
"Add",
|
||||||
"Clear",
|
"Clear",
|
||||||
@ -1014,7 +1011,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
|||||||
for (Map.Entry<String, String> entry : commonVerbs.entrySet()) {
|
for (Map.Entry<String, String> entry : commonVerbs.entrySet()) {
|
||||||
if (methodName.startsWith(entry.getKey())) {
|
if (methodName.startsWith(entry.getKey())) {
|
||||||
methodName = entry.getValue() + "-" + apiNamePrefix + methodName.substring(entry.getKey().length());
|
methodName = entry.getValue() + "-" + apiNamePrefix + methodName.substring(entry.getKey().length());
|
||||||
LOGGER.info("Naming the method using the common verb (e.g. Create, Delete, Update): {} => {}", operationId, methodName);
|
LOGGER.info("Naming the method by mapping the common verbs (e.g. Create, Change) to PS verbs: {} => {}", operationId, methodName);
|
||||||
return methodName;
|
return methodName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,16 +151,19 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
|
|||||||
{{#isKeyInHeader}}
|
{{#isKeyInHeader}}
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
|
||||||
$LocalVarHeaderParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
|
$LocalVarHeaderParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
|
||||||
|
Write-Verbose ("Using API key '{{{name}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isKeyInHeader}}
|
{{/isKeyInHeader}}
|
||||||
{{#isKeyInQuery}}
|
{{#isKeyInQuery}}
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{name}}}"]) {
|
||||||
$LocalVarQueryParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
|
$LocalVarQueryParameters['{{{name}}}'] = $Configuration["ApiKey"]["{{{name}}}"]
|
||||||
|
Write-Verbose ("Using API key `{{{name}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isKeyInQuery}}
|
{{/isKeyInQuery}}
|
||||||
{{#isKeyInCookie}}
|
{{#isKeyInCookie}}
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['{{{name}}}'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['{{{name}}}'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `{{{name}}}` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isKeyInCookie}}
|
{{/isKeyInCookie}}
|
||||||
{{/isApiKey}}
|
{{/isApiKey}}
|
||||||
@ -169,11 +172,13 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
|
|||||||
$LocalVarBytes = [System.Text.Encoding]::UTF8.GetBytes($Configuration["Username"] + ":" + $Configuration["Password"])
|
$LocalVarBytes = [System.Text.Encoding]::UTF8.GetBytes($Configuration["Username"] + ":" + $Configuration["Password"])
|
||||||
$LocalVarBase64Text =[Convert]::ToBase64String($LocalVarBytes)
|
$LocalVarBase64Text =[Convert]::ToBase64String($LocalVarBytes)
|
||||||
$LocalVarHeaderParameters['Authorization'] = "Basic " + $LocalVarBase64Text
|
$LocalVarHeaderParameters['Authorization'] = "Basic " + $LocalVarBase64Text
|
||||||
|
Write-Verbose ("Using HTTP basic authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isBasicBasic}}
|
{{/isBasicBasic}}
|
||||||
{{#isBasicBearer}}
|
{{#isBasicBearer}}
|
||||||
if ($Configuration["AccessToken"]) {
|
if ($Configuration["AccessToken"]) {
|
||||||
$LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"]
|
$LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"]
|
||||||
|
Write-Verbose ("Using Bearer authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
{{/isBasicBearer}}
|
{{/isBasicBearer}}
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ ${{paramName}} = {{{vendorExtensions.x-powershell-example}}} # {{{dataType}}} |
|
|||||||
try {
|
try {
|
||||||
{{#returnType}}{{returnType}} $Result = {{/returnType}}{{{vendorExtensions.x-powershell-method-name}}}{{#allParams}} -{{paramName}} ${{paramName}}{{/allParams}}
|
{{#returnType}}{{returnType}} $Result = {{/returnType}}{{{vendorExtensions.x-powershell-method-name}}}{{#allParams}} -{{paramName}} ${{paramName}}{{/allParams}}
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling {{{vendorExtensions.x-powershell-method-name}}}: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ $Id = 38369
|
|||||||
#$result = Update-PSPetWithForm
|
#$result = Update-PSPetWithForm
|
||||||
try {
|
try {
|
||||||
Set-PSConfigurationApiKey -Id "api_key" -ApiKey "zzZZZZZZZZZZZZZ"
|
Set-PSConfigurationApiKey -Id "api_key" -ApiKey "zzZZZZZZZZZZZZZ"
|
||||||
$result = Get-PSPetById -petId $Id #-testHeader "testing only" -testQuery "testing something here"
|
$result = Get-PSPetById -petId $Id -Verbose #-testHeader "testing only" -testQuery "testing something here"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling '': {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
|
|
||||||
$result | Write-Host
|
#$result | Write-Host
|
||||||
|
|
||||||
#$result | Select-Object -Property "photoUrls" | ConvertTo-Json | Write-Host
|
#$result | Select-Object -Property "photoUrls" | ConvertTo-Json | Write-Host
|
||||||
#Write-Host "result =" + $result.photoUrls
|
#Write-Host "result =" + $result.photoUrls
|
||||||
|
@ -35,8 +35,8 @@ $Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_
|
|||||||
try {
|
try {
|
||||||
Pet $Result = Add-PSPet -Pet $Pet
|
Pet $Result = Add-PSPet -Pet $Pet
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Add-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -84,8 +84,8 @@ $ApiKey = "ApiKey_example" # String | (optional) (default to null)
|
|||||||
try {
|
try {
|
||||||
Remove-Pet -PetId $PetId -ApiKey $ApiKey
|
Remove-Pet -PetId $PetId -ApiKey $ApiKey
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Remove-Pet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -134,8 +134,8 @@ $Status = @("Status_example") # String[] | Status values that need to be conside
|
|||||||
try {
|
try {
|
||||||
Pet[] $Result = Find-PSPetsByStatus -Status $Status
|
Pet[] $Result = Find-PSPetsByStatus -Status $Status
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Find-PSPetsByStatus: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -183,8 +183,8 @@ $Tags = @("Inner_example") # String[] | Tags to filter by (default to null)
|
|||||||
try {
|
try {
|
||||||
Pet[] $Result = Find-PSPetsByTags -Tags $Tags
|
Pet[] $Result = Find-PSPetsByTags -Tags $Tags
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Find-PSPetsByTags: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -234,8 +234,8 @@ $PetId = 987 # Int64 | ID of pet to return (default to null)
|
|||||||
try {
|
try {
|
||||||
Pet $Result = Get-PSPetById -PetId $PetId
|
Pet $Result = Get-PSPetById -PetId $PetId
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Get-PSPetById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -281,8 +281,8 @@ $Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_
|
|||||||
try {
|
try {
|
||||||
Pet $Result = Update-PSPet -Pet $Pet
|
Pet $Result = Update-PSPet -Pet $Pet
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Update-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -332,8 +332,8 @@ $Status = "Status_example" # String | Updated status of the pet (optional) (defa
|
|||||||
try {
|
try {
|
||||||
Update-PSPetWithForm -PetId $PetId -Name $Name -Status $Status
|
Update-PSPetWithForm -PetId $PetId -Name $Name -Status $Status
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Update-PSPetWithForm: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -385,8 +385,8 @@ $File = 987 # System.IO.FileInfo | file to upload (optional) (default to null)
|
|||||||
try {
|
try {
|
||||||
ApiResponse $Result = Invoke-PSUploadFile -PetId $PetId -AdditionalMetadata $AdditionalMetadata -File $File
|
ApiResponse $Result = Invoke-PSUploadFile -PetId $PetId -AdditionalMetadata $AdditionalMetadata -File $File
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Invoke-PSUploadFile: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ $OrderId = "OrderId_example" # String | ID of the order that needs to be deleted
|
|||||||
try {
|
try {
|
||||||
Remove-PSOrder -OrderId $OrderId
|
Remove-PSOrder -OrderId $OrderId
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Remove-PSOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
|
|||||||
try {
|
try {
|
||||||
System.Collections.Hashtable $Result = Get-PSInventory
|
System.Collections.Hashtable $Result = Get-PSInventory
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Get-PSInventory: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -120,8 +120,8 @@ $OrderId = 987 # Int64 | ID of pet that needs to be fetched (default to null)
|
|||||||
try {
|
try {
|
||||||
Order $Result = Get-PSOrderById -OrderId $OrderId
|
Order $Result = Get-PSOrderById -OrderId $OrderId
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Get-PSOrderById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -163,8 +163,8 @@ $Order = (Initialize-Order-Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -S
|
|||||||
try {
|
try {
|
||||||
Order $Result = Invoke-PSPlaceOrder -Order $Order
|
Order $Result = Invoke-PSPlaceOrder -Order $Order
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Invoke-PSPlaceOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ $User = (Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstNa
|
|||||||
try {
|
try {
|
||||||
New-PSUser -User $User
|
New-PSUser -User $User
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling New-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -88,8 +88,8 @@ $User = @((Initialize-User-Id 123 -Username "Username_example" -FirstName "First
|
|||||||
try {
|
try {
|
||||||
New-PSUsersWithArrayInput -User $User
|
New-PSUsersWithArrayInput -User $User
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling New-PSUsersWithArrayInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -137,8 +137,8 @@ $User = @() # User[] | List of user object
|
|||||||
try {
|
try {
|
||||||
New-PSUsersWithListInput -User $User
|
New-PSUsersWithListInput -User $User
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling New-PSUsersWithListInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -188,8 +188,8 @@ $Username = "Username_example" # String | The name that needs to be deleted (def
|
|||||||
try {
|
try {
|
||||||
Remove-PSUser -Username $Username
|
Remove-PSUser -Username $Username
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Remove-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -231,8 +231,8 @@ $Username = "Username_example" # String | The name that needs to be fetched. Use
|
|||||||
try {
|
try {
|
||||||
User $Result = Get-PSUserByName -Username $Username
|
User $Result = Get-PSUserByName -Username $Username
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Get-PSUserByName: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -276,8 +276,8 @@ $Password = "Password_example" # String | The password for login in clear text (
|
|||||||
try {
|
try {
|
||||||
String $Result = Invoke-PSLoginUser -Username $Username -Password $Password
|
String $Result = Invoke-PSLoginUser -Username $Username -Password $Password
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Invoke-PSLoginUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -324,8 +324,8 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
|||||||
try {
|
try {
|
||||||
Invoke-PSLogoutUser
|
Invoke-PSLogoutUser
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Invoke-PSLogoutUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -374,8 +374,8 @@ $User = # User | Updated user object
|
|||||||
try {
|
try {
|
||||||
Update-PSUser -Username $Username -User $User
|
Update-PSUser -Username $Username -User $User
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host ($_.ErrorDetails | ConvertFrom-Json)
|
Write-Host ("Exception occured when calling Update-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
|
||||||
Write-Host ($_.Exception.Response.Headers | ConvertTo-Json)
|
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -320,6 +320,7 @@ function Get-PSPetById {
|
|||||||
|
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key"]) {
|
||||||
$LocalVarHeaderParameters['api_key'] = $Configuration["ApiKey"]["api_key"]
|
$LocalVarHeaderParameters['api_key'] = $Configuration["ApiKey"]["api_key"]
|
||||||
|
Write-Verbose ("Using API key 'api_key' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
||||||
|
@ -103,6 +103,7 @@ function Get-PSInventory {
|
|||||||
|
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key"]) {
|
||||||
$LocalVarHeaderParameters['api_key'] = $Configuration["ApiKey"]["api_key"]
|
$LocalVarHeaderParameters['api_key'] = $Configuration["ApiKey"]["api_key"]
|
||||||
|
Write-Verbose ("Using API key 'api_key' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
||||||
|
@ -56,6 +56,7 @@ function New-PSUser {
|
|||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
|
||||||
@ -124,6 +125,7 @@ function New-PSUsersWithArrayInput {
|
|||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
|
||||||
@ -192,6 +194,7 @@ function New-PSUsersWithListInput {
|
|||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'POST' `
|
||||||
@ -255,6 +258,7 @@ function Remove-PSUser {
|
|||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'DELETE' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'DELETE' `
|
||||||
@ -444,6 +448,7 @@ function Invoke-PSLogoutUser {
|
|||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
||||||
@ -522,6 +527,7 @@ function Update-PSUser {
|
|||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
|
Write-Verbose ("Using API key `auth_cookie` in the cookie for authentication in {0}" -f $MyInvocation.MyCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'PUT' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'PUT' `
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Generated by: OpenAPI Generator Team
|
# Generated by: OpenAPI Generator Team
|
||||||
#
|
#
|
||||||
# Generated on: 4/1/20
|
# Generated on: 4/2/20
|
||||||
#
|
#
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user