Skip to content
Open
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
12 changes: 6 additions & 6 deletions PSSailpoint/Configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function Set-DefaultConfiguration {
If ($BaseUrl) {
# validate URL
$URL = $BaseUrl -as [System.URI]
if (!($null -ne $URL.AbsoluteURI -and $URL.Scheme -match '[http|https]')) {
if (!($null -ne $URL.AbsoluteURI -and $URL.Scheme -match '^https?$')) {
throw "Invalid URL '$($BaseUrl)' cannot be used in the base URL."
}
$Script:Configuration["BaseUrl"] = $BaseUrl
Expand All @@ -172,15 +172,15 @@ function Set-DefaultConfiguration {
$Script:Configuration['ClientSecret'] = $ClientSecret
}

If ($RetryIntervalSeconds) {
If ($PSBoundParameters.ContainsKey('RetryIntervalSeconds')) {
$Script:Configuration['RetryIntervalSeconds'] = $RetryIntervalSeconds
}

If ($MaximumRetryCount) {
If ($PSBoundParameters.ContainsKey('MaximumRetryCount')) {
$Script:Configuration['MaximumRetryCount'] = $MaximumRetryCount
}

If ($Experimental) {
If ($PSBoundParameters.ContainsKey('Experimental')) {
$Script:Configuration['Experimental'] = $Experimental
}

Expand All @@ -189,7 +189,7 @@ function Set-DefaultConfiguration {
throw "Incorrect Proxy type '$($Proxy.GetType().FullName)'. Must be System.Net.WebProxy or System.Net.SystemWebProxy or System.Net.WebRequest+WebProxyWrapperOpaque."
}
$Script:Configuration['Proxy'] = $Proxy
} else {
} elseif ($PSBoundParameters.ContainsKey('Proxy')) {
$Script:Configuration['Proxy'] = $null
}

Expand Down Expand Up @@ -321,5 +321,5 @@ function Get-Config {
return $LocalConfig
}

return $Configuration
return $Script:Configuration
}
6 changes: 4 additions & 2 deletions PSSailpoint/Pagination.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ function Invoke-PaginateSearch {
Param(
[Parameter(Mandatory = $false)]
[ValidateNotNull()]
[ValidateScript({ ($_.sort | Measure-Object).Count -eq 1 },
[ValidateScript({ ($_.sort | Measure-Object).Count -eq 1 },
ErrorMessage = "Error! The required `Search` parameter must include exactly one sort parameter to paginate properly.")]
[PSCustomObject]
$Search,
[Parameter(Mandatory = $false)]
[string]$Function = "Search-Post",
[Int32]$Increment = 250,
[Int32]$Limit = 10000,
[Switch]$WithHttpInfo
Expand All @@ -101,7 +103,7 @@ function Invoke-PaginateSearch {
Write-Debug "SearchAfter=$SearchAfter"
}

$Result = Search-Post -Limit $Increment -Search $Search -WithHttpInfo
$Result = & $Function -Limit $Increment -Search $Search -WithHttpInfo

Write-Debug "Retrieved $(($Result.Response | Measure-Object).Count) Results"

Expand Down
4 changes: 2 additions & 2 deletions PSSailpoint/tests/Validation.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Describe 'V3' {
"identities"
],
"query": {
"query": "*",
"query": "*"
},
"sort": ["-name"]
}
Expand All @@ -46,7 +46,7 @@ Describe 'V3' {

Describe 'Beta' {
It 'Returns results for Get-BetaAccounts' {
$Response = Get-Accounts -WithHttpInfo
$Response = Get-BetaAccounts -WithHttpInfo

$Response.Response | Should -Not -BeNullOrEmpty
$Response.StatusCode | Should -Be 200
Expand Down
4 changes: 1 addition & 3 deletions sdk-resources/postscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ const createDir = async (srcDir, dirName) => {

const moveFiles = async (srcPath, destPath, filename = null) => {
try {
if (!await fs.stat(destPath)) {
await fs.mkdir(destPath, { recursive: true });
}
await fs.mkdir(destPath, { recursive: true });

if (filename) {
const filePath = path.join(srcPath, filename);
Expand Down
2 changes: 1 addition & 1 deletion sdk-resources/resources/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient {
# construct URL query string
$HttpValues = [System.Web.HttpUtility]::ParseQueryString([String]::Empty)
foreach ($Parameter in $QueryParameters.GetEnumerator()) {
if ($Parameter.Value.Count -gt 1) { // array
if ($Parameter.Value.Count -gt 1) { # array
foreach ($Value in $Parameter.Value) {
$HttpValues.Add($Parameter.Key + '[]', $Value)
}
Expand Down
2 changes: 1 addition & 1 deletion sdk-resources/resources/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function Set-{{{apiNamePrefix}}}Configuration {
If ($BaseUrl) {
# validate URL
$URL = $BaseUrl -as [System.URI]
if (!($null -ne $URL.AbsoluteURI -and $URL.Scheme -match '[http|https]')) {
if (!($null -ne $URL.AbsoluteURI -and $URL.Scheme -match '^https?$')) {
throw "Invalid URL '$($BaseUrl)' cannot be used in the base URL."
}
$Script:Configuration["BaseUrl"] = $BaseUrl
Expand Down
2 changes: 1 addition & 1 deletion sdk-resources/resources/model_anyof.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} {
{{/mappedModels}}
{{/discriminator}}
{{#anyOf}}
if ($match -ne 0) { # no match yet
if ($match -eq 0) { # no match yet
# try to match {{{.}}} defined in the anyOf schemas
try {
$matchInstance = ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{.}}} $Json
Expand Down