Model/ChangeSiteExternalSharingProfileModel.ps1

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

<#
ChangeSiteExternalSharingProfileModel<PSCustomObject>
#>


function New-ChangeSiteExternalSharingProfileModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OriginalProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${DestinationProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ActivityId}
    )

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

        
        $PSO = [PSCustomObject]@{
            "OriginalProfile" = ${OriginalProfile}
            "DestinationProfile" = ${DestinationProfile}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }
}

<#
ChangeSiteExternalSharingProfileModel<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ChangeSiteExternalSharingProfileModel
        $AllProperties = $("OriginalProfile", "DestinationProfile", "ActivityId")
        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 "OriginalProfile"))) { #optional property not found
            $OriginalProfile = $null
        } else {
            $OriginalProfile = $JsonParameters.PSobject.Properties["OriginalProfile"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "OriginalProfile" = ${OriginalProfile}
            "DestinationProfile" = ${DestinationProfile}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }

}