Api/ApprovalsApi.ps1
|
# # Identity Security Cloud API - Approvals # 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: v1 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS Post Bulk Approve Approvals .DESCRIPTION Bulk Approves specified approval requests on behalf of the caller .PARAMETER Bulkapproverequestdto 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 SystemCollectionsHashtable #> function Approve-ApprovalInBulkV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Bulkapproverequestdto}, [Switch] $WithHttpInfo ) Process { 'Calling method: Approve-ApprovalInBulkV1' | 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 = '/generic-approvals/v1/bulk-approve' if (!$Bulkapproverequestdto) { throw "Error! The required parameter `Bulkapproverequestdto` missing when calling approveApprovalInBulkV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Bulkapproverequestdto -is [array])) { $LocalVarBodyParameter = $Bulkapproverequestdto | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Bulkapproverequestdto | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "SystemCollectionsHashtable" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Approvals Approve .DESCRIPTION Approves a specified approval request on behalf of the caller. The approval request must be in a state that allows it to be approved. This endpoint does not support access request IDs. If called by an admin and the admin is not listed as an approver, the approval request will be reassigned from a random approver to the admin user. .PARAMETER Id Approval ID that correlates to an existing approval request that a user wants to approve. .PARAMETER Approvalapproverequest 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 Approval2 #> function Approve-ApprovalV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalapproverequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Approve-ApprovalV1' | 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 = '/generic-approvals/v1/{id}/approve' if (!$Id) { throw "Error! The required parameter `Id` missing when calling approveApprovalV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalapproverequest -is [array])) { $LocalVarBodyParameter = $Approvalapproverequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalapproverequest | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approval2" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Approval Cancel .DESCRIPTION Cancels a specified approval requests on behalf of the caller. Note: This endpoint does not support access request IDs. To cancel access request approvals, please use the following: /access-requests/cancel .PARAMETER Id ID of the approval request to cancel. .PARAMETER Approvalcancelrequest 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 None #> function Suspend-ApprovalByIdV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalcancelrequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Suspend-ApprovalByIdV1' | 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 = '/generic-approvals/v1/{id}/cancel' if (!$Id) { throw "Error! The required parameter `Id` missing when calling cancelApprovalByIdV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalcancelrequest -is [array])) { $LocalVarBodyParameter = $Approvalcancelrequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalcancelrequest | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Bulk Cancel Approvals .DESCRIPTION Bulk cancels specified approval requests on behalf of the caller. Note: To bulk cancel access request approvals, please use the following: /access-requests/bulk-cancel .PARAMETER Bulkcancelrequestdto 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 SystemCollectionsHashtable #> function Suspend-ApprovalV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Bulkcancelrequestdto}, [Switch] $WithHttpInfo ) Process { 'Calling method: Suspend-ApprovalV1' | 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 = '/generic-approvals/v1/bulk-cancel' if (!$Bulkcancelrequestdto) { throw "Error! The required parameter `Bulkcancelrequestdto` missing when calling cancelApprovalV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Bulkcancelrequestdto -is [array])) { $LocalVarBodyParameter = $Bulkcancelrequestdto | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Bulkcancelrequestdto | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "SystemCollectionsHashtable" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Delete Approval Configuration .DESCRIPTION Deletes an approval configuration. Configurations at the APPROVAL_REQUEST scope cannot be deleted. .PARAMETER Id The ID defined by the scope field, where [[id]]:[[scope]] is the following [[roleID]]:ROLE [[entitlementID]]:ENTITLEMENT [[accessProfileID]]:ACCESS_PROFILE ENTITLEMENT_DESCRIPTIONS:APPROVAL_TYPE ACCESS_REQUEST_APPROVAL:APPROVAL_TYPE ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE [[tenantID]]:TENANT [[domainObjectID]]:DOMAIN_OBJECT .PARAMETER Scope The scope of the field, where [[id]]:[[scope]] is the following [[roleID]]:ROLE [[entitlementID]]:ENTITLEMENT [[accessProfileID]]:ACCESS_PROFILE ENTITLEMENT_DESCRIPTIONS:APPROVAL_TYPE ACCESS_REQUEST_APPROVAL:APPROVAL_TYPE ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE [[tenantID]]:TENANT [[domainObjectID]]:DOMAIN_OBJECT .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS None #> function Remove-ApprovalConfigRequestV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [ValidateSet("DOMAIN_OBJECT", "ROLE", "ACCESS_PROFILE", "ENTITLEMENT", "APPROVAL_TYPE", "TENANT")] [String] ${Scope}, [Switch] $WithHttpInfo ) Process { 'Calling method: Remove-ApprovalConfigRequestV1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/generic-approvals/v1/config/{id}/{scope}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling deleteApprovalConfigRequestV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$Scope) { throw "Error! The required parameter `Scope` missing when calling deleteApprovalConfigRequestV1." } $LocalVarUri = $LocalVarUri.replace('{scope}', [System.Web.HTTPUtility]::UrlEncode($Scope)) $LocalVarResult = Invoke-ApiClient -Method 'DELETE' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Get an approval .DESCRIPTION Fetches an approval request by it's approval ID. For lookups by access request ID please use the following: /generic-approvals?filters=referenceType+eq+""accessRequestId""+and+referenceId+eq+""12345678901234567890123456789012"" .PARAMETER Id ID of the approval that is to be returned .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Approval2 #> function Get-ApprovalV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-ApprovalV1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/generic-approvals/v1/{id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling getApprovalV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) $LocalVarResult = Invoke-ApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approval2" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Get Approval Config .DESCRIPTION Retrieves a singular approval configuration that matches the given ID .PARAMETER Id The id of the object the config applies to, for example one of the following: [(approvalID), (roleID), (entitlementID), (accessProfileID), ""ENTITLEMENT_DESCRIPTIONS"", ""ACCESS_REQUEST_APPROVAL"", ""ACCOUNT_CREATE_APPROVAL_REQUEST"", ""ACCOUNT_DELETE_APPROVAL_REQUEST"", ""MACHINE_ACCOUNT_CREATE_APPROVAL_REQUEST"", ""MACHINE_ACCOUNT_DELETE_APPROVAL_REQUEST"", (tenantID)] .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Approvalconfig #> function Get-ApprovalsConfigV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-ApprovalsConfigV1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/generic-approvals/v1/config/{id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling getApprovalsConfigV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) $LocalVarResult = Invoke-ApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approvalconfig" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Get approvals .DESCRIPTION Gets a list of approvals. One of the following query parameters should be present: 'mine', 'approverId', 'requesterId', 'requesteeId'. The absence of all query parameters for non admins will default to mine=true (which is the equivalent of 'approverId=[your_identity_id]') while admins will default to mine=false (which will show all approvals in the org). For lookups by access request ID please use the following: '/generic-approvals?mine=false&filters=referenceType+eq+""accessRequestId""+and+referenceId+eq+""12345678901234567890123456789012""' .PARAMETER Mine Determines whether to return the list of approvals assigned to the current caller or all approvals in the org. Defaults to false if admin, true otherwise (which is the equivalent of 'approverId=[your_identity_id]'). .PARAMETER RequesterId Returns the list of approvals for a given requester ID. Must match the calling user's identity ID unless they are an admin. .PARAMETER RequesteeId Returns the list of approvals for a given requesteeId ID. Must match the calling user's identity ID unless they are an admin. .PARAMETER ApproverId Returns the list of approvals for a given approverId ID. Must match the calling user's identity ID unless they are an admin. .PARAMETER Count Adds X-Total-Count to the header to give the amount of total approvals returned from the query. .PARAMETER CountOnly Adds X-Total-Count to the header to give the amount of total approvals returned from the query. Only returns the count and no approval objects. .PARAMETER IncludeComments If set to true in the query, the approval requests returned will include comments. .PARAMETER IncludeApprovers If set to true in the query, the approval requests returned will include approvers. .PARAMETER IncludeReassignmentHistory If set to true in the query, the approval requests returned will include reassignment history. .PARAMETER IncludeBatchInfo If set to true in the query, the approval requests returned will include batch information. .PARAMETER Filters Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **status**: *eq, ne, in, co, sw* **name**: *eq, ne, in, co, sw* **priority**: *eq, ne, in, co, sw* **type**: *eq, ne, in, co, sw* **medium**: *eq, ne, in, co, sw* **description**: *eq, ne, in, co, sw* **batchId**: *eq, ne, in, co, sw* **createdDate**: *eq, ne, in, co, sw, gt, ge, lt, le* **dueDate**: *eq, ne, in, co, sw, gt, ge, lt, le* **completedDate**: *eq, ne, in, co, sw, gt, ge, lt, le* **search**: *eq, ne, in, co, sw* **referenceId**: *eq, ne, in, co, sw* **referenceType**: *eq, ne, in, co, sw* **referenceName**: *eq, ne, in, co, sw* **requestedTargetId**: *eq, ne, in, co, sw* **requestedTargetType**: *eq, ne, in, co, sw* **requestedTargetName**: *eq, ne, in, co, sw* **requestedTargetRequestType**: *eq, ne, in, co, sw* **modifiedDate**: *eq, ne, in, co, sw, gt, ge, lt, le* **decisionDate**: *eq, ne, in, co, sw, gt, ge, lt, le* **approvalId**: *eq, ne, in, co, sw* **requesterId**: *eq, ne, in, co, sw* **requesteeId**: *eq, ne, in, co, sw* **approverId**: *eq, ne, in, co, sw* .PARAMETER Limit Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. .PARAMETER Offset Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Approval2[] #> function Get-ApprovalsV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${Mine}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${RequesterId}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${RequesteeId}, [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${ApproverId}, [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${Count}, [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${CountOnly}, [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${IncludeComments}, [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${IncludeApprovers}, [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${IncludeReassignmentHistory}, [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${IncludeBatchInfo}, [Parameter(Position = 10, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Filters}, [Parameter(Position = 11, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Int32]] ${Limit}, [Parameter(Position = 12, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Int32]] ${Offset}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-ApprovalsV1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/generic-approvals/v1' if ($Mine) { $LocalVarQueryParameters['mine'] = $Mine } if ($RequesterId) { $LocalVarQueryParameters['requesterId'] = $RequesterId } if ($RequesteeId) { $LocalVarQueryParameters['requesteeId'] = $RequesteeId } if ($ApproverId) { $LocalVarQueryParameters['approverId'] = $ApproverId } if ($Count) { $LocalVarQueryParameters['count'] = $Count } if ($CountOnly) { $LocalVarQueryParameters['count-only'] = $CountOnly } if ($IncludeComments) { $LocalVarQueryParameters['include-comments'] = $IncludeComments } if ($IncludeApprovers) { $LocalVarQueryParameters['include-approvers'] = $IncludeApprovers } if ($IncludeReassignmentHistory) { $LocalVarQueryParameters['include-reassignment-history'] = $IncludeReassignmentHistory } if ($IncludeBatchInfo) { $LocalVarQueryParameters['include-batch-info'] = $IncludeBatchInfo } if ($Filters) { $LocalVarQueryParameters['filters'] = $Filters } if ($Limit) { $LocalVarQueryParameters['limit'] = $Limit } if ($Offset) { $LocalVarQueryParameters['offset'] = $Offset } $LocalVarResult = Invoke-ApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approval2[]" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Bulk Reassign Approvals .DESCRIPTION Bulk reassigns specified approval requests on behalf of the caller .PARAMETER Bulkreassignrequestdto 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 SystemCollectionsHashtable #> function Move-ApprovalV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Bulkreassignrequestdto}, [Switch] $WithHttpInfo ) Process { 'Calling method: Move-ApprovalV1' | 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 = '/generic-approvals/v1/bulk-reassign' if (!$Bulkreassignrequestdto) { throw "Error! The required parameter `Bulkreassignrequestdto` missing when calling moveApprovalV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Bulkreassignrequestdto -is [array])) { $LocalVarBodyParameter = $Bulkreassignrequestdto | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Bulkreassignrequestdto | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "SystemCollectionsHashtable" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Put Approval Config .DESCRIPTION Upserts a singular approval configuration that matches the given configID and configScope. For example to update the approval configurations for all Access Request Approvals please use: '/generic-approvals/config/ACCESS_REQUEST_APPROVAL/APPROVAL_TYPE' .PARAMETER Id The ID defined by the scope field, where [[id]]:[[scope]] is the following [[roleID]]:ROLE [[entitlementID]]:ENTITLEMENT [[accessProfileID]]:ACCESS_PROFILE ENTITLEMENT_DESCRIPTIONS:APPROVAL_TYPE ACCESS_REQUEST_APPROVAL:APPROVAL_TYPE ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE [[tenantID]]:TENANT [[domainObjectID]]:DOMAIN_OBJECT .PARAMETER Scope The scope of the field, where [[id]]:[[scope]] is the following [[roleID]]:ROLE [[entitlementID]]:ENTITLEMENT [[accessProfileID]]:ACCESS_PROFILE ENTITLEMENT_DESCRIPTIONS:APPROVAL_TYPE ACCESS_REQUEST_APPROVAL:APPROVAL_TYPE ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_CREATE_APPROVAL_REQUEST:APPROVAL_TYPE MACHINE_ACCOUNT_DELETE_APPROVAL_REQUEST:APPROVAL_TYPE [[tenantID]]:TENANT [[domainObjectID]]:DOMAIN_OBJECT .PARAMETER Approvalconfig 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 Approvalconfig #> function Send-ApprovalsConfigV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [ValidateSet("DOMAIN_OBJECT", "ROLE", "ACCESS_PROFILE", "ENTITLEMENT", "APPROVAL_TYPE", "TENANT")] [String] ${Scope}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalconfig}, [Switch] $WithHttpInfo ) Process { 'Calling method: Send-ApprovalsConfigV1' | 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 = '/generic-approvals/v1/config/{id}/{scope}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling putApprovalsConfigV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$Scope) { throw "Error! The required parameter `Scope` missing when calling putApprovalsConfigV1." } $LocalVarUri = $LocalVarUri.replace('{scope}', [System.Web.HTTPUtility]::UrlEncode($Scope)) if (!$Approvalconfig) { throw "Error! The required parameter `Approvalconfig` missing when calling putApprovalsConfigV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalconfig -is [array])) { $LocalVarBodyParameter = $Approvalconfig | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalconfig | 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-ApiClient -Method 'PUT' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approvalconfig" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Bulk Reject Approvals .DESCRIPTION Bulk reject specified approval requests on behalf of the caller .PARAMETER Bulkrejectrequestdto 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 SystemCollectionsHashtable #> function Deny-ApprovalInBulkV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Bulkrejectrequestdto}, [Switch] $WithHttpInfo ) Process { 'Calling method: Deny-ApprovalInBulkV1' | 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 = '/generic-approvals/v1/bulk-reject' if (!$Bulkrejectrequestdto) { throw "Error! The required parameter `Bulkrejectrequestdto` missing when calling rejectApprovalInBulkV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Bulkrejectrequestdto -is [array])) { $LocalVarBodyParameter = $Bulkrejectrequestdto | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Bulkrejectrequestdto | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "SystemCollectionsHashtable" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Approvals Reject .DESCRIPTION Rejects a specified approval request on behalf of the caller. This endpoint does not support access request IDs. If called by an admin and the admin is not listed as an approver, the approval request will be reassigned from a random approver to the admin user and approved. .PARAMETER Id Approval ID that correlates to an existing approval request that a user wants to reject. .PARAMETER Approvalrejectrequest 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 None #> function Deny-ApprovalV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalrejectrequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Deny-ApprovalV1' | 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 = '/generic-approvals/v1/{id}/reject' if (!$Id) { throw "Error! The required parameter `Id` missing when calling rejectApprovalV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalrejectrequest -is [array])) { $LocalVarBodyParameter = $Approvalrejectrequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalrejectrequest | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Approvals Attributes .DESCRIPTION Allows for the edit/addition/removal of the key/value pair additional attributes map for an existing approval request. This endpoint does not support access request IDs. .PARAMETER Id Approval ID that correlates to an existing approval request that a user wants to change the attributes of. .PARAMETER Approvalattributesrequest 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 Approval2 #> function Update-ApprovalsAttributesV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalattributesrequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Update-ApprovalsAttributesV1' | 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 = '/generic-approvals/v1/{id}/attributes' if (!$Id) { throw "Error! The required parameter `Id` missing when calling updateApprovalsAttributesV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$Approvalattributesrequest) { throw "Error! The required parameter `Approvalattributesrequest` missing when calling updateApprovalsAttributesV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalattributesrequest -is [array])) { $LocalVarBodyParameter = $Approvalattributesrequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalattributesrequest | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approval2" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Approvals Comments .DESCRIPTION Adds comments to a specified approval request. This endpoint does not support access request IDs. .PARAMETER Id Approval ID that correlates to an existing approval request that a user wants to add a comment to. .PARAMETER Approvalcommentsrequest 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 Approval2 #> function Update-ApprovalsCommentsV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalcommentsrequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Update-ApprovalsCommentsV1' | 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 = '/generic-approvals/v1/{id}/comments' if (!$Id) { throw "Error! The required parameter `Id` missing when calling updateApprovalsCommentsV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$Approvalcommentsrequest) { throw "Error! The required parameter `Approvalcommentsrequest` missing when calling updateApprovalsCommentsV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalcommentsrequest -is [array])) { $LocalVarBodyParameter = $Approvalcommentsrequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalcommentsrequest | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Approval2" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Post Approvals Reassign .DESCRIPTION Reassigns an approval request to another identity resulting in that identity being added as an authorized approver. This endpoint does not support access request IDs. .PARAMETER Id Approval ID that correlates to an existing approval request that a user wants to reassign. .PARAMETER Approvalreassignrequest 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 None #> function Update-ApprovalsReassignV1 { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${Approvalreassignrequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Update-ApprovalsReassignV1' | 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 = '/generic-approvals/v1/{id}/reassign' if (!$Id) { throw "Error! The required parameter `Id` missing when calling updateApprovalsReassignV1." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$Approvalreassignrequest) { throw "Error! The required parameter `Approvalreassignrequest` missing when calling updateApprovalsReassignV1." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($Approvalreassignrequest -is [array])) { $LocalVarBodyParameter = $Approvalreassignrequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $Approvalreassignrequest | 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-ApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } |