From f58ebf65d10f2504b8ecbb9620bab211513e4abc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 1 Apr 2020 11:21:11 +0800 Subject: [PATCH] use Initialize instead of prepare (#5777) --- .../PowerShellExperimentalClientCodegen.java | 11 +++++------ .../powershell-experimental/README.mustache | 6 ++++-- .../resources/powershell-experimental/model.mustache | 4 ++-- .../powershell-experimental/model_doc.mustache | 2 +- .../petstore/powershell-experimental/README.md | 6 ++++-- .../petstore/powershell-experimental/Test1.ps1 | 10 +++++----- .../powershell-experimental/docs/ApiResponse.md | 2 +- .../powershell-experimental/docs/Category.md | 2 +- .../powershell-experimental/docs/InlineObject.md | 2 +- .../powershell-experimental/docs/InlineObject1.md | 2 +- .../petstore/powershell-experimental/docs/Order.md | 2 +- .../powershell-experimental/docs/PSPetApi.md | 4 ++-- .../powershell-experimental/docs/PSStoreApi.md | 2 +- .../powershell-experimental/docs/PSUserApi.md | 4 ++-- .../petstore/powershell-experimental/docs/Pet.md | 2 +- .../petstore/powershell-experimental/docs/Tag.md | 2 +- .../petstore/powershell-experimental/docs/User.md | 2 +- .../src/PSPetstore/Model/ApiResponse.ps1 | 4 ++-- .../src/PSPetstore/Model/Category.ps1 | 4 ++-- .../src/PSPetstore/Model/InlineObject.ps1 | 4 ++-- .../src/PSPetstore/Model/InlineObject1.ps1 | 4 ++-- .../src/PSPetstore/Model/Order.ps1 | 4 ++-- .../src/PSPetstore/Model/Pet.ps1 | 4 ++-- .../src/PSPetstore/Model/Tag.ps1 | 4 ++-- .../src/PSPetstore/Model/User.ps1 | 4 ++-- .../src/PSPetstore/PSPetstore.psd1 | 12 ++++++------ .../powershell-experimental/tests/Petstore.Tests.ps1 | 12 ++++++------ 27 files changed, 62 insertions(+), 59 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java index a66f57b37e4..e71f1cc3998 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java @@ -47,11 +47,10 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen protected String apiTestPath = "tests/Api"; protected String modelTestPath = "tests/Model"; protected HashSet nullablePrimitives; - protected HashSet powershellVerbs; protected String powershellGalleryUrl; + protected HashSet powershellVerbs; protected Map commonVerbs; // verbs not in the official ps verb list but can be mapped to one of the verbs - /** * Constructs an instance of `PowerShellExperimentalClientCodegen`. */ @@ -804,10 +803,10 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen processedModelMap.put(model, 1); } - example = "(Prepare-" + codegenModel.name; + example = "(Initialize-" + codegenModel.name; List propertyExamples = new ArrayList<>(); for (CodegenProperty codegenProperty : codegenModel.vars) { - propertyExamples.add(" -" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); + propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); } example += StringUtils.join(propertyExamples, " "); example += ")"; @@ -826,7 +825,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen } else if (cp.isListContainer) { // array return getPSDataType(cp.items) + "[]"; } else if (cp.isMapContainer) { // map - return "Hashtable"; + return "System.Collections.Hashtable"; } else { // model return "PSCustomObject"; } @@ -844,7 +843,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen } else if (cp.isListContainer) { // array return getPSDataType(cp.items) + "[]"; } else if (cp.isMapContainer) { // map - return "Hashtable"; + return "System.Collections.Hashtable"; } else { // model return "PSCustomObject"; } diff --git a/modules/openapi-generator/src/main/resources/powershell-experimental/README.mustache b/modules/openapi-generator/src/main/resources/powershell-experimental/README.mustache index 6a7b151d335..357274b6543 100644 --- a/modules/openapi-generator/src/main/resources/powershell-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/powershell-experimental/README.mustache @@ -29,14 +29,14 @@ This PowerShell module is automatically generated by the [OpenAPI Generator](htt {{#powershellGalleryUrl}} To install from PowerShell Gallery ({{{powershellGalleryUrl}}}) ```powershell -Import-Module -Name {{{powershellGalleryId}}} +Import-Module -Name {{{powershellGalleryId}}} -Verbose ``` {{/powershellGalleryUrl}} To install from the source, run the following command to build and install the PowerShell module locally: ```powershell 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` @@ -57,6 +57,8 @@ Install-module -name Pester -force 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 All URIs are relative to *{{{basePath}}}* diff --git a/modules/openapi-generator/src/main/resources/powershell-experimental/model.mustache b/modules/openapi-generator/src/main/resources/powershell-experimental/model.mustache index c13346e061a..2c39a00660f 100644 --- a/modules/openapi-generator/src/main/resources/powershell-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/powershell-experimental/model.mustache @@ -20,7 +20,7 @@ {{{classname}}} #> -function Prepare-{{{apiNamePrefix}}}{{{classname}}} { +function Initialize-{{{apiNamePrefix}}}{{{classname}}} { [CmdletBinding()] Param ( {{#vars}} @@ -33,7 +33,7 @@ function Prepare-{{{apiNamePrefix}}}{{{classname}}} { ) Process { - 'Creating object: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug + 'Creating PSCustomObject: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/modules/openapi-generator/src/main/resources/powershell-experimental/model_doc.mustache b/modules/openapi-generator/src/main/resources/powershell-experimental/model_doc.mustache index f76841b2660..253050a9457 100644 --- a/modules/openapi-generator/src/main/resources/powershell-experimental/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/powershell-experimental/model_doc.mustache @@ -12,7 +12,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} ` +Initialize-{{{packageName}}}{{{classname}}} {{#vars}} -{{name}} {{example}}{{#hasMore}} ` {{/hasMore}} {{/vars}} diff --git a/samples/client/petstore/powershell-experimental/README.md b/samples/client/petstore/powershell-experimental/README.md index a210f4f3812..187e0543e42 100644 --- a/samples/client/petstore/powershell-experimental/README.md +++ b/samples/client/petstore/powershell-experimental/README.md @@ -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) ```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: ```powershell 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` @@ -47,6 +47,8 @@ Install-module -name Pester -force 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 All URIs are relative to *http://petstore.swagger.io:80/v2* diff --git a/samples/client/petstore/powershell-experimental/Test1.ps1 b/samples/client/petstore/powershell-experimental/Test1.ps1 index cfb983df5c2..67dbb552bde 100644 --- a/samples/client/petstore/powershell-experimental/Test1.ps1 +++ b/samples/client/petstore/powershell-experimental/Test1.ps1 @@ -3,7 +3,7 @@ Remove-Module -FullyQualifiedName @{ModuleName = "PSPetstore"; ModuleVersion = "0.1.2"} #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\PSOpenAPITools' #Import-Module -Name '.\src\Org.OpenAPITools' @@ -11,7 +11,7 @@ Import-Module -Name '.\src\PSPetstore\PSPetstore.psd1' #$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 @@ -29,13 +29,13 @@ $result | Write-Host #$result | Select-Object -Property "photoUrls" | ConvertTo-Json | Write-Host #Write-Host "result =" + $result.photoUrls -#$pet = New-Pet -Id 10129 -Name 'foo' -Category ( -# New-Category -Id 2 -Name 'bar' +#$pet = Initialize-Pet -Id 10129 -Name 'foo' -Category ( +# Initialize-Category -Id 2 -Name 'bar' #) -PhotoUrls @( # 'http://example.com/foo', # 'http://example.com/bar' #) -Tags ( -# New-Tag -Id 3 -Name 'baz' +# Initialize-Tag -Id 3 -Name 'baz' #) -Status Available # #Write-Host $pet diff --git a/samples/client/petstore/powershell-experimental/docs/ApiResponse.md b/samples/client/petstore/powershell-experimental/docs/ApiResponse.md index 87d631e3e48..5b4baf95c1a 100644 --- a/samples/client/petstore/powershell-experimental/docs/ApiResponse.md +++ b/samples/client/petstore/powershell-experimental/docs/ApiResponse.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreApiResponse -Code null ` +Initialize-PSPetstoreApiResponse -Code null ` -Type null ` -Message null ``` diff --git a/samples/client/petstore/powershell-experimental/docs/Category.md b/samples/client/petstore/powershell-experimental/docs/Category.md index f5117bf59d8..921e4af15d8 100644 --- a/samples/client/petstore/powershell-experimental/docs/Category.md +++ b/samples/client/petstore/powershell-experimental/docs/Category.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreCategory -Id null ` +Initialize-PSPetstoreCategory -Id null ` -Name null ``` diff --git a/samples/client/petstore/powershell-experimental/docs/InlineObject.md b/samples/client/petstore/powershell-experimental/docs/InlineObject.md index e7041bdb14b..42c762d2022 100644 --- a/samples/client/petstore/powershell-experimental/docs/InlineObject.md +++ b/samples/client/petstore/powershell-experimental/docs/InlineObject.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreInlineObject -Name null ` +Initialize-PSPetstoreInlineObject -Name null ` -Status null ``` diff --git a/samples/client/petstore/powershell-experimental/docs/InlineObject1.md b/samples/client/petstore/powershell-experimental/docs/InlineObject1.md index ec4b3baf3f8..18aa07009d1 100644 --- a/samples/client/petstore/powershell-experimental/docs/InlineObject1.md +++ b/samples/client/petstore/powershell-experimental/docs/InlineObject1.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreInlineObject1 -AdditionalMetadata null ` +Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null ` -File null ``` diff --git a/samples/client/petstore/powershell-experimental/docs/Order.md b/samples/client/petstore/powershell-experimental/docs/Order.md index 3a06f592d2e..aa40bbb2b8c 100644 --- a/samples/client/petstore/powershell-experimental/docs/Order.md +++ b/samples/client/petstore/powershell-experimental/docs/Order.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreOrder -Id null ` +Initialize-PSPetstoreOrder -Id null ` -PetId null ` -Quantity null ` -ShipDate null ` diff --git a/samples/client/petstore/powershell-experimental/docs/PSPetApi.md b/samples/client/petstore/powershell-experimental/docs/PSPetApi.md index ee624064c11..7ff1d74a74f 100644 --- a/samples/client/petstore/powershell-experimental/docs/PSPetApi.md +++ b/samples/client/petstore/powershell-experimental/docs/PSPetApi.md @@ -29,7 +29,7 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $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 try { @@ -275,7 +275,7 @@ $Configuration = Get-PSPetstoreConfiguration # Configure OAuth2 access token for authorization: petstore_auth $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 try { diff --git a/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md b/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md index e9156eac609..9979c451667 100644 --- a/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md +++ b/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md @@ -157,7 +157,7 @@ Place an order for a pet ```powershell 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 try { diff --git a/samples/client/petstore/powershell-experimental/docs/PSUserApi.md b/samples/client/petstore/powershell-experimental/docs/PSUserApi.md index a06635fa9a1..f8eb41bc03b 100644 --- a/samples/client/petstore/powershell-experimental/docs/PSUserApi.md +++ b/samples/client/petstore/powershell-experimental/docs/PSUserApi.md @@ -33,7 +33,7 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed #$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 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 #$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 try { diff --git a/samples/client/petstore/powershell-experimental/docs/Pet.md b/samples/client/petstore/powershell-experimental/docs/Pet.md index d8a97fcc46d..ff21eb39d43 100644 --- a/samples/client/petstore/powershell-experimental/docs/Pet.md +++ b/samples/client/petstore/powershell-experimental/docs/Pet.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstorePet -Id null ` +Initialize-PSPetstorePet -Id null ` -Category null ` -Name doggie ` -PhotoUrls null ` diff --git a/samples/client/petstore/powershell-experimental/docs/Tag.md b/samples/client/petstore/powershell-experimental/docs/Tag.md index ffce71eb417..0207dc90690 100644 --- a/samples/client/petstore/powershell-experimental/docs/Tag.md +++ b/samples/client/petstore/powershell-experimental/docs/Tag.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreTag -Id null ` +Initialize-PSPetstoreTag -Id null ` -Name null ``` diff --git a/samples/client/petstore/powershell-experimental/docs/User.md b/samples/client/petstore/powershell-experimental/docs/User.md index e5b6357ede2..4d97541aac4 100644 --- a/samples/client/petstore/powershell-experimental/docs/User.md +++ b/samples/client/petstore/powershell-experimental/docs/User.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes - Prepare the resource ```powershell -Prepare-PSPetstoreUser -Id null ` +Initialize-PSPetstoreUser -Id null ` -Username null ` -FirstName null ` -LastName null ` diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/ApiResponse.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/ApiResponse.ps1 index 3cefe89964e..274ea380357 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/ApiResponse.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/ApiResponse.ps1 @@ -28,7 +28,7 @@ No description available. ApiResponse #> -function Prepare-PSApiResponse { +function Initialize-PSApiResponse { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -43,7 +43,7 @@ function Prepare-PSApiResponse { ) Process { - 'Creating object: PSPetstore => PSApiResponse' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSApiResponse' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Category.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Category.ps1 index 3ce03a0f183..0229faf745a 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Category.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Category.ps1 @@ -25,7 +25,7 @@ No description available. Category #> -function Prepare-PSCategory { +function Initialize-PSCategory { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -37,7 +37,7 @@ function Prepare-PSCategory { ) Process { - 'Creating object: PSPetstore => PSCategory' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSCategory' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject.ps1 index f1d953ceebf..0f652742656 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject.ps1 @@ -25,7 +25,7 @@ Updated status of the pet InlineObject #> -function Prepare-PSInlineObject { +function Initialize-PSInlineObject { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -37,7 +37,7 @@ function Prepare-PSInlineObject { ) Process { - 'Creating object: PSPetstore => PSInlineObject' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSInlineObject' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject1.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject1.ps1 index 989cd24ce7b..61c7c2315a0 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject1.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/InlineObject1.ps1 @@ -25,7 +25,7 @@ file to upload InlineObject1 #> -function Prepare-PSInlineObject1 { +function Initialize-PSInlineObject1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -37,7 +37,7 @@ function Prepare-PSInlineObject1 { ) Process { - 'Creating object: PSPetstore => PSInlineObject1' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSInlineObject1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Order.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Order.ps1 index 3f38a161b44..01712b11284 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Order.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Order.ps1 @@ -37,7 +37,7 @@ No description available. Order #> -function Prepare-PSOrder { +function Initialize-PSOrder { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -61,7 +61,7 @@ function Prepare-PSOrder { ) Process { - 'Creating object: PSPetstore => PSOrder' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSOrder' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Pet.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Pet.ps1 index 4d42c4b120f..801e97cdef0 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Pet.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Pet.ps1 @@ -37,7 +37,7 @@ pet status in the store Pet #> -function Prepare-PSPet { +function Initialize-PSPet { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -61,7 +61,7 @@ function Prepare-PSPet { ) Process { - 'Creating object: PSPetstore => PSPet' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSPet' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Tag.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Tag.ps1 index 7f66f78ebd1..6df4f295b6d 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Tag.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/Tag.ps1 @@ -25,7 +25,7 @@ No description available. Tag #> -function Prepare-PSTag { +function Initialize-PSTag { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -37,7 +37,7 @@ function Prepare-PSTag { ) Process { - 'Creating object: PSPetstore => PSTag' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSTag' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/User.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/User.ps1 index da7c598b097..a0147c19298 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/User.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/Model/User.ps1 @@ -43,7 +43,7 @@ User Status User #> -function Prepare-PSUser { +function Initialize-PSUser { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)] @@ -73,7 +73,7 @@ function Prepare-PSUser { ) Process { - 'Creating object: PSPetstore => PSUser' | Write-Debug + 'Creating PSCustomObject: PSPetstore => PSUser' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/PSPetstore.psd1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/PSPetstore.psd1 index c8dfc5fef0d..687388e9e19 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/PSPetstore.psd1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/PSPetstore.psd1 @@ -75,12 +75,12 @@ FunctionsToExport = 'Add-PSPet', 'Remove-Pet', 'Find-PSPetsByStatus', 'Find-PSPe 'Get-PSOrderById', 'Invoke-PSPlaceOrder', 'New-PSUser', 'New-PSUsersWithArrayInput', 'New-PSUsersWithListInput', 'Remove-PSUser', 'Get-PSUserByName', 'Invoke-PSLoginUser', - 'Invoke-PSLogoutUser', 'Update-PSUser', 'Prepare-PSApiResponse', - 'Prepare-PSCategory', 'Prepare-PSInlineObject', - 'Prepare-PSInlineObject1', 'Prepare-PSOrder', 'Prepare-PSPet', - 'Prepare-PSTag', 'Prepare-PSUser', 'Get-PSConfiguration', - 'Set-PSConfiguration', 'Set-PSConfigurationApiKey', - 'Set-PSConfigurationApiKeyPrefix', + 'Invoke-PSLogoutUser', 'Update-PSUser', 'Initialize-PSApiResponse', + 'Initialize-PSCategory', 'Initialize-PSInlineObject', + 'Initialize-PSInlineObject1', 'Initialize-PSOrder', + 'Initialize-PSPet', 'Initialize-PSTag', 'Initialize-PSUser', + 'Get-PSConfiguration', 'Set-PSConfiguration', + 'Set-PSConfigurationApiKey', 'Set-PSConfigurationApiKeyPrefix', 'Set-PSConfigurationDefaultHeader', 'Get-PSHostSettings', 'Get-PSUrlFromHostSettings' diff --git a/samples/client/petstore/powershell-experimental/tests/Petstore.Tests.ps1 b/samples/client/petstore/powershell-experimental/tests/Petstore.Tests.ps1 index 8ac2cd46f32..310218950db 100644 --- a/samples/client/petstore/powershell-experimental/tests/Petstore.Tests.ps1 +++ b/samples/client/petstore/powershell-experimental/tests/Petstore.Tests.ps1 @@ -11,13 +11,13 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' { $Id = 38369 # Add pet - $Pet = Prepare-PSPet -Id $Id -Name 'PowerShell' -Category ( - Prepare-PSCategory -Id $Id -Name 'PSCategory' + $Pet = Initialize-PSPet -Id $Id -Name 'PowerShell' -Category ( + Initialize-PSCategory -Id $Id -Name 'PSCategory' ) -PhotoUrls @( 'http://example.com/foo', 'http://example.com/bar' ) -Tags ( - Prepare-PSTag -Id $Id -Name 'PSTag' + Initialize-PSTag -Id $Id -Name 'PSTag' ) -Status Available $Result = Add-PSPet -Pet $Pet @@ -36,13 +36,13 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' { $Result."status" | Should Be "Pending" # Update (put) - $NewPet = Prepare-PSPet -Id $Id -Name 'PowerShell2' -Category ( - Prepare-PSCategory -Id $Id -Name 'PSCategory2' + $NewPet = Initialize-PSPet -Id $Id -Name 'PowerShell2' -Category ( + Initialize-PSCategory -Id $Id -Name 'PSCategory2' ) -PhotoUrls @( 'http://example.com/foo2', 'http://example.com/bar2' ) -Tags ( - Prepare-PSTag -Id $Id -Name 'PSTag2' + Initialize-PSTag -Id $Id -Name 'PSTag2' ) -Status Sold $Result = Update-PSPet -Pet $NewPet