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