nermV2025/src/PSSailpoint.NERMV2025/Model/Delegation.ps1
|
# # NERM API v2025 # The NERM API v2025 accesss and modifies resources in your environment. # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS No summary available. .DESCRIPTION No description available. .PARAMETER Id The id of the delegation .PARAMETER DelegatorId The id of the delegator user .PARAMETER DelegateId The id of the delegate user .PARAMETER Delegator No description available. .PARAMETER Delegate No description available. .PARAMETER Expiration The expiration date of the delegation .PARAMETER Expired Indicates if the delegation is expired .OUTPUTS Delegation<PSCustomObject> #> function Initialize-NERMV2025Delegation { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Id}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${DelegatorId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${DelegateId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Delegator}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Delegate}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${Expiration}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${Expired} ) Process { 'Creating PSCustomObject: PSSailpoint.NERMV2025 => NERMV2025Delegation' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "id" = ${Id} "delegator_id" = ${DelegatorId} "delegate_id" = ${DelegateId} "delegator" = ${Delegator} "delegate" = ${Delegate} "expiration" = ${Expiration} "expired" = ${Expired} } return $PSO } } <# .SYNOPSIS Convert from JSON to Delegation<PSCustomObject> .DESCRIPTION Convert from JSON to Delegation<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Delegation<PSCustomObject> #> function ConvertFrom-NERMV2025JsonToDelegation { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.NERMV2025 => NERMV2025Delegation' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in NERMV2025Delegation $AllProperties = ("id", "delegator_id", "delegate_id", "delegator", "delegate", "expiration", "expired", "created_at", "updated_at") foreach ($name in $JsonParameters.PsObject.Properties.Name) { if (!($AllProperties.Contains($name))) { throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" } } if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found $Id = $null } else { $Id = $JsonParameters.PSobject.Properties["id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "delegator_id"))) { #optional property not found $DelegatorId = $null } else { $DelegatorId = $JsonParameters.PSobject.Properties["delegator_id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "delegate_id"))) { #optional property not found $DelegateId = $null } else { $DelegateId = $JsonParameters.PSobject.Properties["delegate_id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "delegator"))) { #optional property not found $Delegator = $null } else { $Delegator = $JsonParameters.PSobject.Properties["delegator"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "delegate"))) { #optional property not found $Delegate = $null } else { $Delegate = $JsonParameters.PSobject.Properties["delegate"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "expiration"))) { #optional property not found $Expiration = $null } else { $Expiration = $JsonParameters.PSobject.Properties["expiration"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "expired"))) { #optional property not found $Expired = $null } else { $Expired = $JsonParameters.PSobject.Properties["expired"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "created_at"))) { #optional property not found $CreatedAt = $null } else { $CreatedAt = $JsonParameters.PSobject.Properties["created_at"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "updated_at"))) { #optional property not found $UpdatedAt = $null } else { $UpdatedAt = $JsonParameters.PSobject.Properties["updated_at"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "delegator_id" = ${DelegatorId} "delegate_id" = ${DelegateId} "delegator" = ${Delegator} "delegate" = ${Delegate} "expiration" = ${Expiration} "expired" = ${Expired} "created_at" = ${CreatedAt} "updated_at" = ${UpdatedAt} } return $PSO } } |