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