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