Model/AutoImportConfirmMetricsInfo.ps1
|
# # Cloud Governance Api # Contact: support@avepoint.com # <# AutoImportConfirmMetricsInfo<PSCustomObject> #> function New-AutoImportConfirmMetricsInfo { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ObjectId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ObjectUrl}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ObjectName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${TriggerTime}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${CompletedTime}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsDeletedByOwner} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsDeletedByEscalation} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${DeletedBy}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Owners}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Int64]] ${StorageSize} = 0 ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => AutoImportConfirmMetricsInfo' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "ObjectId" = ${ObjectId} "ObjectUrl" = ${ObjectUrl} "ObjectName" = ${ObjectName} "TriggerTime" = ${TriggerTime} "CompletedTime" = ${CompletedTime} "IsDeletedByOwner" = ${IsDeletedByOwner} "IsDeletedByEscalation" = ${IsDeletedByEscalation} "DeletedBy" = ${DeletedBy} "Owners" = ${Owners} "StorageSize" = ${StorageSize} } return $PSO } } <# AutoImportConfirmMetricsInfo<PSCustomObject> #> function ConvertFrom-JsonToAutoImportConfirmMetricsInfo { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => AutoImportConfirmMetricsInfo' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in AutoImportConfirmMetricsInfo $AllProperties = $("ObjectId", "ObjectUrl", "ObjectName", "TriggerTime", "CompletedTime", "IsDeletedByOwner", "IsDeletedByEscalation", "DeletedBy", "Owners", "StorageSize") 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 "ObjectId"))) { #optional property not found $ObjectId = $null } else { $ObjectId = $JsonParameters.PSobject.Properties["ObjectId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ObjectUrl"))) { #optional property not found $ObjectUrl = $null } else { $ObjectUrl = $JsonParameters.PSobject.Properties["ObjectUrl"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ObjectName"))) { #optional property not found $ObjectName = $null } else { $ObjectName = $JsonParameters.PSobject.Properties["ObjectName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "TriggerTime"))) { #optional property not found $TriggerTime = $null } else { $TriggerTime = $JsonParameters.PSobject.Properties["TriggerTime"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "CompletedTime"))) { #optional property not found $CompletedTime = $null } else { $CompletedTime = $JsonParameters.PSobject.Properties["CompletedTime"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsDeletedByOwner"))) { #optional property not found $IsDeletedByOwner = $null } else { $IsDeletedByOwner = $JsonParameters.PSobject.Properties["IsDeletedByOwner"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsDeletedByEscalation"))) { #optional property not found $IsDeletedByEscalation = $null } else { $IsDeletedByEscalation = $JsonParameters.PSobject.Properties["IsDeletedByEscalation"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "DeletedBy"))) { #optional property not found $DeletedBy = $null } else { $DeletedBy = $JsonParameters.PSobject.Properties["DeletedBy"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Owners"))) { #optional property not found $Owners = $null } else { $Owners = $JsonParameters.PSobject.Properties["Owners"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "StorageSize"))) { #optional property not found $StorageSize = $null } else { $StorageSize = $JsonParameters.PSobject.Properties["StorageSize"].value } $PSO = [PSCustomObject]@{ "ObjectId" = ${ObjectId} "ObjectUrl" = ${ObjectUrl} "ObjectName" = ${ObjectName} "TriggerTime" = ${TriggerTime} "CompletedTime" = ${CompletedTime} "IsDeletedByOwner" = ${IsDeletedByOwner} "IsDeletedByEscalation" = ${IsDeletedByEscalation} "DeletedBy" = ${DeletedBy} "Owners" = ${Owners} "StorageSize" = ${StorageSize} } return $PSO } } |