Model/ApiTaskDynamicProperties.ps1

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

<#
ApiTaskDynamicProperties<PSCustomObject>
#>


function New-ApiTaskDynamicProperties {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${None},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PrimaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SecondaryContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ExpirationDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupOwners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AutoTaskActionHistories},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${InactivityThresholdDate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupEmail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PolicyName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PrimaryAdministrator},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteTemplate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteTitle},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SiteDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Requester},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsTeam},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsYammer},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupOwnersStr},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Approver},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ApprovalHistory},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CurrentTaskAction},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GuestUserId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GuestUserMail},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GuestUserName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Manager},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ElectionProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RenewalDetails},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsFinalStep},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ObjectId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsTriggerTaskWhenSecondaryEmpty},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PeoplePickerProfileId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EnvironmentDisplayName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupOwnerObjects},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TeamsLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ConversationsLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Phase},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ErrorMessage},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ExternalSharingProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${QuotaStorageProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RenewalProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PreferredDataLocation},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${NoteBookLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PlannerLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Classification},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Sensitivity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SharingForGroup},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Sharing},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${QuotaSize},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ObjectType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EnableDynamicMembership},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PhaseDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PhaseAssignees},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Alias},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ObjectName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ObjectDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OwnerStr},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AdditionalAppType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SharePointFormListUrl},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CoOwners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${StateDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CapacityName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CapacityTier},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CreatedTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${FlowType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${FlowStatus},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SolutionAwareFlow},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PhaseDuedate},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${PhaseStartTime},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EnvRegion},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${EnvType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ObjectTypeDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AdditionalAdmin},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${StorageUsage},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${TenantName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsShowWorkspaceInfo},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${AdditionalAppTypeDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Metadatas},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Comments},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DynamicMembershipRules},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsObjectDeleted},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${CommunityLink},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${IsSubInviteGuestRequest},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${SecondaryContactPeoplePickerProfileId}
    )

    Process {
        'Creating PSCustomObject: Cloud.Governance.Client => ApiTaskDynamicProperties' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "None" = ${None}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "SiteId" = ${SiteId}
            "SiteUrl" = ${SiteUrl}
            "GroupName" = ${GroupName}
            "ExpirationDate" = ${ExpirationDate}
            "GroupOwners" = ${GroupOwners}
            "AutoTaskActionHistories" = ${AutoTaskActionHistories}
            "InactivityThresholdDate" = ${InactivityThresholdDate}
            "GroupEmail" = ${GroupEmail}
            "GroupId" = ${GroupId}
            "PolicyName" = ${PolicyName}
            "PrimaryAdministrator" = ${PrimaryAdministrator}
            "SiteTemplate" = ${SiteTemplate}
            "SiteTitle" = ${SiteTitle}
            "SiteDescription" = ${SiteDescription}
            "Requester" = ${Requester}
            "IsTeam" = ${IsTeam}
            "IsYammer" = ${IsYammer}
            "GroupOwnersStr" = ${GroupOwnersStr}
            "TenantId" = ${TenantId}
            "Approver" = ${Approver}
            "ApprovalHistory" = ${ApprovalHistory}
            "CurrentTaskAction" = ${CurrentTaskAction}
            "GuestUserId" = ${GuestUserId}
            "GuestUserMail" = ${GuestUserMail}
            "GuestUserName" = ${GuestUserName}
            "Manager" = ${Manager}
            "ElectionProfile" = ${ElectionProfile}
            "RenewalDetails" = ${RenewalDetails}
            "IsFinalStep" = ${IsFinalStep}
            "ObjectId" = ${ObjectId}
            "IsTriggerTaskWhenSecondaryEmpty" = ${IsTriggerTaskWhenSecondaryEmpty}
            "PeoplePickerProfileId" = ${PeoplePickerProfileId}
            "EnvironmentDisplayName" = ${EnvironmentDisplayName}
            "GroupOwnerObjects" = ${GroupOwnerObjects}
            "TeamsLink" = ${TeamsLink}
            "ConversationsLink" = ${ConversationsLink}
            "Phase" = ${Phase}
            "ErrorMessage" = ${ErrorMessage}
            "ExternalSharingProfile" = ${ExternalSharingProfile}
            "QuotaStorageProfile" = ${QuotaStorageProfile}
            "RenewalProfile" = ${RenewalProfile}
            "PreferredDataLocation" = ${PreferredDataLocation}
            "NoteBookLink" = ${NoteBookLink}
            "PlannerLink" = ${PlannerLink}
            "Classification" = ${Classification}
            "Sensitivity" = ${Sensitivity}
            "SharingForGroup" = ${SharingForGroup}
            "Sharing" = ${Sharing}
            "QuotaSize" = ${QuotaSize}
            "ObjectType" = ${ObjectType}
            "EnableDynamicMembership" = ${EnableDynamicMembership}
            "PhaseDescription" = ${PhaseDescription}
            "PhaseAssignees" = ${PhaseAssignees}
            "Alias" = ${Alias}
            "ObjectName" = ${ObjectName}
            "ObjectDescription" = ${ObjectDescription}
            "OwnerStr" = ${OwnerStr}
            "AdditionalAppType" = ${AdditionalAppType}
            "SharePointFormListUrl" = ${SharePointFormListUrl}
            "CoOwners" = ${CoOwners}
            "StateDescription" = ${StateDescription}
            "CapacityName" = ${CapacityName}
            "CapacityTier" = ${CapacityTier}
            "CreatedTime" = ${CreatedTime}
            "FlowType" = ${FlowType}
            "FlowStatus" = ${FlowStatus}
            "SolutionAwareFlow" = ${SolutionAwareFlow}
            "PhaseDuedate" = ${PhaseDuedate}
            "PhaseStartTime" = ${PhaseStartTime}
            "EnvRegion" = ${EnvRegion}
            "EnvType" = ${EnvType}
            "ObjectTypeDescription" = ${ObjectTypeDescription}
            "AdditionalAdmin" = ${AdditionalAdmin}
            "StorageUsage" = ${StorageUsage}
            "TenantName" = ${TenantName}
            "IsShowWorkspaceInfo" = ${IsShowWorkspaceInfo}
            "AdditionalAppTypeDescription" = ${AdditionalAppTypeDescription}
            "Metadatas" = ${Metadatas}
            "Status" = ${Status}
            "Comments" = ${Comments}
            "DynamicMembershipRules" = ${DynamicMembershipRules}
            "IsObjectDeleted" = ${IsObjectDeleted}
            "Type" = ${Type}
            "CommunityLink" = ${CommunityLink}
            "IsSubInviteGuestRequest" = ${IsSubInviteGuestRequest}
            "SecondaryContactPeoplePickerProfileId" = ${SecondaryContactPeoplePickerProfileId}
        }

        return $PSO
    }
}

<#
ApiTaskDynamicProperties<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ApiTaskDynamicProperties
        $AllProperties = $("None", "PrimaryContact", "SecondaryContact", "SiteId", "SiteUrl", "GroupName", "ExpirationDate", "GroupOwners", "AutoTaskActionHistories", "InactivityThresholdDate", "GroupEmail", "GroupId", "PolicyName", "PrimaryAdministrator", "SiteTemplate", "SiteTitle", "SiteDescription", "Requester", "IsTeam", "IsYammer", "GroupOwnersStr", "TenantId", "Approver", "ApprovalHistory", "CurrentTaskAction", "GuestUserId", "GuestUserMail", "GuestUserName", "Manager", "ElectionProfile", "RenewalDetails", "IsFinalStep", "ObjectId", "IsTriggerTaskWhenSecondaryEmpty", "PeoplePickerProfileId", "EnvironmentDisplayName", "GroupOwnerObjects", "TeamsLink", "ConversationsLink", "Phase", "ErrorMessage", "ExternalSharingProfile", "QuotaStorageProfile", "RenewalProfile", "PreferredDataLocation", "NoteBookLink", "PlannerLink", "Classification", "Sensitivity", "SharingForGroup", "Sharing", "QuotaSize", "ObjectType", "EnableDynamicMembership", "PhaseDescription", "PhaseAssignees", "Alias", "ObjectName", "ObjectDescription", "OwnerStr", "AdditionalAppType", "SharePointFormListUrl", "CoOwners", "StateDescription", "CapacityName", "CapacityTier", "CreatedTime", "FlowType", "FlowStatus", "SolutionAwareFlow", "PhaseDuedate", "PhaseStartTime", "EnvRegion", "EnvType", "ObjectTypeDescription", "AdditionalAdmin", "StorageUsage", "TenantName", "IsShowWorkspaceInfo", "AdditionalAppTypeDescription", "Metadatas", "Status", "Comments", "DynamicMembershipRules", "IsObjectDeleted", "Type", "CommunityLink", "IsSubInviteGuestRequest", "SecondaryContactPeoplePickerProfileId")
        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 "None"))) { #optional property not found
            $None = $null
        } else {
            $None = $JsonParameters.PSobject.Properties["None"].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 "SiteId"))) { #optional property not found
            $SiteId = $null
        } else {
            $SiteId = $JsonParameters.PSobject.Properties["SiteId"].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 "GroupName"))) { #optional property not found
            $GroupName = $null
        } else {
            $GroupName = $JsonParameters.PSobject.Properties["GroupName"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 "Approver"))) { #optional property not found
            $Approver = $null
        } else {
            $Approver = $JsonParameters.PSobject.Properties["Approver"].value
        }

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

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

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

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

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

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

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

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

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

        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 "IsTriggerTaskWhenSecondaryEmpty"))) { #optional property not found
            $IsTriggerTaskWhenSecondaryEmpty = $null
        } else {
            $IsTriggerTaskWhenSecondaryEmpty = $JsonParameters.PSobject.Properties["IsTriggerTaskWhenSecondaryEmpty"].value
        }

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "Phase"))) { #optional property not found
            $Phase = $null
        } else {
            $Phase = $JsonParameters.PSobject.Properties["Phase"].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 "ExternalSharingProfile"))) { #optional property not found
            $ExternalSharingProfile = $null
        } else {
            $ExternalSharingProfile = $JsonParameters.PSobject.Properties["ExternalSharingProfile"].value
        }

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "PlannerLink"))) { #optional property not found
            $PlannerLink = $null
        } else {
            $PlannerLink = $JsonParameters.PSobject.Properties["PlannerLink"].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 "Sensitivity"))) { #optional property not found
            $Sensitivity = $null
        } else {
            $Sensitivity = $JsonParameters.PSobject.Properties["Sensitivity"].value
        }

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "Alias"))) { #optional property not found
            $Alias = $null
        } else {
            $Alias = $JsonParameters.PSobject.Properties["Alias"].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 "ObjectDescription"))) { #optional property not found
            $ObjectDescription = $null
        } else {
            $ObjectDescription = $JsonParameters.PSobject.Properties["ObjectDescription"].value
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "AdditionalAppTypeDescription"))) { #optional property not found
            $AdditionalAppTypeDescription = $null
        } else {
            $AdditionalAppTypeDescription = $JsonParameters.PSobject.Properties["AdditionalAppTypeDescription"].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 "Status"))) { #optional property not found
            $Status = $null
        } else {
            $Status = $JsonParameters.PSobject.Properties["Status"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "Comments"))) { #optional property not found
            $Comments = $null
        } else {
            $Comments = $JsonParameters.PSobject.Properties["Comments"].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 "IsObjectDeleted"))) { #optional property not found
            $IsObjectDeleted = $null
        } else {
            $IsObjectDeleted = $JsonParameters.PSobject.Properties["IsObjectDeleted"].value
        }

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

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

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

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

        $PSO = [PSCustomObject]@{
            "None" = ${None}
            "PrimaryContact" = ${PrimaryContact}
            "SecondaryContact" = ${SecondaryContact}
            "SiteId" = ${SiteId}
            "SiteUrl" = ${SiteUrl}
            "GroupName" = ${GroupName}
            "ExpirationDate" = ${ExpirationDate}
            "GroupOwners" = ${GroupOwners}
            "AutoTaskActionHistories" = ${AutoTaskActionHistories}
            "InactivityThresholdDate" = ${InactivityThresholdDate}
            "GroupEmail" = ${GroupEmail}
            "GroupId" = ${GroupId}
            "PolicyName" = ${PolicyName}
            "PrimaryAdministrator" = ${PrimaryAdministrator}
            "SiteTemplate" = ${SiteTemplate}
            "SiteTitle" = ${SiteTitle}
            "SiteDescription" = ${SiteDescription}
            "Requester" = ${Requester}
            "IsTeam" = ${IsTeam}
            "IsYammer" = ${IsYammer}
            "GroupOwnersStr" = ${GroupOwnersStr}
            "TenantId" = ${TenantId}
            "Approver" = ${Approver}
            "ApprovalHistory" = ${ApprovalHistory}
            "CurrentTaskAction" = ${CurrentTaskAction}
            "GuestUserId" = ${GuestUserId}
            "GuestUserMail" = ${GuestUserMail}
            "GuestUserName" = ${GuestUserName}
            "Manager" = ${Manager}
            "ElectionProfile" = ${ElectionProfile}
            "RenewalDetails" = ${RenewalDetails}
            "IsFinalStep" = ${IsFinalStep}
            "ObjectId" = ${ObjectId}
            "IsTriggerTaskWhenSecondaryEmpty" = ${IsTriggerTaskWhenSecondaryEmpty}
            "PeoplePickerProfileId" = ${PeoplePickerProfileId}
            "EnvironmentDisplayName" = ${EnvironmentDisplayName}
            "GroupOwnerObjects" = ${GroupOwnerObjects}
            "TeamsLink" = ${TeamsLink}
            "ConversationsLink" = ${ConversationsLink}
            "Phase" = ${Phase}
            "ErrorMessage" = ${ErrorMessage}
            "ExternalSharingProfile" = ${ExternalSharingProfile}
            "QuotaStorageProfile" = ${QuotaStorageProfile}
            "RenewalProfile" = ${RenewalProfile}
            "PreferredDataLocation" = ${PreferredDataLocation}
            "NoteBookLink" = ${NoteBookLink}
            "PlannerLink" = ${PlannerLink}
            "Classification" = ${Classification}
            "Sensitivity" = ${Sensitivity}
            "SharingForGroup" = ${SharingForGroup}
            "Sharing" = ${Sharing}
            "QuotaSize" = ${QuotaSize}
            "ObjectType" = ${ObjectType}
            "EnableDynamicMembership" = ${EnableDynamicMembership}
            "PhaseDescription" = ${PhaseDescription}
            "PhaseAssignees" = ${PhaseAssignees}
            "Alias" = ${Alias}
            "ObjectName" = ${ObjectName}
            "ObjectDescription" = ${ObjectDescription}
            "OwnerStr" = ${OwnerStr}
            "AdditionalAppType" = ${AdditionalAppType}
            "SharePointFormListUrl" = ${SharePointFormListUrl}
            "CoOwners" = ${CoOwners}
            "StateDescription" = ${StateDescription}
            "CapacityName" = ${CapacityName}
            "CapacityTier" = ${CapacityTier}
            "CreatedTime" = ${CreatedTime}
            "FlowType" = ${FlowType}
            "FlowStatus" = ${FlowStatus}
            "SolutionAwareFlow" = ${SolutionAwareFlow}
            "PhaseDuedate" = ${PhaseDuedate}
            "PhaseStartTime" = ${PhaseStartTime}
            "EnvRegion" = ${EnvRegion}
            "EnvType" = ${EnvType}
            "ObjectTypeDescription" = ${ObjectTypeDescription}
            "AdditionalAdmin" = ${AdditionalAdmin}
            "StorageUsage" = ${StorageUsage}
            "TenantName" = ${TenantName}
            "IsShowWorkspaceInfo" = ${IsShowWorkspaceInfo}
            "AdditionalAppTypeDescription" = ${AdditionalAppTypeDescription}
            "Metadatas" = ${Metadatas}
            "Status" = ${Status}
            "Comments" = ${Comments}
            "DynamicMembershipRules" = ${DynamicMembershipRules}
            "IsObjectDeleted" = ${IsObjectDeleted}
            "Type" = ${Type}
            "CommunityLink" = ${CommunityLink}
            "IsSubInviteGuestRequest" = ${IsSubInviteGuestRequest}
            "SecondaryContactPeoplePickerProfileId" = ${SecondaryContactPeoplePickerProfileId}
        }

        return $PSO
    }

}