use Initialize instead of prepare (#5777)

This commit is contained in:
William Cheng 2020-04-01 11:21:11 +08:00 committed by GitHub
parent 24513091b0
commit f58ebf65d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 62 additions and 59 deletions

View File

@ -47,11 +47,10 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
protected String apiTestPath = "tests/Api"; protected String apiTestPath = "tests/Api";
protected String modelTestPath = "tests/Model"; protected String modelTestPath = "tests/Model";
protected HashSet nullablePrimitives; protected HashSet nullablePrimitives;
protected HashSet powershellVerbs;
protected String powershellGalleryUrl; protected String powershellGalleryUrl;
protected HashSet powershellVerbs;
protected Map<String, String> commonVerbs; // verbs not in the official ps verb list but can be mapped to one of the verbs protected Map<String, String> commonVerbs; // verbs not in the official ps verb list but can be mapped to one of the verbs
/** /**
* Constructs an instance of `PowerShellExperimentalClientCodegen`. * Constructs an instance of `PowerShellExperimentalClientCodegen`.
*/ */
@ -804,7 +803,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
processedModelMap.put(model, 1); processedModelMap.put(model, 1);
} }
example = "(Prepare-" + codegenModel.name; example = "(Initialize-" + codegenModel.name;
List<String> propertyExamples = new ArrayList<>(); List<String> propertyExamples = new ArrayList<>();
for (CodegenProperty codegenProperty : codegenModel.vars) { for (CodegenProperty codegenProperty : codegenModel.vars) {
propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap));
@ -826,7 +825,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
} else if (cp.isListContainer) { // array } else if (cp.isListContainer) { // array
return getPSDataType(cp.items) + "[]"; return getPSDataType(cp.items) + "[]";
} else if (cp.isMapContainer) { // map } else if (cp.isMapContainer) { // map
return "Hashtable"; return "System.Collections.Hashtable";
} else { // model } else { // model
return "PSCustomObject"; return "PSCustomObject";
} }
@ -844,7 +843,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
} else if (cp.isListContainer) { // array } else if (cp.isListContainer) { // array
return getPSDataType(cp.items) + "[]"; return getPSDataType(cp.items) + "[]";
} else if (cp.isMapContainer) { // map } else if (cp.isMapContainer) { // map
return "Hashtable"; return "System.Collections.Hashtable";
} else { // model } else { // model
return "PSCustomObject"; return "PSCustomObject";
} }

View File

@ -29,14 +29,14 @@ This PowerShell module is automatically generated by the [OpenAPI Generator](htt
{{#powershellGalleryUrl}} {{#powershellGalleryUrl}}
To install from PowerShell Gallery ({{{powershellGalleryUrl}}}) To install from PowerShell Gallery ({{{powershellGalleryUrl}}})
```powershell ```powershell
Import-Module -Name {{{powershellGalleryId}}} Import-Module -Name {{{powershellGalleryId}}} -Verbose
``` ```
{{/powershellGalleryUrl}} {{/powershellGalleryUrl}}
To install from the source, run the following command to build and install the PowerShell module locally: To install from the source, run the following command to build and install the PowerShell module locally:
```powershell ```powershell
Build.ps1 Build.ps1
Import-Module -Name '.\src\{{{packageName}}}' Import-Module -Name '.\src\{{{packageName}}}' -Verbose
``` ```
To avoid function name collision, one can use `-Prefix`, e.g. `Import-Module -Name '.\src\{{{packageName}}}' -Prefix prefix` To avoid function name collision, one can use `-Prefix`, e.g. `Import-Module -Name '.\src\{{{packageName}}}' -Prefix prefix`
@ -57,6 +57,8 @@ Install-module -name Pester -force
Invoker-Pester Invoker-Pester
``` ```
For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting.
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *{{{basePath}}}* All URIs are relative to *{{{basePath}}}*

View File

@ -20,7 +20,7 @@
{{{classname}}}<PSCustomObject> {{{classname}}}<PSCustomObject>
#> #>
function Prepare-{{{apiNamePrefix}}}{{{classname}}} { function Initialize-{{{apiNamePrefix}}}{{{classname}}} {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
{{#vars}} {{#vars}}
@ -33,7 +33,7 @@ function Prepare-{{{apiNamePrefix}}}{{{classname}}} {
) )
Process { Process {
'Creating object: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug 'Creating PSCustomObject: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -12,7 +12,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} ` Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} `
{{/hasMore}} {{/hasMore}}
{{/vars}} {{/vars}}

View File

@ -20,13 +20,13 @@ This PowerShell module is automatically generated by the [OpenAPI Generator](htt
To install from PowerShell Gallery (https://www.powershellgallery.com/packages/PSPetstore) To install from PowerShell Gallery (https://www.powershellgallery.com/packages/PSPetstore)
```powershell ```powershell
Import-Module -Name PSPetstore Import-Module -Name PSPetstore -Verbose
``` ```
To install from the source, run the following command to build and install the PowerShell module locally: To install from the source, run the following command to build and install the PowerShell module locally:
```powershell ```powershell
Build.ps1 Build.ps1
Import-Module -Name '.\src\PSPetstore' Import-Module -Name '.\src\PSPetstore' -Verbose
``` ```
To avoid function name collision, one can use `-Prefix`, e.g. `Import-Module -Name '.\src\PSPetstore' -Prefix prefix` To avoid function name collision, one can use `-Prefix`, e.g. `Import-Module -Name '.\src\PSPetstore' -Prefix prefix`
@ -47,6 +47,8 @@ Install-module -name Pester -force
Invoker-Pester Invoker-Pester
``` ```
For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debugging and disable it with `$DebugPreference = 'SilentlyContinue'` when done with the troubleshooting.
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io:80/v2* All URIs are relative to *http://petstore.swagger.io:80/v2*

View File

@ -3,7 +3,7 @@
Remove-Module -FullyQualifiedName @{ModuleName = "PSPetstore"; ModuleVersion = "0.1.2"} Remove-Module -FullyQualifiedName @{ModuleName = "PSPetstore"; ModuleVersion = "0.1.2"}
#Remove-Module -FullyQualifiedName @{ModuleName = "PSPetstore"; ModuleVersion = "0.0"} #Remove-Module -FullyQualifiedName @{ModuleName = "PSPetstore"; ModuleVersion = "0.0"}
Import-Module -Name '.\src\PSPetstore\PSPetstore.psd1' Import-Module -Name '.\src\PSPetstore\PSPetstore.psd1' -Verbose
#Import-Module -Name '.\src\PSPetstore\PSPetstore.psd1' -Verbose #Import-Module -Name '.\src\PSPetstore\PSPetstore.psd1' -Verbose
#Import-Module -Name '.\src\PSOpenAPITools' #Import-Module -Name '.\src\PSOpenAPITools'
#Import-Module -Name '.\src\Org.OpenAPITools' #Import-Module -Name '.\src\Org.OpenAPITools'
@ -11,7 +11,7 @@ Import-Module -Name '.\src\PSPetstore\PSPetstore.psd1'
#$DebugPreference = 'Continue' #$DebugPreference = 'Continue'
$body = (New-PSUser -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) $body = (Initialize-PSUser -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)
$Id = 38369 $Id = 38369
@ -29,13 +29,13 @@ $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
#$pet = New-Pet -Id 10129 -Name 'foo' -Category ( #$pet = Initialize-Pet -Id 10129 -Name 'foo' -Category (
# New-Category -Id 2 -Name 'bar' # Initialize-Category -Id 2 -Name 'bar'
#) -PhotoUrls @( #) -PhotoUrls @(
# 'http://example.com/foo', # 'http://example.com/foo',
# 'http://example.com/bar' # 'http://example.com/bar'
#) -Tags ( #) -Tags (
# New-Tag -Id 3 -Name 'baz' # Initialize-Tag -Id 3 -Name 'baz'
#) -Status Available #) -Status Available
# #
#Write-Host $pet #Write-Host $pet

View File

@ -11,7 +11,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreApiResponse -Code null ` Initialize-PSPetstoreApiResponse -Code null `
-Type null ` -Type null `
-Message null -Message null
``` ```

View File

@ -10,7 +10,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreCategory -Id null ` Initialize-PSPetstoreCategory -Id null `
-Name null -Name null
``` ```

View File

@ -10,7 +10,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreInlineObject -Name null ` Initialize-PSPetstoreInlineObject -Name null `
-Status null -Status null
``` ```

View File

@ -10,7 +10,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreInlineObject1 -AdditionalMetadata null ` Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null `
-File null -File null
``` ```

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreOrder -Id null ` Initialize-PSPetstoreOrder -Id null `
-PetId null ` -PetId null `
-Quantity null ` -Quantity null `
-ShipDate null ` -ShipDate null `

View File

@ -29,7 +29,7 @@ $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 = (Prepare-Pet -Id 123 -Category (Prepare-Category -Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Prepare-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 {
@ -275,7 +275,7 @@ $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 = (Prepare-Pet -Id 123 -Category (Prepare-Category -Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Prepare-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 {

View File

@ -157,7 +157,7 @@ Place an order for a pet
```powershell ```powershell
Import-Module -Name PSPetstore Import-Module -Name PSPetstore
$Order = (Prepare-Order -Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "Status_example" -Complete $false) # Order | order placed for purchasing the pet $Order = (Initialize-Order-Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "Status_example" -Complete $false) # Order | order placed for purchasing the pet
# Place an order for a pet # Place an order for a pet
try { try {

View File

@ -33,7 +33,7 @@ $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 = (Prepare-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 {
@ -82,7 +82,7 @@ $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 = @((Prepare-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 {

View File

@ -14,7 +14,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstorePet -Id null ` Initialize-PSPetstorePet -Id null `
-Category null ` -Category null `
-Name doggie ` -Name doggie `
-PhotoUrls null ` -PhotoUrls null `

View File

@ -10,7 +10,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreTag -Id null ` Initialize-PSPetstoreTag -Id null `
-Name null -Name null
``` ```

View File

@ -16,7 +16,7 @@ Name | Type | Description | Notes
- Prepare the resource - Prepare the resource
```powershell ```powershell
Prepare-PSPetstoreUser -Id null ` Initialize-PSPetstoreUser -Id null `
-Username null ` -Username null `
-FirstName null ` -FirstName null `
-LastName null ` -LastName null `

View File

@ -28,7 +28,7 @@ No description available.
ApiResponse<PSCustomObject> ApiResponse<PSCustomObject>
#> #>
function Prepare-PSApiResponse { function Initialize-PSApiResponse {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -43,7 +43,7 @@ function Prepare-PSApiResponse {
) )
Process { Process {
'Creating object: PSPetstore => PSApiResponse' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSApiResponse' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -25,7 +25,7 @@ No description available.
Category<PSCustomObject> Category<PSCustomObject>
#> #>
function Prepare-PSCategory { function Initialize-PSCategory {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -37,7 +37,7 @@ function Prepare-PSCategory {
) )
Process { Process {
'Creating object: PSPetstore => PSCategory' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSCategory' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -25,7 +25,7 @@ Updated status of the pet
InlineObject<PSCustomObject> InlineObject<PSCustomObject>
#> #>
function Prepare-PSInlineObject { function Initialize-PSInlineObject {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -37,7 +37,7 @@ function Prepare-PSInlineObject {
) )
Process { Process {
'Creating object: PSPetstore => PSInlineObject' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSInlineObject' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -25,7 +25,7 @@ file to upload
InlineObject1<PSCustomObject> InlineObject1<PSCustomObject>
#> #>
function Prepare-PSInlineObject1 { function Initialize-PSInlineObject1 {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -37,7 +37,7 @@ function Prepare-PSInlineObject1 {
) )
Process { Process {
'Creating object: PSPetstore => PSInlineObject1' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSInlineObject1' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -37,7 +37,7 @@ No description available.
Order<PSCustomObject> Order<PSCustomObject>
#> #>
function Prepare-PSOrder { function Initialize-PSOrder {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -61,7 +61,7 @@ function Prepare-PSOrder {
) )
Process { Process {
'Creating object: PSPetstore => PSOrder' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSOrder' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -37,7 +37,7 @@ pet status in the store
Pet<PSCustomObject> Pet<PSCustomObject>
#> #>
function Prepare-PSPet { function Initialize-PSPet {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -61,7 +61,7 @@ function Prepare-PSPet {
) )
Process { Process {
'Creating object: PSPetstore => PSPet' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSPet' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -25,7 +25,7 @@ No description available.
Tag<PSCustomObject> Tag<PSCustomObject>
#> #>
function Prepare-PSTag { function Initialize-PSTag {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -37,7 +37,7 @@ function Prepare-PSTag {
) )
Process { Process {
'Creating object: PSPetstore => PSTag' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSTag' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -43,7 +43,7 @@ User Status
User<PSCustomObject> User<PSCustomObject>
#> #>
function Prepare-PSUser { function Initialize-PSUser {
[CmdletBinding()] [CmdletBinding()]
Param ( Param (
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
@ -73,7 +73,7 @@ function Prepare-PSUser {
) )
Process { Process {
'Creating object: PSPetstore => PSUser' | Write-Debug 'Creating PSCustomObject: PSPetstore => PSUser' | Write-Debug
$PSBoundParameters | Out-DebugParameter | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug
$PSO = [PSCustomObject]@{ $PSO = [PSCustomObject]@{

View File

@ -75,12 +75,12 @@ FunctionsToExport = 'Add-PSPet', 'Remove-Pet', 'Find-PSPetsByStatus', 'Find-PSPe
'Get-PSOrderById', 'Invoke-PSPlaceOrder', 'New-PSUser', 'Get-PSOrderById', 'Invoke-PSPlaceOrder', 'New-PSUser',
'New-PSUsersWithArrayInput', 'New-PSUsersWithListInput', 'New-PSUsersWithArrayInput', 'New-PSUsersWithListInput',
'Remove-PSUser', 'Get-PSUserByName', 'Invoke-PSLoginUser', 'Remove-PSUser', 'Get-PSUserByName', 'Invoke-PSLoginUser',
'Invoke-PSLogoutUser', 'Update-PSUser', 'Prepare-PSApiResponse', 'Invoke-PSLogoutUser', 'Update-PSUser', 'Initialize-PSApiResponse',
'Prepare-PSCategory', 'Prepare-PSInlineObject', 'Initialize-PSCategory', 'Initialize-PSInlineObject',
'Prepare-PSInlineObject1', 'Prepare-PSOrder', 'Prepare-PSPet', 'Initialize-PSInlineObject1', 'Initialize-PSOrder',
'Prepare-PSTag', 'Prepare-PSUser', 'Get-PSConfiguration', 'Initialize-PSPet', 'Initialize-PSTag', 'Initialize-PSUser',
'Set-PSConfiguration', 'Set-PSConfigurationApiKey', 'Get-PSConfiguration', 'Set-PSConfiguration',
'Set-PSConfigurationApiKeyPrefix', 'Set-PSConfigurationApiKey', 'Set-PSConfigurationApiKeyPrefix',
'Set-PSConfigurationDefaultHeader', 'Get-PSHostSettings', 'Set-PSConfigurationDefaultHeader', 'Get-PSHostSettings',
'Get-PSUrlFromHostSettings' 'Get-PSUrlFromHostSettings'

View File

@ -11,13 +11,13 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' {
$Id = 38369 $Id = 38369
# Add pet # Add pet
$Pet = Prepare-PSPet -Id $Id -Name 'PowerShell' -Category ( $Pet = Initialize-PSPet -Id $Id -Name 'PowerShell' -Category (
Prepare-PSCategory -Id $Id -Name 'PSCategory' Initialize-PSCategory -Id $Id -Name 'PSCategory'
) -PhotoUrls @( ) -PhotoUrls @(
'http://example.com/foo', 'http://example.com/foo',
'http://example.com/bar' 'http://example.com/bar'
) -Tags ( ) -Tags (
Prepare-PSTag -Id $Id -Name 'PSTag' Initialize-PSTag -Id $Id -Name 'PSTag'
) -Status Available ) -Status Available
$Result = Add-PSPet -Pet $Pet $Result = Add-PSPet -Pet $Pet
@ -36,13 +36,13 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' {
$Result."status" | Should Be "Pending" $Result."status" | Should Be "Pending"
# Update (put) # Update (put)
$NewPet = Prepare-PSPet -Id $Id -Name 'PowerShell2' -Category ( $NewPet = Initialize-PSPet -Id $Id -Name 'PowerShell2' -Category (
Prepare-PSCategory -Id $Id -Name 'PSCategory2' Initialize-PSCategory -Id $Id -Name 'PSCategory2'
) -PhotoUrls @( ) -PhotoUrls @(
'http://example.com/foo2', 'http://example.com/foo2',
'http://example.com/bar2' 'http://example.com/bar2'
) -Tags ( ) -Tags (
Prepare-PSTag -Id $Id -Name 'PSTag2' Initialize-PSTag -Id $Id -Name 'PSTag2'
) -Status Sold ) -Status Sold
$Result = Update-PSPet -Pet $NewPet $Result = Update-PSPet -Pet $NewPet