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