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

Counts for one entity type and subtype on a single day.

.PARAMETER EntityType
Entity type the counts apply to.
.PARAMETER SubType
Subtype the counts apply to. `UNKNOWN` is used for entities that have no subtype.
.PARAMETER TotalCount
Number of entities of this type and subtype that existed on the day.
.PARAMETER CreatedCount
Number of entities of this type and subtype created on the day.
.PARAMETER CreatedCount30d
Number of entities of this type and subtype created in the 30 days ending on the day.
.OUTPUTS

MachineIdentityDailyCountMetric<PSCustomObject>
#>


function Initialize-MachineIdentityDailyCountMetric {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("machine_identity", "machine_account", "capability", "credential")]
        [String]
        ${EntityType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SubType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${TotalCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${CreatedCount},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int64]]
        ${CreatedCount30d}
    )

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


        $PSO = [PSCustomObject]@{
            "entityType" = ${EntityType}
            "subType" = ${SubType}
            "totalCount" = ${TotalCount}
            "createdCount" = ${CreatedCount}
            "createdCount30d" = ${CreatedCount30d}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityDailyCountMetric<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityDailyCountMetric<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityDailyCountMetric<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MachineIdentityDailyCountMetric
        $AllProperties = ("entityType", "subType", "totalCount", "createdCount", "createdCount30d")
        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 "entityType"))) { #optional property not found
            $EntityType = $null
        } else {
            $EntityType = $JsonParameters.PSobject.Properties["entityType"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "entityType" = ${EntityType}
            "subType" = ${SubType}
            "totalCount" = ${TotalCount}
            "createdCount" = ${CreatedCount}
            "createdCount30d" = ${CreatedCount30d}
        }

        return $PSO
    }

}