Model/ModelProfile.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 Name This is the name of the profile. .PARAMETER ProfileTypeId This is the ID of the profile type the profile belongs to .PARAMETER Status This is the status of the profile .PARAMETER IdProofingStatus This is the ID proofing staus of the profile .PARAMETER CreatedAt The date and time the profile was created .PARAMETER UpdatedAt The date and time the profile was updated .PARAMETER Attributes Attributes that belong to this profile. .OUTPUTS ModelProfile<PSCustomObject> #> function Initialize-NERMModelProfile { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ProfileTypeId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("Active", "Inactive", "On Leave", "Terminated")] [String] ${Status}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("pending", "pass", "fail")] [String] ${IdProofingStatus}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${CreatedAt}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${UpdatedAt}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Collections.Hashtable] ${Attributes} ) Process { 'Creating PSCustomObject: PSSailpoint.NERM => NERMModelProfile' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "name" = ${Name} "profile_type_id" = ${ProfileTypeId} "status" = ${Status} "id_proofing_status" = ${IdProofingStatus} "created_at" = ${CreatedAt} "updated_at" = ${UpdatedAt} "attributes" = ${Attributes} } return $PSO } } <# .SYNOPSIS Convert from JSON to ModelProfile<PSCustomObject> .DESCRIPTION Convert from JSON to ModelProfile<PSCustomObject> .PARAMETER Json Json object .OUTPUTS ModelProfile<PSCustomObject> #> function ConvertFrom-NERMJsonToModelProfile { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.NERM => NERMModelProfile' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in NERMModelProfile $AllProperties = ("id", "uid", "name", "profile_type_id", "status", "id_proofing_status", "created_at", "updated_at", "attributes") 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 "uid"))) { #optional property not found $Uid = $null } else { $Uid = $JsonParameters.PSobject.Properties["uid"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found $Name = $null } else { $Name = $JsonParameters.PSobject.Properties["name"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "profile_type_id"))) { #optional property not found $ProfileTypeId = $null } else { $ProfileTypeId = $JsonParameters.PSobject.Properties["profile_type_id"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { #optional property not found $Status = $null } else { $Status = $JsonParameters.PSobject.Properties["status"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "id_proofing_status"))) { #optional property not found $IdProofingStatus = $null } else { $IdProofingStatus = $JsonParameters.PSobject.Properties["id_proofing_status"].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 } if (!([bool]($JsonParameters.PSobject.Properties.name -match "attributes"))) { #optional property not found $Attributes = $null } else { $Attributes = $JsonParameters.PSobject.Properties["attributes"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "uid" = ${Uid} "name" = ${Name} "profile_type_id" = ${ProfileTypeId} "status" = ${Status} "id_proofing_status" = ${IdProofingStatus} "created_at" = ${CreatedAt} "updated_at" = ${UpdatedAt} "attributes" = ${Attributes} } return $PSO } } |