machine-identities/src/PSSailpoint.MachineIdentities/Model/MachineIdentityApplicationCounts.ps1

#
# SailPoint Identity Security API - Machine Identities
# Use these APIs to interact with the SailPoint Identity Security 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

No summary available.

.DESCRIPTION

Tenant-wide summary counts for application machine identities.

.PARAMETER ApplicationCount
Total number of applications.
.PARAMETER UnsanctionedApplicationCount
Number of applications that are not sanctioned.
.PARAMETER Discovered
No description available.
.PARAMETER RiskSeverity
No description available.
.PARAMETER Ownership
No description available.
.OUTPUTS

MachineIdentityApplicationCounts<PSCustomObject>
#>


function Initialize-MachineIdentityApplicationCounts {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${ApplicationCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${UnsanctionedApplicationCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Discovered},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RiskSeverity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Ownership}
    )

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


        $PSO = [PSCustomObject]@{
            "applicationCount" = ${ApplicationCount}
            "unsanctionedApplicationCount" = ${UnsanctionedApplicationCount}
            "discovered" = ${Discovered}
            "riskSeverity" = ${RiskSeverity}
            "ownership" = ${Ownership}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityApplicationCounts<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityApplicationCounts<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityApplicationCounts<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MachineIdentityApplicationCounts
        $AllProperties = ("applicationCount", "unsanctionedApplicationCount", "discovered", "riskSeverity", "ownership")
        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 "applicationCount"))) { #optional property not found
            $ApplicationCount = $null
        } else {
            $ApplicationCount = $JsonParameters.PSobject.Properties["applicationCount"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "applicationCount" = ${ApplicationCount}
            "unsanctionedApplicationCount" = ${UnsanctionedApplicationCount}
            "discovered" = ${Discovered}
            "riskSeverity" = ${RiskSeverity}
            "ownership" = ${Ownership}
        }

        return $PSO
    }

}