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