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