Model/Delegation1.ps1
|
# # NERM API # The NERM API 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 DelegatorId The id of the delegator .PARAMETER DelegateId The id of the delegate .PARAMETER Expiration The expiration date of the delegation .OUTPUTS Delegation1<PSCustomObject> #> function Initialize-NERMDelegation1 { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${DelegatorId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${DelegateId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${Expiration} ) Process { 'Creating PSCustomObject: PSSailpoint.NERM => NERMDelegation1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "delegator_id" = ${DelegatorId} "delegate_id" = ${DelegateId} "expiration" = ${Expiration} } return $PSO } } <# .SYNOPSIS Convert from JSON to Delegation1<PSCustomObject> .DESCRIPTION Convert from JSON to Delegation1<PSCustomObject> .PARAMETER Json Json object .OUTPUTS Delegation1<PSCustomObject> #> function ConvertFrom-NERMJsonToDelegation1 { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.NERM => NERMDelegation1' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in NERMDelegation1 $AllProperties = ("delegator_id", "delegate_id", "expiration") 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 "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 "expiration"))) { #optional property not found $Expiration = $null } else { $Expiration = $JsonParameters.PSobject.Properties["expiration"].value } $PSO = [PSCustomObject]@{ "delegator_id" = ${DelegatorId} "delegate_id" = ${DelegateId} "expiration" = ${Expiration} } return $PSO } } |