Model/ChangeSiteStorageManagementProfileModel.ps1
# # Cloud Governance Api # Contact: support@avepoint.com # <# ChangeSiteStorageManagementProfileModel<PSCustomObject> #> function New-ChangeSiteStorageManagementProfileModel { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${OriginalProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${DestinationProfile}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ActivityId} ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => ChangeSiteStorageManagementProfileModel' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "OriginalProfile" = ${OriginalProfile} "DestinationProfile" = ${DestinationProfile} "ActivityId" = ${ActivityId} } return $PSO } } <# ChangeSiteStorageManagementProfileModel<PSCustomObject> #> function ConvertFrom-JsonToChangeSiteStorageManagementProfileModel { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => ChangeSiteStorageManagementProfileModel' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in ChangeSiteStorageManagementProfileModel $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 } } |