[powershell] Updated the Api doc with httpsiging script snippet. (#7499)

* Added the httpsigning code snippet for api doc

* Updated the sample

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Ghufran Zahidi 2020-09-25 14:24:14 +05:30 committed by GitHub
parent 9ba943318a
commit d6bfecf2ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 89 additions and 62 deletions

View File

@ -54,7 +54,7 @@ To install and run `Pester`, please execute the following commands in the termin
```powershell ```powershell
Install-module -name Pester -force Install-module -name Pester -force
Invoker-Pester Invoke-Pester
``` ```
For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting. For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting.

View File

@ -43,6 +43,18 @@ $Configuration["ApiKey"]["{{{keyParamName}}}"] = "YOUR_API_KEY"
# Configure OAuth2 access token for authorization: {{{name}}} # Configure OAuth2 access token for authorization: {{{name}}}
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
{{/isOAuth}} {{/isOAuth}}
{{#isHttpSignature}}
# Configure HttpSignature for authorization :{{name}}
$httpSigningParams = @{
KeyId = "xxxxxx1776876789ac747/xxxxxxx564612d31a62c01/xxxxxxxa1d7564612d31a66ee8"
KeyFilePath = "C:\SecretKey.txt"
HttpSigningHeader = @("(request-target)","Host","Date","Digest")
HashAlgorithm = "sha256"
}
Set-{{{packageName}}}ConfigurationHttpSigning @httpSigningParams
{{/isHttpSignature}}
{{/authMethods}} {{/authMethods}}
{{/hasAuthMethods}} {{/hasAuthMethods}}
@ -54,7 +66,7 @@ ${{paramName}} = {{{vendorExtensions.x-powershell-example}}} # {{{dataType}}} |
# {{{.}}} # {{{.}}}
{{/summary}} {{/summary}}
try { try {
{{#returnType}}{{returnType}} $Result = {{/returnType}}{{{vendorExtensions.x-powershell-method-name}}}{{#allParams}} -{{paramName}} ${{paramName}}{{/allParams}} $Result = {{{vendorExtensions.x-powershell-method-name}}}{{#allParams}} -{{paramName}} ${{paramName}}{{/allParams}}
} catch { } catch {
Write-Host ("Exception occured when calling {{{vendorExtensions.x-powershell-method-name}}}: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling {{{vendorExtensions.x-powershell-method-name}}}: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -69,7 +81,7 @@ Name | Type | Description | Notes
{{/allParams}} {{/allParams}}
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
### Authorization ### Authorization

View File

@ -12,7 +12,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} ` ${{{classname}}} = Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} `
{{/hasMore}} {{/hasMore}}
{{/vars}} {{/vars}}
@ -20,7 +20,7 @@ Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#ha
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
${{className}} | Convert-ToJSON ${{{classname}}} | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -44,7 +44,7 @@ To install and run `Pester`, please execute the following commands in the termin
```powershell ```powershell
Install-module -name Pester -force Install-module -name Pester -force
Invoker-Pester Invoke-Pester
``` ```
For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting. For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting.

View File

@ -11,14 +11,14 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreApiResponse -Code null ` $ApiResponse = Initialize-PSPetstoreApiResponse -Code null `
-Type null ` -Type null `
-Message null -Message null
``` ```
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $ApiResponse | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreCategory -Id null ` $Category = Initialize-PSPetstoreCategory -Id null `
-Name null -Name null
``` ```
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $Category | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreInlineObject -Name null ` $InlineObject = Initialize-PSPetstoreInlineObject -Name null `
-Status null -Status null
``` ```
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $InlineObject | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null ` $InlineObject1 = Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null `
-File null -File null
``` ```
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $InlineObject1 | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreOrder -Id null ` $Order = Initialize-PSPetstoreOrder -Id null `
-PetId null ` -PetId null `
-Quantity null ` -Quantity null `
-ShipDate null ` -ShipDate null `
@ -24,7 +24,7 @@ Initialize-PSPetstoreOrder -Id null `
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $Order | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -29,11 +29,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store $Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store
# Add a new pet to the store # Add a new pet to the store
try { try {
Pet $Result = Add-PSPet -Pet $Pet $Result = Add-PSPet -Pet $Pet
} catch { } catch {
Write-Host ("Exception occured when calling Add-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Add-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -47,7 +48,7 @@ Name | Type | Description | Notes
**Pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **Pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet**](Pet.md) [**Pet**](Pet.md)
### Authorization ### Authorization
@ -77,12 +78,13 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | Pet id to delete $PetId = 987 # Int64 | Pet id to delete
$ApiKey = "ApiKey_example" # String | (optional) $ApiKey = "ApiKey_example" # String | (optional)
# Deletes a pet # Deletes a pet
try { try {
Remove-Pet -PetId $PetId -ApiKey $ApiKey $Result = Remove-Pet -PetId $PetId -ApiKey $ApiKey
} catch { } catch {
Write-Host ("Exception occured when calling Remove-Pet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Remove-Pet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -97,7 +99,7 @@ Name | Type | Description | Notes
**ApiKey** | **String**| | [optional] **ApiKey** | **String**| | [optional]
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -128,11 +130,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Status = @("Status_example") # String[] | Status values that need to be considered for filter $Status = @("Status_example") # String[] | Status values that need to be considered for filter
# Finds Pets by status # Finds Pets by status
try { try {
Pet[] $Result = Find-PSPetsByStatus -Status $Status $Result = Find-PSPetsByStatus -Status $Status
} catch { } catch {
Write-Host ("Exception occured when calling Find-PSPetsByStatus: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Find-PSPetsByStatus: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -146,7 +149,7 @@ Name | Type | Description | Notes
**Status** | [**String[]**](String.md)| Status values that need to be considered for filter | **Status** | [**String[]**](String.md)| Status values that need to be considered for filter |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet[]**](Pet.md) [**Pet[]**](Pet.md)
### Authorization ### Authorization
@ -177,11 +180,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Tags = @("Inner_example") # String[] | Tags to filter by $Tags = @("Inner_example") # String[] | Tags to filter by
# Finds Pets by tags # Finds Pets by tags
try { try {
Pet[] $Result = Find-PSPetsByTags -Tags $Tags $Result = Find-PSPetsByTags -Tags $Tags
} catch { } catch {
Write-Host ("Exception occured when calling Find-PSPetsByTags: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Find-PSPetsByTags: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -195,7 +199,7 @@ Name | Type | Description | Notes
**Tags** | [**String[]**](String.md)| Tags to filter by | **Tags** | [**String[]**](String.md)| Tags to filter by |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet[]**](Pet.md) [**Pet[]**](Pet.md)
### Authorization ### Authorization
@ -228,11 +232,12 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer" #$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
$PetId = 987 # Int64 | ID of pet to return $PetId = 987 # Int64 | ID of pet to return
# Find pet by ID # Find pet by ID
try { try {
Pet $Result = Get-PSPetById -PetId $PetId $Result = Get-PSPetById -PetId $PetId
} catch { } catch {
Write-Host ("Exception occured when calling Get-PSPetById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Get-PSPetById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -246,7 +251,7 @@ Name | Type | Description | Notes
**PetId** | **Int64**| ID of pet to return | **PetId** | **Int64**| ID of pet to return |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet**](Pet.md) [**Pet**](Pet.md)
### Authorization ### Authorization
@ -275,11 +280,12 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store $Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store
# Update an existing pet # Update an existing pet
try { try {
Pet $Result = Update-PSPet -Pet $Pet $Result = Update-PSPet -Pet $Pet
} catch { } catch {
Write-Host ("Exception occured when calling Update-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Update-PSPet: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -293,7 +299,7 @@ Name | Type | Description | Notes
**Pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | **Pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Pet**](Pet.md) [**Pet**](Pet.md)
### Authorization ### Authorization
@ -324,13 +330,14 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | ID of pet that needs to be updated $PetId = 987 # Int64 | ID of pet that needs to be updated
$Name = "Name_example" # String | Updated name of the pet (optional) $Name = "Name_example" # String | Updated name of the pet (optional)
$Status = "Status_example" # String | Updated status of the pet (optional) $Status = "Status_example" # String | Updated status of the pet (optional)
# Updates a pet in the store with form data # Updates a pet in the store with form data
try { try {
Update-PSPetWithForm -PetId $PetId -Name $Name -Status $Status $Result = Update-PSPetWithForm -PetId $PetId -Name $Name -Status $Status
} catch { } catch {
Write-Host ("Exception occured when calling Update-PSPetWithForm: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Update-PSPetWithForm: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -346,7 +353,7 @@ Name | Type | Description | Notes
**Status** | **String**| Updated status of the pet | [optional] **Status** | **String**| Updated status of the pet | [optional]
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -377,13 +384,14 @@ $Configuration = Get-PSPetstoreConfiguration
# Configure OAuth2 access token for authorization: petstore_auth # Configure OAuth2 access token for authorization: petstore_auth
$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; $Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN";
$PetId = 987 # Int64 | ID of pet to update $PetId = 987 # Int64 | ID of pet to update
$AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional) $AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional)
$File = 987 # System.IO.FileInfo | file to upload (optional) $File = 987 # System.IO.FileInfo | file to upload (optional)
# uploads an image # uploads an image
try { try {
ApiResponse $Result = Invoke-PSUploadFile -PetId $PetId -AdditionalMetadata $AdditionalMetadata -File $File $Result = Invoke-PSUploadFile -PetId $PetId -AdditionalMetadata $AdditionalMetadata -File $File
} catch { } catch {
Write-Host ("Exception occured when calling Invoke-PSUploadFile: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Invoke-PSUploadFile: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -399,7 +407,7 @@ Name | Type | Description | Notes
**File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional] **File** | **System.IO.FileInfo****System.IO.FileInfo**| file to upload | [optional]
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**ApiResponse**](ApiResponse.md) [**ApiResponse**](ApiResponse.md)
### Authorization ### Authorization

View File

@ -27,7 +27,7 @@ $OrderId = "OrderId_example" # String | ID of the order that needs to be deleted
# Delete purchase order by ID # Delete purchase order by ID
try { try {
Remove-PSOrder -OrderId $OrderId $Result = Remove-PSOrder -OrderId $OrderId
} catch { } catch {
Write-Host ("Exception occured when calling Remove-PSOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Remove-PSOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -41,7 +41,7 @@ Name | Type | Description | Notes
**OrderId** | **String**| ID of the order that needs to be deleted | **OrderId** | **String**| ID of the order that needs to be deleted |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -74,9 +74,10 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY"
#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer" #$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer"
# Returns pet inventories by status # Returns pet inventories by status
try { try {
System.Collections.Hashtable $Result = Get-PSInventory $Result = Get-PSInventory
} catch { } catch {
Write-Host ("Exception occured when calling Get-PSInventory: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Get-PSInventory: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -87,7 +88,7 @@ try {
This endpoint does not need any parameter. This endpoint does not need any parameter.
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
**System.Collections.Hashtable** **System.Collections.Hashtable**
### Authorization ### Authorization
@ -118,7 +119,7 @@ $OrderId = 987 # Int64 | ID of pet that needs to be fetched
# Find purchase order by ID # Find purchase order by ID
try { try {
Order $Result = Get-PSOrderById -OrderId $OrderId $Result = Get-PSOrderById -OrderId $OrderId
} catch { } catch {
Write-Host ("Exception occured when calling Get-PSOrderById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Get-PSOrderById: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -132,7 +133,7 @@ Name | Type | Description | Notes
**OrderId** | **Int64**| ID of pet that needs to be fetched | **OrderId** | **Int64**| ID of pet that needs to be fetched |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Order**](Order.md) [**Order**](Order.md)
### Authorization ### Authorization
@ -161,7 +162,7 @@ $Order = (Initialize-Order-Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -S
# Place an order for a pet # Place an order for a pet
try { try {
Order $Result = Invoke-PSPlaceOrder -Order $Order $Result = Invoke-PSPlaceOrder -Order $Order
} catch { } catch {
Write-Host ("Exception occured when calling Invoke-PSPlaceOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Invoke-PSPlaceOrder: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -175,7 +176,7 @@ Name | Type | Description | Notes
**Order** | [**Order**](Order.md)| order placed for purchasing the pet | **Order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**Order**](Order.md) [**Order**](Order.md)
### Authorization ### Authorization

View File

@ -33,11 +33,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$User = (Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object $User = (Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object
# Create user # Create user
try { try {
New-PSUser -User $User $Result = New-PSUser -User $User
} catch { } catch {
Write-Host ("Exception occured when calling New-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling New-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -51,7 +52,7 @@ Name | Type | Description | Notes
**User** | [**User**](User.md)| Created user object | **User** | [**User**](User.md)| Created user object |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -82,11 +83,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$User = @((Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object $User = @((Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object
# Creates list of users with given input array # Creates list of users with given input array
try { try {
New-PSUsersWithArrayInput -User $User $Result = New-PSUsersWithArrayInput -User $User
} catch { } catch {
Write-Host ("Exception occured when calling New-PSUsersWithArrayInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling New-PSUsersWithArrayInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -100,7 +102,7 @@ Name | Type | Description | Notes
**User** | [**User[]**](User.md)| List of user object | **User** | [**User[]**](User.md)| List of user object |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -131,11 +133,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$User = @() # User[] | List of user object $User = @() # User[] | List of user object
# Creates list of users with given input array # Creates list of users with given input array
try { try {
New-PSUsersWithListInput -User $User $Result = New-PSUsersWithListInput -User $User
} catch { } catch {
Write-Host ("Exception occured when calling New-PSUsersWithListInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling New-PSUsersWithListInput: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -149,7 +152,7 @@ Name | Type | Description | Notes
**User** | [**User[]**](User.md)| List of user object | **User** | [**User[]**](User.md)| List of user object |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -182,11 +185,12 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$Username = "Username_example" # String | The name that needs to be deleted $Username = "Username_example" # String | The name that needs to be deleted
# Delete user # Delete user
try { try {
Remove-PSUser -Username $Username $Result = Remove-PSUser -Username $Username
} catch { } catch {
Write-Host ("Exception occured when calling Remove-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Remove-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -200,7 +204,7 @@ Name | Type | Description | Notes
**Username** | **String**| The name that needs to be deleted | **Username** | **String**| The name that needs to be deleted |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -229,7 +233,7 @@ $Username = "Username_example" # String | The name that needs to be fetched. Use
# Get user by user name # Get user by user name
try { try {
User $Result = Get-PSUserByName -Username $Username $Result = Get-PSUserByName -Username $Username
} catch { } catch {
Write-Host ("Exception occured when calling Get-PSUserByName: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Get-PSUserByName: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -243,7 +247,7 @@ Name | Type | Description | Notes
**Username** | **String**| The name that needs to be fetched. Use user1 for testing. | **Username** | **String**| The name that needs to be fetched. Use user1 for testing. |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
[**User**](User.md) [**User**](User.md)
### Authorization ### Authorization
@ -274,7 +278,7 @@ $Password = "Password_example" # String | The password for login in clear text
# Logs user into the system # Logs user into the system
try { try {
String $Result = Invoke-PSLoginUser -Username $Username -Password $Password $Result = Invoke-PSLoginUser -Username $Username -Password $Password
} catch { } catch {
Write-Host ("Exception occured when calling Invoke-PSLoginUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Invoke-PSLoginUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -289,7 +293,7 @@ Name | Type | Description | Notes
**Password** | **String**| The password for login in clear text | **Password** | **String**| The password for login in clear text |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
**String** **String**
### Authorization ### Authorization
@ -320,9 +324,10 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
# Logs out current logged in user session # Logs out current logged in user session
try { try {
Invoke-PSLogoutUser $Result = Invoke-PSLogoutUser
} catch { } catch {
Write-Host ("Exception occured when calling Invoke-PSLogoutUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Invoke-PSLogoutUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -333,7 +338,7 @@ try {
This endpoint does not need any parameter. This endpoint does not need any parameter.
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization
@ -367,12 +372,13 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" #$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
$Username = "Username_example" # String | name that need to be deleted $Username = "Username_example" # String | name that need to be deleted
$User = # User | Updated user object $User = # User | Updated user object
# Updated user # Updated user
try { try {
Update-PSUser -Username $Username -User $User $Result = Update-PSUser -Username $Username -User $User
} catch { } catch {
Write-Host ("Exception occured when calling Update-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json)) Write-Host ("Exception occured when calling Update-PSUser: {0}" -f ($_.ErrorDetails | ConvertFrom-Json))
Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json)) Write-Host ("Response headers: {0}" -f ($_.Exception.Response.Headers | ConvertTo-Json))
@ -387,7 +393,7 @@ Name | Type | Description | Notes
**User** | [**User**](User.md)| Updated user object | **User** | [**User**](User.md)| Updated user object |
### Return type ### Return type
# cmdlet returns PSCustomObject, the return object contains the properties of below type
void (empty response body) void (empty response body)
### Authorization ### Authorization

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstorePet -Id null ` $Pet = Initialize-PSPetstorePet -Id null `
-Category null ` -Category null `
-Name doggie ` -Name doggie `
-PhotoUrls null ` -PhotoUrls null `
@ -24,7 +24,7 @@ Initialize-PSPetstorePet -Id null `
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $Pet | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -10,13 +10,13 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreTag -Id null ` $Tag = Initialize-PSPetstoreTag -Id null `
-Name null -Name null
``` ```
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $Tag | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -16,7 +16,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Initialize-PSPetstoreUser -Id null ` $User = Initialize-PSPetstoreUser -Id null `
-Username null ` -Username null `
-FirstName null ` -FirstName null `
-LastName null ` -LastName null `
@ -28,7 +28,7 @@ Initialize-PSPetstoreUser -Id null `
- Convert the resource to JSON - Convert the resource to JSON
```powershell ```powershell
$ | Convert-ToJSON $User | ConvertTo-JSON
``` ```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)