devices/src/PSSailpoint.Devices/Model/DeviceSummary.ps1
|
# # Identity Security Cloud API - Devices # Use these APIs to interact with the Identity Security Cloud 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 device counts. .PARAMETER TotalEndpoints The total number of devices in the tenant. .PARAMETER ByOs No description available. .PARAMETER AvgAgentsPerEndpoint The average number of agents per device, rounded to one decimal place. .PARAMETER EndpointsWithoutRecentData The number of devices for which the source has sent no endpoint data or resource link in the last three days. .PARAMETER EndpointsWithActiveAgents The number of devices linked to at least one existing agent. .OUTPUTS DeviceSummary<PSCustomObject> #> function Initialize-DeviceSummary { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int64]] ${TotalEndpoints}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ByOs}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Double]] ${AvgAgentsPerEndpoint}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int64]] ${EndpointsWithoutRecentData}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int64]] ${EndpointsWithActiveAgents} ) Process { 'Creating PSCustomObject: PSSailpoint.Devices => DeviceSummary' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "totalEndpoints" = ${TotalEndpoints} "byOs" = ${ByOs} "avgAgentsPerEndpoint" = ${AvgAgentsPerEndpoint} "endpointsWithoutRecentData" = ${EndpointsWithoutRecentData} "endpointsWithActiveAgents" = ${EndpointsWithActiveAgents} } return $PSO } } <# .SYNOPSIS Convert from JSON to DeviceSummary<PSCustomObject> .DESCRIPTION Convert from JSON to DeviceSummary<PSCustomObject> .PARAMETER Json Json object .OUTPUTS DeviceSummary<PSCustomObject> #> function ConvertFrom-JsonToDeviceSummary { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.Devices => DeviceSummary' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in DeviceSummary $AllProperties = ("totalEndpoints", "byOs", "avgAgentsPerEndpoint", "endpointsWithoutRecentData", "endpointsWithActiveAgents") 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 "totalEndpoints"))) { #optional property not found $TotalEndpoints = $null } else { $TotalEndpoints = $JsonParameters.PSobject.Properties["totalEndpoints"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "byOs"))) { #optional property not found $ByOs = $null } else { $ByOs = $JsonParameters.PSobject.Properties["byOs"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "avgAgentsPerEndpoint"))) { #optional property not found $AvgAgentsPerEndpoint = $null } else { $AvgAgentsPerEndpoint = $JsonParameters.PSobject.Properties["avgAgentsPerEndpoint"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "endpointsWithoutRecentData"))) { #optional property not found $EndpointsWithoutRecentData = $null } else { $EndpointsWithoutRecentData = $JsonParameters.PSobject.Properties["endpointsWithoutRecentData"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "endpointsWithActiveAgents"))) { #optional property not found $EndpointsWithActiveAgents = $null } else { $EndpointsWithActiveAgents = $JsonParameters.PSobject.Properties["endpointsWithActiveAgents"].value } $PSO = [PSCustomObject]@{ "totalEndpoints" = ${TotalEndpoints} "byOs" = ${ByOs} "avgAgentsPerEndpoint" = ${AvgAgentsPerEndpoint} "endpointsWithoutRecentData" = ${EndpointsWithoutRecentData} "endpointsWithActiveAgents" = ${EndpointsWithActiveAgents} } return $PSO } } |