Model/MachineIdentityApplicationCountsOwnership.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

Ownership coverage of applications.

.PARAMETER OwnedApplications
Number of applications that have at least one owner.
.PARAMETER OwnedPercent
Percentage of applications that have at least one owner.
.OUTPUTS

MachineIdentityApplicationCountsOwnership<PSCustomObject>
#>


function Initialize-MachineIdentityApplicationCountsOwnership {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${OwnedApplications},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${OwnedPercent}
    )

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


        $PSO = [PSCustomObject]@{
            "ownedApplications" = ${OwnedApplications}
            "ownedPercent" = ${OwnedPercent}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityApplicationCountsOwnership<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityApplicationCountsOwnership<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityApplicationCountsOwnership<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MachineIdentityApplicationCountsOwnership
        $AllProperties = ("ownedApplications", "ownedPercent")
        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 "ownedApplications"))) { #optional property not found
            $OwnedApplications = $null
        } else {
            $OwnedApplications = $JsonParameters.PSobject.Properties["ownedApplications"].value
        }

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

        $PSO = [PSCustomObject]@{
            "ownedApplications" = ${OwnedApplications}
            "ownedPercent" = ${OwnedPercent}
        }

        return $PSO
    }

}