forked from loafle/openapi-generator-original
[PowerShell][Experimental] Better docstring (#5688)
* add docstring to powershell module * add doc string
This commit is contained in:
parent
63c8f5f965
commit
eac18a779d
@ -594,7 +594,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
|||||||
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
||||||
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
|
||||||
HashMap<String, CodegenModel> modelMaps = new HashMap<String, CodegenModel>();
|
HashMap<String, CodegenModel> modelMaps = new HashMap<String, CodegenModel>();
|
||||||
HashMap<String, Boolean> processedModelMaps = new HashMap<String, Boolean>();
|
HashMap<String, Integer> processedModelMaps = new HashMap<String, Integer>();
|
||||||
|
|
||||||
for (Object o : allModels) {
|
for (Object o : allModels) {
|
||||||
HashMap<String, Object> h = (HashMap<String, Object>) o;
|
HashMap<String, Object> h = (HashMap<String, Object>) o;
|
||||||
@ -672,7 +672,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String constructExampleCode(CodegenParameter codegenParameter, HashMap<String, CodegenModel> modelMaps, HashMap<String, Boolean> processedModelMap) {
|
private String constructExampleCode(CodegenParameter codegenParameter, HashMap<String, CodegenModel> modelMaps, HashMap<String, Integer> processedModelMap) {
|
||||||
if (codegenParameter.isListContainer) { // array
|
if (codegenParameter.isListContainer) { // array
|
||||||
return "@(" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + ")";
|
return "@(" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + ")";
|
||||||
} else if (codegenParameter.isMapContainer) { // TODO: map, file type
|
} else if (codegenParameter.isMapContainer) { // TODO: map, file type
|
||||||
@ -714,7 +714,7 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String constructExampleCode(CodegenProperty codegenProperty, HashMap<String, CodegenModel> modelMaps, HashMap<String, Boolean> processedModelMap) {
|
private String constructExampleCode(CodegenProperty codegenProperty, HashMap<String, CodegenModel> modelMaps, HashMap<String, Integer> processedModelMap) {
|
||||||
if (codegenProperty.isListContainer) { // array
|
if (codegenProperty.isListContainer) { // array
|
||||||
return "@(" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + ")";
|
return "@(" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + ")";
|
||||||
} else if (codegenProperty.isMapContainer) { // map
|
} else if (codegenProperty.isMapContainer) { // map
|
||||||
@ -756,15 +756,23 @@ public class PowerShellExperimentalClientCodegen extends DefaultCodegen implemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String constructExampleCode(CodegenModel codegenModel, HashMap<String, CodegenModel> modelMaps, HashMap<String, Boolean> processedModelMap) {
|
private String constructExampleCode(CodegenModel codegenModel, HashMap<String, CodegenModel> modelMaps, HashMap<String, Integer> processedModelMap) {
|
||||||
String example;
|
String example;
|
||||||
|
|
||||||
// break infinite recursion. Return, in case a model is already processed in the current context.
|
// break infinite recursion. Return, in case a model is already processed in the current context.
|
||||||
String model = codegenModel.name;
|
String model = codegenModel.name;
|
||||||
if (processedModelMap.containsKey(model)) {
|
if (processedModelMap.containsKey(model)) {
|
||||||
|
int count = processedModelMap.get(model);
|
||||||
|
if (count == 1) {
|
||||||
|
processedModelMap.put(model, 2);
|
||||||
|
} else if (count == 2) {
|
||||||
return "";
|
return "";
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("Invalid count when constructing example: " + count);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
processedModelMap.put(model, 1);
|
||||||
}
|
}
|
||||||
processedModelMap.put(model, true);
|
|
||||||
|
|
||||||
example = "(New-" + codegenModel.name;
|
example = "(New-" + codegenModel.name;
|
||||||
List<String> propertyExamples = new ArrayList<>();
|
List<String> propertyExamples = new ArrayList<>();
|
||||||
|
@ -1,6 +1,24 @@
|
|||||||
{{> partial_header}}
|
{{> partial_header}}
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
{{#summary}}{{{.}}}{{/summary}}{{^summary}}No summary available.{{/summary}}
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
|
||||||
|
|
||||||
|
{{#allParams}}
|
||||||
|
.PARAMETER {{{paramName}}}
|
||||||
|
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
|
||||||
|
|
||||||
|
{{/allParams}}
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}None{{/returnType}}
|
||||||
|
#>
|
||||||
function {{{vendorExtensions.x-powershell-method-name}}} {
|
function {{{vendorExtensions.x-powershell-method-name}}} {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -1,4 +1,17 @@
|
|||||||
{{> partial_header}}
|
{{> partial_header}}
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Get the configuration object '{{apiNamePrefix}}Configuration'.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Get the configuration object '{{apiNamePrefix}}Configuration'.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
System.Collections.Hashtable
|
||||||
|
#>
|
||||||
function Get-{{apiNamePrefix}}Configuration {
|
function Get-{{apiNamePrefix}}Configuration {
|
||||||
|
|
||||||
$Configuration = $Script:Configuration
|
$Configuration = $Script:Configuration
|
||||||
@ -36,6 +49,43 @@ function Get-{{apiNamePrefix}}Configuration {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Set the configuration.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Set the configuration.
|
||||||
|
|
||||||
|
.PARAMETER BaseUrl
|
||||||
|
Base URL of the HTTP endpoints
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
Username in HTTP basic authentication
|
||||||
|
|
||||||
|
.PARAMETER Passowrd
|
||||||
|
Password in HTTP basic authentication
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
API Keys for authentication/authorization
|
||||||
|
|
||||||
|
.PARAMETER ApiKeyPrefix
|
||||||
|
Prefix in the API Keys
|
||||||
|
|
||||||
|
.PARAMETER Cookie
|
||||||
|
Cookie for authentication/authorization
|
||||||
|
|
||||||
|
.PARAMETER AccessToken
|
||||||
|
Access token for authentication/authorization
|
||||||
|
|
||||||
|
.PARAMETER SkipCertificateCheck
|
||||||
|
Skip certificate verification
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
System.Collections.Hashtable
|
||||||
|
#>
|
||||||
function Set-{{{apiNamePrefix}}}Configuration {
|
function Set-{{{apiNamePrefix}}}Configuration {
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
@ -92,6 +142,25 @@ function Set-{{{apiNamePrefix}}}Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Set the API Key.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Set the API Key.
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
ID of the security schema
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
API Key
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Set-{{{apiNamePrefix}}}ConfigurationApiKey {
|
function Set-{{{apiNamePrefix}}}ConfigurationApiKey {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param(
|
Param(
|
||||||
@ -107,6 +176,25 @@ function Set-{{{apiNamePrefix}}}ConfigurationApiKey {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Set the API Key prefix.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Set the API Key prefix.
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
ID of the security schema
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
API Key prefix
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Set-{{{apiNamePrefix}}}ConfigurationApiKeyPrefix {
|
function Set-{{{apiNamePrefix}}}ConfigurationApiKeyPrefix {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param(
|
Param(
|
||||||
|
@ -1,6 +1,25 @@
|
|||||||
{{> partial_header}}
|
{{> partial_header}}
|
||||||
{{#models}}
|
{{#models}}
|
||||||
{{#model}}
|
{{#model}}
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
{{#summary}}{{{.}}}{{/summary}}{{^summary}}No summary available.{{/summary}}
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
|
||||||
|
|
||||||
|
{{#vars}}
|
||||||
|
.PARAMETER {{{name}}}
|
||||||
|
{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}}
|
||||||
|
|
||||||
|
{{/vars}}
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
{{{classname}}}<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-{{{apiNamePrefix}}}{{{classname}}} {
|
function New-{{{apiNamePrefix}}}{{{classname}}} {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -131,7 +131,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 = @((New-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 = @() # User[] | List of user object
|
||||||
|
|
||||||
# Creates list of users with given input array
|
# Creates list of users with given input array
|
||||||
try {
|
try {
|
||||||
@ -368,7 +368,7 @@ $Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY"
|
|||||||
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer"
|
||||||
|
|
||||||
$Username = "Username_example" # String | name that need to be deleted (default to null)
|
$Username = "Username_example" # String | name that need to be deleted (default to null)
|
||||||
$User = (New-User -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Updated user object
|
$User = # User | Updated user object
|
||||||
|
|
||||||
# Updated user
|
# Updated user
|
||||||
try {
|
try {
|
||||||
|
@ -5,6 +5,22 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Pet
|
||||||
|
Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Pet
|
||||||
|
#>
|
||||||
function Add-PSPet {
|
function Add-PSPet {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -57,6 +73,25 @@ function Add-PSPet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Deletes a pet
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER PetId
|
||||||
|
Pet id to delete
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Remove-Pet {
|
function Remove-Pet {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -108,6 +143,22 @@ function Remove-Pet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Finds Pets by status
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Status
|
||||||
|
Status values that need to be considered for filter
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Pet[]
|
||||||
|
#>
|
||||||
function Find-PSPetsByStatus {
|
function Find-PSPetsByStatus {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -156,6 +207,22 @@ function Find-PSPetsByStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Finds Pets by tags
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Tags
|
||||||
|
Tags to filter by
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Pet[]
|
||||||
|
#>
|
||||||
function Find-PSPetsByTags {
|
function Find-PSPetsByTags {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -204,6 +271,22 @@ function Find-PSPetsByTags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Find pet by ID
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER PetId
|
||||||
|
ID of pet to return
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Pet
|
||||||
|
#>
|
||||||
function Get-PSPetById {
|
function Get-PSPetById {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -254,6 +337,22 @@ function Get-PSPetById {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Update an existing pet
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Pet
|
||||||
|
Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Pet
|
||||||
|
#>
|
||||||
function Update-PSPet {
|
function Update-PSPet {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -306,6 +405,28 @@ function Update-PSPet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Updates a pet in the store with form data
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER PetId
|
||||||
|
ID of pet that needs to be updated
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
Updated name of the pet
|
||||||
|
|
||||||
|
.PARAMETER Status
|
||||||
|
Updated status of the pet
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Update-PSPetWithForm {
|
function Update-PSPetWithForm {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -367,6 +488,28 @@ function Update-PSPetWithForm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
uploads an image
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER PetId
|
||||||
|
ID of pet to update
|
||||||
|
|
||||||
|
.PARAMETER AdditionalMetadata
|
||||||
|
Additional data to pass to server
|
||||||
|
|
||||||
|
.PARAMETER File
|
||||||
|
file to upload
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
ApiResponse
|
||||||
|
#>
|
||||||
function Invoke-PSUploadFile {
|
function Invoke-PSUploadFile {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,22 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Delete purchase order by ID
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER OrderId
|
||||||
|
ID of the order that needs to be deleted
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Invoke-PSDeleteOrder {
|
function Invoke-PSDeleteOrder {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -48,6 +64,19 @@ function Invoke-PSDeleteOrder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Returns pet inventories by status
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Hashtable
|
||||||
|
#>
|
||||||
function Get-PSInventory {
|
function Get-PSInventory {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -91,6 +120,22 @@ function Get-PSInventory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Find purchase order by ID
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER OrderId
|
||||||
|
ID of pet that needs to be fetched
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Order
|
||||||
|
#>
|
||||||
function Get-PSOrderById {
|
function Get-PSOrderById {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -137,6 +182,22 @@ function Get-PSOrderById {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Place an order for a pet
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Order
|
||||||
|
order placed for purchasing the pet
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Order
|
||||||
|
#>
|
||||||
function Invoke-PSPlaceOrder {
|
function Invoke-PSPlaceOrder {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,22 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Create user
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER User
|
||||||
|
Created user object
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Invoke-PSCreateUser {
|
function Invoke-PSCreateUser {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -57,6 +73,22 @@ function Invoke-PSCreateUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER User
|
||||||
|
List of user object
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Invoke-PSCreateUsersWithArrayInput {
|
function Invoke-PSCreateUsersWithArrayInput {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -109,6 +141,22 @@ function Invoke-PSCreateUsersWithArrayInput {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Creates list of users with given input array
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER User
|
||||||
|
List of user object
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Invoke-PSCreateUsersWithListInput {
|
function Invoke-PSCreateUsersWithListInput {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -161,6 +209,22 @@ function Invoke-PSCreateUsersWithListInput {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Delete user
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
The name that needs to be deleted
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Invoke-PSDeleteUser {
|
function Invoke-PSDeleteUser {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -208,6 +272,22 @@ function Invoke-PSDeleteUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Get user by user name
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
User
|
||||||
|
#>
|
||||||
function Get-PSUserByName {
|
function Get-PSUserByName {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -254,6 +334,25 @@ function Get-PSUserByName {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Logs user into the system
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
The user name for login
|
||||||
|
|
||||||
|
.PARAMETER Password
|
||||||
|
The password for login in clear text
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
String
|
||||||
|
#>
|
||||||
function Invoke-PSLoginUser {
|
function Invoke-PSLoginUser {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -309,6 +408,19 @@ function Invoke-PSLoginUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Logs out current logged in user session
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Invoke-PSLogoutUser {
|
function Invoke-PSLogoutUser {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
@ -349,6 +461,25 @@ function Invoke-PSLogoutUser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
name that need to be deleted
|
||||||
|
|
||||||
|
.PARAMETER User
|
||||||
|
Updated user object
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Update-PSUser {
|
function Update-PSUser {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,19 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Get the configuration object 'PSConfiguration'.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Get the configuration object 'PSConfiguration'.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
System.Collections.Hashtable
|
||||||
|
#>
|
||||||
function Get-PSConfiguration {
|
function Get-PSConfiguration {
|
||||||
|
|
||||||
$Configuration = $Script:Configuration
|
$Configuration = $Script:Configuration
|
||||||
@ -34,10 +47,51 @@ function Get-PSConfiguration {
|
|||||||
$Configuration["ApiKeyPrefix"] = @{}
|
$Configuration["ApiKeyPrefix"] = @{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$Configuration.containsKey("SkipCertificateCheck")) {
|
||||||
|
$Configuration["SkipCertificateCheck"] = $false
|
||||||
|
}
|
||||||
|
|
||||||
Return $Configuration
|
Return $Configuration
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Set the configuration.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Set the configuration.
|
||||||
|
|
||||||
|
.PARAMETER BaseUrl
|
||||||
|
Base URL of the HTTP endpoints
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
Username in HTTP basic authentication
|
||||||
|
|
||||||
|
.PARAMETER Passowrd
|
||||||
|
Password in HTTP basic authentication
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
API Keys for authentication/authorization
|
||||||
|
|
||||||
|
.PARAMETER ApiKeyPrefix
|
||||||
|
Prefix in the API Keys
|
||||||
|
|
||||||
|
.PARAMETER Cookie
|
||||||
|
Cookie for authentication/authorization
|
||||||
|
|
||||||
|
.PARAMETER AccessToken
|
||||||
|
Access token for authentication/authorization
|
||||||
|
|
||||||
|
.PARAMETER SkipCertificateCheck
|
||||||
|
Skip certificate verification
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
System.Collections.Hashtable
|
||||||
|
#>
|
||||||
function Set-PSConfiguration {
|
function Set-PSConfiguration {
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
@ -54,6 +108,7 @@ function Set-PSConfiguration {
|
|||||||
[AllowEmptyString()]
|
[AllowEmptyString()]
|
||||||
[string]$AccessToken,
|
[string]$AccessToken,
|
||||||
[switch]$PassThru,
|
[switch]$PassThru,
|
||||||
|
[bool]$SkipCertificateCheck,
|
||||||
[switch]$Force
|
[switch]$Force
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -86,9 +141,32 @@ function Set-PSConfiguration {
|
|||||||
If ($AccessToken) {
|
If ($AccessToken) {
|
||||||
$Script:Configuration['AccessToken'] = $AccessToken
|
$Script:Configuration['AccessToken'] = $AccessToken
|
||||||
}
|
}
|
||||||
|
|
||||||
|
If ($SkipCertificateCheck) {
|
||||||
|
$Script:Configuration['SkipCertificateCheck'] = $SkipCertificateCheck
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Set the API Key.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Set the API Key.
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
ID of the security schema
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
API Key
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Set-PSConfigurationApiKey {
|
function Set-PSConfigurationApiKey {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param(
|
Param(
|
||||||
@ -104,6 +182,25 @@ function Set-PSConfigurationApiKey {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Set the API Key prefix.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Set the API Key prefix.
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
ID of the security schema
|
||||||
|
|
||||||
|
.PARAMETER ApiKey
|
||||||
|
API Key prefix
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
None
|
||||||
|
#>
|
||||||
function Set-PSConfigurationApiKeyPrefix {
|
function Set-PSConfigurationApiKeyPrefix {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param(
|
Param(
|
||||||
|
@ -5,6 +5,29 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
Describes the result of uploading an image resource
|
||||||
|
|
||||||
|
.PARAMETER Code
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Type
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Message
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
ApiResponse<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSApiResponse {
|
function New-PSApiResponse {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,26 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
A category for a pet
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Category<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSCategory {
|
function New-PSCategory {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,26 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
Updated name of the pet
|
||||||
|
|
||||||
|
.PARAMETER Status
|
||||||
|
Updated status of the pet
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
InlineObject<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSInlineObject {
|
function New-PSInlineObject {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,26 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER AdditionalMetadata
|
||||||
|
Additional data to pass to server
|
||||||
|
|
||||||
|
.PARAMETER File
|
||||||
|
file to upload
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
InlineObject1<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSInlineObject1 {
|
function New-PSInlineObject1 {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,38 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
An order for a pets from the pet store
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER PetId
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Quantity
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER ShipDate
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Status
|
||||||
|
Order Status
|
||||||
|
|
||||||
|
.PARAMETER Complete
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Order<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSOrder {
|
function New-PSOrder {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,38 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
A pet for sale in the pet store
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Category
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER PhotoUrls
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Tags
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Status
|
||||||
|
pet status in the store
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Pet<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSPet {
|
function New-PSPet {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,26 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
A tag for a pet
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Name
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
Tag<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSTag {
|
function New-PSTag {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -5,6 +5,44 @@
|
|||||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
#
|
#
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
No summary available.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
|
||||||
|
A User who is purchasing from the pet store
|
||||||
|
|
||||||
|
.PARAMETER Id
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Username
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER FirstName
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER LastName
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Email
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Password
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER Phone
|
||||||
|
No description available.
|
||||||
|
|
||||||
|
.PARAMETER UserStatus
|
||||||
|
User Status
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
|
||||||
|
User<PSCustomObject>
|
||||||
|
#>
|
||||||
|
|
||||||
function New-PSUser {
|
function New-PSUser {
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
Param (
|
Param (
|
||||||
|
@ -40,14 +40,17 @@ function Invoke-PSApiClient {
|
|||||||
|
|
||||||
$Configuration = Get-PSConfiguration
|
$Configuration = Get-PSConfiguration
|
||||||
$RequestUri = $Configuration["BaseUrl"] + $Uri
|
$RequestUri = $Configuration["BaseUrl"] + $Uri
|
||||||
|
$SkipCertificateCheck = $Configuration["SkipCertificateCheck"]
|
||||||
|
|
||||||
# cookie parameters
|
# cookie parameters
|
||||||
foreach ($Parameter in $CookieParameters) {
|
foreach ($Parameter in $CookieParameters.GetEnumerator()) {
|
||||||
if ($CookieParameters[$Parameter]) {
|
if ($Parameter.Name -eq "cookieAuth") {
|
||||||
$HeaderParameters["Cookie"] = $CookieParameters[$Parameter]
|
$HeaderParameters["Cookie"] = $Parameter.Value
|
||||||
|
} else {
|
||||||
|
$HeaderParameters[$Parameter.Name] = $Parameter.Value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($CookieParametters -and $CookieParameters.Count -gt 1) {
|
if ($CookieParameters -and $CookieParameters.Count -gt 1) {
|
||||||
Write-Warning "Multipe cookie parameters found. Curently only the first one is supported/used"
|
Write-Warning "Multipe cookie parameters found. Curently only the first one is supported/used"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,11 +89,21 @@ function Invoke-PSApiClient {
|
|||||||
$RequestBody = $Body
|
$RequestBody = $Body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($SkipCertificateCheck -eq $true) {
|
||||||
|
$Response = Invoke-WebRequest -Uri $UriBuilder.Uri `
|
||||||
|
-Method $Method `
|
||||||
|
-Headers $HeaderParameters `
|
||||||
|
-Body $RequestBody `
|
||||||
|
-ErrorAction Stop `
|
||||||
|
-SkipCertificateCheck
|
||||||
|
|
||||||
|
} else {
|
||||||
$Response = Invoke-WebRequest -Uri $UriBuilder.Uri `
|
$Response = Invoke-WebRequest -Uri $UriBuilder.Uri `
|
||||||
-Method $Method `
|
-Method $Method `
|
||||||
-Headers $HeaderParameters `
|
-Headers $HeaderParameters `
|
||||||
-Body $RequestBody `
|
-Body $RequestBody `
|
||||||
-ErrorAction Stop
|
-ErrorAction Stop
|
||||||
|
}
|
||||||
|
|
||||||
return @{
|
return @{
|
||||||
Response = DeserializeResponse -Response $Response -ReturnType $ReturnType
|
Response = DeserializeResponse -Response $Response -ReturnType $ReturnType
|
||||||
|
Loading…
x
Reference in New Issue
Block a user