Api/V2026DeleteAccountApi.ps1
|
# # Identity Security Cloud v2026 API # Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. # Version: v2026 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS Delete account .DESCRIPTION Initiates an account deletion request for the specified account. This method validates the input data, processes the deletion request, and generates an asynchronous result containing a tracking ID. >**NOTE: You can only delete accounts from sources of the ""Connected"" type. which supports account deletion** .PARAMETER XSailPointExperimental Use this header to enable this experimental API. .PARAMETER AccountId Account ID. .PARAMETER AccountDeleteRequestInput No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS AccountDeleteAsyncResult #> function Remove-V2026AccountRequest { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] $XSailPointExperimental = "true", [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${AccountId}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${AccountDeleteRequestInput}, [Switch] $WithHttpInfo ) Process { 'Calling method: Remove-V2026AccountRequest' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/account-requests/account/{accountId}/delete' if (!$AccountId) { throw "Error! The required parameter `AccountId` missing when calling deleteAccountRequest." } $LocalVarUri = $LocalVarUri.replace('{accountId}', [System.Web.HTTPUtility]::UrlEncode($AccountId)) if (!$XSailPointExperimental) { throw "Error! The required parameter `XSailPointExperimental` missing when calling deleteAccountRequest." } $LocalVarHeaderParameters['X-SailPoint-Experimental'] = $XSailPointExperimental if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($AccountDeleteRequestInput -is [array])) { $LocalVarBodyParameter = $AccountDeleteRequestInput | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $AccountDeleteRequestInput | ForEach-Object { # Get array of names of object properties that can be cast to boolean TRUE # PSObject.Properties - https://msdn.microsoft.com/en-us/library/system.management.automation.psobject.properties.aspx $NonEmptyProperties = $_.psobject.Properties | Where-Object {$null -ne $_.Value} | Select-Object -ExpandProperty Name # Convert object to JSON with only non-empty properties $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json -Depth 100 } } $LocalVarResult = Invoke-V2026ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "AccountDeleteAsyncResult" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } |