machine-identities-lifecycle-actions/src/PSSailpoint.MachineIdentitiesLifecycleActions/Model/LifecycleResourceSummary.ps1

#
# SailPoint Identity Security API - Machine Identity Lifecycle Actions
# Use these APIs to submit, list, retrieve, and cancel machine identity lifecycle actions (currently activate and deactivate for Agent machine identities only). 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

No summary available.

.DESCRIPTION

Details of the machine identity at the time the request was submitted.

.PARAMETER Id
ID of the machine identity.
.PARAMETER ResourceId
ID of the machine identity in its source system.
.PARAMETER Name
Name of the machine identity.
.PARAMETER SourceId
ID of the source the machine identity belongs to.
.PARAMETER SourceName
Name of the source the machine identity belongs to.
.PARAMETER Subtype
Type of machine identity.
.OUTPUTS

LifecycleResourceSummary<PSCustomObject>
#>


function Initialize-LifecycleResourceSummary {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ResourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Subtype}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint.MachineIdentitiesLifecycleActions => LifecycleResourceSummary' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "resourceId" = ${ResourceId}
            "name" = ${Name}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "subtype" = ${Subtype}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to LifecycleResourceSummary<PSCustomObject>

.DESCRIPTION

Convert from JSON to LifecycleResourceSummary<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

LifecycleResourceSummary<PSCustomObject>
#>

function ConvertFrom-JsonToLifecycleResourceSummary {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint.MachineIdentitiesLifecycleActions => LifecycleResourceSummary' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in LifecycleResourceSummary
        $AllProperties = ("id", "resourceId", "name", "sourceId", "sourceName", "subtype")
        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 "resourceId"))) { #optional property not found
            $ResourceId = $null
        } else {
            $ResourceId = $JsonParameters.PSobject.Properties["resourceId"].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 "sourceId"))) { #optional property not found
            $SourceId = $null
        } else {
            $SourceId = $JsonParameters.PSobject.Properties["sourceId"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "sourceName"))) { #optional property not found
            $SourceName = $null
        } else {
            $SourceName = $JsonParameters.PSobject.Properties["sourceName"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "subtype"))) { #optional property not found
            $Subtype = $null
        } else {
            $Subtype = $JsonParameters.PSobject.Properties["subtype"].value
        }

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "resourceId" = ${ResourceId}
            "name" = ${Name}
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "subtype" = ${Subtype}
        }

        return $PSO
    }

}