Model/ChangeSiteRenewProfileModel.ps1

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

<#
ChangeSiteRenewProfileModel<PSCustomObject>
#>


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

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

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

        return $PSO
    }
}

<#
ChangeSiteRenewProfileModel<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

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

        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]@{
            "ChangeSiteProfileOngoingAction" = ${ChangeSiteProfileOngoingAction}
            "OriginalProfile" = ${OriginalProfile}
            "DestinationProfile" = ${DestinationProfile}
            "ActivityId" = ${ActivityId}
        }

        return $PSO
    }

}