Model/EnableTeamCheckResult.ps1
|
# # Cloud Governance Api # Contact: support@avepoint.com # <# EnableTeamCheckResult<PSCustomObject> #> function New-EnableTeamCheckResult { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${TenantId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsAppliedPolicy} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${TeamSiteUrl}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${HasOngoingTask} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsManagedByGAO} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Owners}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${Members}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${PrimaryContact}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SecondaryContact}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsValid} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ErrorMessage}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${MessageCode} = "None" ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => EnableTeamCheckResult' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "TenantId" = ${TenantId} "IsAppliedPolicy" = ${IsAppliedPolicy} "TeamSiteUrl" = ${TeamSiteUrl} "HasOngoingTask" = ${HasOngoingTask} "IsManagedByGAO" = ${IsManagedByGAO} "Owners" = ${Owners} "Members" = ${Members} "PrimaryContact" = ${PrimaryContact} "SecondaryContact" = ${SecondaryContact} "IsValid" = ${IsValid} "ErrorMessage" = ${ErrorMessage} "MessageCode" = ${MessageCode} } return $PSO } } <# EnableTeamCheckResult<PSCustomObject> #> function ConvertFrom-JsonToEnableTeamCheckResult { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => EnableTeamCheckResult' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in EnableTeamCheckResult $AllProperties = $("TenantId", "IsAppliedPolicy", "TeamSiteUrl", "HasOngoingTask", "IsManagedByGAO", "Owners", "Members", "PrimaryContact", "SecondaryContact", "IsValid", "ErrorMessage", "MessageCode") 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 "TenantId"))) { #optional property not found $TenantId = $null } else { $TenantId = $JsonParameters.PSobject.Properties["TenantId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsAppliedPolicy"))) { #optional property not found $IsAppliedPolicy = $null } else { $IsAppliedPolicy = $JsonParameters.PSobject.Properties["IsAppliedPolicy"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "TeamSiteUrl"))) { #optional property not found $TeamSiteUrl = $null } else { $TeamSiteUrl = $JsonParameters.PSobject.Properties["TeamSiteUrl"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "HasOngoingTask"))) { #optional property not found $HasOngoingTask = $null } else { $HasOngoingTask = $JsonParameters.PSobject.Properties["HasOngoingTask"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsManagedByGAO"))) { #optional property not found $IsManagedByGAO = $null } else { $IsManagedByGAO = $JsonParameters.PSobject.Properties["IsManagedByGAO"].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 "Members"))) { #optional property not found $Members = $null } else { $Members = $JsonParameters.PSobject.Properties["Members"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "PrimaryContact"))) { #optional property not found $PrimaryContact = $null } else { $PrimaryContact = $JsonParameters.PSobject.Properties["PrimaryContact"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SecondaryContact"))) { #optional property not found $SecondaryContact = $null } else { $SecondaryContact = $JsonParameters.PSobject.Properties["SecondaryContact"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsValid"))) { #optional property not found $IsValid = $null } else { $IsValid = $JsonParameters.PSobject.Properties["IsValid"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ErrorMessage"))) { #optional property not found $ErrorMessage = $null } else { $ErrorMessage = $JsonParameters.PSobject.Properties["ErrorMessage"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "MessageCode"))) { #optional property not found $MessageCode = $null } else { $MessageCode = $JsonParameters.PSobject.Properties["MessageCode"].value } $PSO = [PSCustomObject]@{ "TenantId" = ${TenantId} "IsAppliedPolicy" = ${IsAppliedPolicy} "TeamSiteUrl" = ${TeamSiteUrl} "HasOngoingTask" = ${HasOngoingTask} "IsManagedByGAO" = ${IsManagedByGAO} "Owners" = ${Owners} "Members" = ${Members} "PrimaryContact" = ${PrimaryContact} "SecondaryContact" = ${SecondaryContact} "IsValid" = ${IsValid} "ErrorMessage" = ${ErrorMessage} "MessageCode" = ${MessageCode} } return $PSO } } |