Model/ChangeSiteHubSiteRequestModel.ps1
# # Cloud Governance Api # Contact: support@avepoint.com # <# ChangeSiteHubSiteRequestModel<PSCustomObject> #> function New-ChangeSiteHubSiteRequestModel { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Method} = "None", [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${ChangeHubSite}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ActivityId} ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => ChangeSiteHubSiteRequestModel' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "Method" = ${Method} "ChangeHubSite" = ${ChangeHubSite} "ActivityId" = ${ActivityId} } return $PSO } } <# ChangeSiteHubSiteRequestModel<PSCustomObject> #> function ConvertFrom-JsonToChangeSiteHubSiteRequestModel { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => ChangeSiteHubSiteRequestModel' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in ChangeSiteHubSiteRequestModel $AllProperties = $("Method", "ChangeHubSite", "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 "Method"))) { #optional property not found $Method = $null } else { $Method = $JsonParameters.PSobject.Properties["Method"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ChangeHubSite"))) { #optional property not found $ChangeHubSite = $null } else { $ChangeHubSite = $JsonParameters.PSobject.Properties["ChangeHubSite"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ActivityId"))) { #optional property not found $ActivityId = $null } else { $ActivityId = $JsonParameters.PSobject.Properties["ActivityId"].value } $PSO = [PSCustomObject]@{ "Method" = ${Method} "ChangeHubSite" = ${ChangeHubSite} "ActivityId" = ${ActivityId} } return $PSO } } |