machine-identities/src/PSSailpoint.MachineIdentities/Model/MachineIdentityDailyCounts.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

Daily counts of non-human entities for the tenant over a window of days.

.PARAMETER VarFrom
First day (UTC) of the window, inclusive.
.PARAMETER To
Last day (UTC) of the window, inclusive. This is always the day before the current UTC date.
.PARAMETER Days
One entry for each calendar day in the window, in ascending order.
.OUTPUTS

MachineIdentityDailyCounts<PSCustomObject>
#>


function Initialize-MachineIdentityDailyCounts {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${VarFrom},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[System.DateTime]]
        ${To},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Days}
    )

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


        $PSO = [PSCustomObject]@{
            "from" = ${VarFrom}
            "to" = ${To}
            "days" = ${Days}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityDailyCounts<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityDailyCounts<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityDailyCounts<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

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

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

        $PSO = [PSCustomObject]@{
            "from" = ${VarFrom}
            "to" = ${To}
            "days" = ${Days}
        }

        return $PSO
    }

}