forked from loafle/openapi-generator-original
use Initialize instead of prepare (#5777)
This commit is contained in:
parent
24513091b0
commit
f58ebf65d1
@ -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<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`.
|
||||
*/
|
||||
@ -804,10 +803,10 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
||||
processedModelMap.put(model, 1);
|
||||
}
|
||||
|
||||
example = "(Prepare-" + codegenModel.name;
|
||||
example = "(Initialize-" + codegenModel.name;
|
||||
List<String> 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";
|
||||
}
|
||||
|
@ -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}}}*
|
||||
|
@ -20,7 +20,7 @@
|
||||
{{{classname}}}<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -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}}
|
||||
|
||||
|
@ -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*
|
||||
|
@ -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
|
||||
|
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
|
||||
- Prepare the resource
|
||||
```powershell
|
||||
Prepare-PSPetstoreApiResponse -Code null `
|
||||
Initialize-PSPetstoreApiResponse -Code null `
|
||||
-Type null `
|
||||
-Message null
|
||||
```
|
||||
|
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
|
||||
- Prepare the resource
|
||||
```powershell
|
||||
Prepare-PSPetstoreCategory -Id null `
|
||||
Initialize-PSPetstoreCategory -Id null `
|
||||
-Name null
|
||||
```
|
||||
|
||||
|
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
|
||||
- Prepare the resource
|
||||
```powershell
|
||||
Prepare-PSPetstoreInlineObject -Name null `
|
||||
Initialize-PSPetstoreInlineObject -Name null `
|
||||
-Status null
|
||||
```
|
||||
|
||||
|
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
|
||||
- Prepare the resource
|
||||
```powershell
|
||||
Prepare-PSPetstoreInlineObject1 -AdditionalMetadata null `
|
||||
Initialize-PSPetstoreInlineObject1 -AdditionalMetadata null `
|
||||
-File null
|
||||
```
|
||||
|
||||
|
@ -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 `
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 `
|
||||
|
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
|
||||
- Prepare the resource
|
||||
```powershell
|
||||
Prepare-PSPetstoreTag -Id null `
|
||||
Initialize-PSPetstoreTag -Id null `
|
||||
-Name null
|
||||
```
|
||||
|
||||
|
@ -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 `
|
||||
|
@ -28,7 +28,7 @@ No description available.
|
||||
ApiResponse<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -25,7 +25,7 @@ No description available.
|
||||
Category<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -25,7 +25,7 @@ Updated status of the pet
|
||||
InlineObject<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -25,7 +25,7 @@ file to upload
|
||||
InlineObject1<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -37,7 +37,7 @@ No description available.
|
||||
Order<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -37,7 +37,7 @@ pet status in the store
|
||||
Pet<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -25,7 +25,7 @@ No description available.
|
||||
Tag<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -43,7 +43,7 @@ User Status
|
||||
User<PSCustomObject>
|
||||
#>
|
||||
|
||||
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]@{
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user