Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,20 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
{{/bodyParam}}
{{#authMethods}}
{{#isApiKey}}
if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["{{{keyParamName}}}"]) {
$apiKeyPrefix = $Configuration["ApiKeyPrefix"]["{{{keyParamName}}}"]
} else {
$apiKeyPrefix = ""
}
{{#isKeyInHeader}}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) {
$LocalVarHeaderParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"]
$LocalVarHeaderParameters['{{{keyParamName}}}'] = $apiKeyPrefix + $Configuration["ApiKey"]["{{{keyParamName}}}"]
Write-Verbose ("Using API key '{{{keyParamName}}}' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
}
{{/isKeyInHeader}}
{{#isKeyInQuery}}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["{{{keyParamName}}}"]) {
$LocalVarQueryParameters['{{{keyParamName}}}'] = $Configuration["ApiKey"]["{{{keyParamName}}}"]
$LocalVarQueryParameters['{{{keyParamName}}}'] = $apiKeyPrefix + $Configuration["ApiKey"]["{{{keyParamName}}}"]
Write-Verbose ("Using API key `{{{keyParamName}}}` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
}
{{/isKeyInQuery}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ function Test-PSClassname {

$LocalVarBodyParameter = $Client | ConvertTo-Json -Depth 100

if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["api_key_query_name"]) {
$apiKeyPrefix = $Configuration["ApiKeyPrefix"]["api_key_query_name"]
} else {
$apiKeyPrefix = ""
}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_query_name"]) {
$LocalVarQueryParameters['api_key_query_name'] = $Configuration["ApiKey"]["api_key_query_name"]
$LocalVarQueryParameters['api_key_query_name'] = $apiKeyPrefix + $Configuration["ApiKey"]["api_key_query_name"]
Write-Verbose ("Using API key `api_key_query_name` in the URL query for authentication in {0}" -f $MyInvocation.MyCommand)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,13 @@ function Get-PSPetById {
}
$LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId))

if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["api_key_name"]) {
$apiKeyPrefix = $Configuration["ApiKeyPrefix"]["api_key_name"]
} else {
$apiKeyPrefix = ""
}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_name"]) {
$LocalVarHeaderParameters['api_key_name'] = $Configuration["ApiKey"]["api_key_name"]
$LocalVarHeaderParameters['api_key_name'] = $apiKeyPrefix + $Configuration["ApiKey"]["api_key_name"]
Write-Verbose ("Using API key 'api_key_name' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ function Get-PSInventory {

$LocalVarUri = '/store/inventory'

if ($Configuration["ApiKeyPrefix"] -and $Configuration["ApiKeyPrefix"]["api_key_name"]) {
$apiKeyPrefix = $Configuration["ApiKeyPrefix"]["api_key_name"]
} else {
$apiKeyPrefix = ""
}
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key_name"]) {
$LocalVarHeaderParameters['api_key_name'] = $Configuration["ApiKey"]["api_key_name"]
$LocalVarHeaderParameters['api_key_name'] = $apiKeyPrefix + $Configuration["ApiKey"]["api_key_name"]
Write-Verbose ("Using API key 'api_key_name' in the header for authentication in {0}" -f $MyInvocation.MyCommand)
}

Expand Down