Model/ChangeGroupOwnerMembershipCheckResult.ps1

#
# Cloud Governance Api
# Contact: support@avepoint.com
#

<#
ChangeGroupOwnerMembershipCheckResult<PSCustomObject>
#>


function New-ChangeGroupOwnerMembershipCheckResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${EnableChangeMembershipAssignment} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsDynamicMembership} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${DynamicMembershipRules},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${AllowAddGuestUser} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsEnableTeam} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${IsGCCH} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SiteUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Visibility},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Classification},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ExternalSharingProfileName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Metadatas},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AssignedLabels},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${WorkspaceTypeWithValidated} = "Site",
        [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 => ChangeGroupOwnerMembershipCheckResult' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "EnableChangeMembershipAssignment" = ${EnableChangeMembershipAssignment}
            "IsDynamicMembership" = ${IsDynamicMembership}
            "DynamicMembershipRules" = ${DynamicMembershipRules}
            "AllowAddGuestUser" = ${AllowAddGuestUser}
            "IsEnableTeam" = ${IsEnableTeam}
            "IsGCCH" = ${IsGCCH}
            "SiteUrl" = ${SiteUrl}
            "Visibility" = ${Visibility}
            "Classification" = ${Classification}
            "ExternalSharingProfileName" = ${ExternalSharingProfileName}
            "Metadatas" = ${Metadatas}
            "AssignedLabels" = ${AssignedLabels}
            "WorkspaceTypeWithValidated" = ${WorkspaceTypeWithValidated}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "IsValid" = ${IsValid}
            "ErrorMessage" = ${ErrorMessage}
            "MessageCode" = ${MessageCode}
        }

        return $PSO
    }
}

<#
ChangeGroupOwnerMembershipCheckResult<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: Cloud.Governance.Client => ChangeGroupOwnerMembershipCheckResult' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ChangeGroupOwnerMembershipCheckResult
        $AllProperties = $("EnableChangeMembershipAssignment", "IsDynamicMembership", "DynamicMembershipRules", "AllowAddGuestUser", "IsEnableTeam", "IsGCCH", "SiteUrl", "Visibility", "Classification", "ExternalSharingProfileName", "Metadatas", "AssignedLabels", "WorkspaceTypeWithValidated", "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 "EnableChangeMembershipAssignment"))) { #optional property not found
            $EnableChangeMembershipAssignment = $null
        } else {
            $EnableChangeMembershipAssignment = $JsonParameters.PSobject.Properties["EnableChangeMembershipAssignment"].value
        }

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

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

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

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

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "WorkspaceTypeWithValidated"))) { #optional property not found
            $WorkspaceTypeWithValidated = $null
        } else {
            $WorkspaceTypeWithValidated = $JsonParameters.PSobject.Properties["WorkspaceTypeWithValidated"].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]@{
            "EnableChangeMembershipAssignment" = ${EnableChangeMembershipAssignment}
            "IsDynamicMembership" = ${IsDynamicMembership}
            "DynamicMembershipRules" = ${DynamicMembershipRules}
            "AllowAddGuestUser" = ${AllowAddGuestUser}
            "IsEnableTeam" = ${IsEnableTeam}
            "IsGCCH" = ${IsGCCH}
            "SiteUrl" = ${SiteUrl}
            "Visibility" = ${Visibility}
            "Classification" = ${Classification}
            "ExternalSharingProfileName" = ${ExternalSharingProfileName}
            "Metadatas" = ${Metadatas}
            "AssignedLabels" = ${AssignedLabels}
            "WorkspaceTypeWithValidated" = ${WorkspaceTypeWithValidated}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "IsValid" = ${IsValid}
            "ErrorMessage" = ${ErrorMessage}
            "MessageCode" = ${MessageCode}
        }

        return $PSO
    }

}