Model/ChangeSecurityGroupSettingsGalleryRequestModel.ps1

#
# Cloud Governance Api
# Contact: support@avepoint.com
#

<#
ChangeSecurityGroupSettingsGalleryRequestModel<PSCustomObject>
#>


function New-ChangeSecurityGroupSettingsGalleryRequestModel {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ChangeGroupVisibility},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupSettingInfo},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ChangeGroupName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ChangeGroupDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryInternalName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${GalleryMetadata}
    )

    Process {
        'Creating PSCustomObject: Cloud.Governance.Client => ChangeSecurityGroupSettingsGalleryRequestModel' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        
        $PSO = [PSCustomObject]@{
            "ChangeGroupVisibility" = ${ChangeGroupVisibility}
            "GroupSettingInfo" = ${GroupSettingInfo}
            "ChangeGroupName" = ${ChangeGroupName}
            "ChangeGroupDescription" = ${ChangeGroupDescription}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }
}

<#
ChangeSecurityGroupSettingsGalleryRequestModel<PSCustomObject>
#>

function ConvertFrom-JsonToChangeSecurityGroupSettingsGalleryRequestModel {
    Param(
        [AllowEmptyString()]
        [string]$Json
    )

    Process {
        'Converting JSON to PSCustomObject: Cloud.Governance.Client => ChangeSecurityGroupSettingsGalleryRequestModel' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in ChangeSecurityGroupSettingsGalleryRequestModel
        $AllProperties = $("ChangeGroupVisibility", "GroupSettingInfo", "ChangeGroupName", "ChangeGroupDescription", "GalleryType", "GalleryInternalName", "GalleryMetadata")
        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 "ChangeGroupVisibility"))) { #optional property not found
            $ChangeGroupVisibility = $null
        } else {
            $ChangeGroupVisibility = $JsonParameters.PSobject.Properties["ChangeGroupVisibility"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GroupSettingInfo"))) { #optional property not found
            $GroupSettingInfo = $null
        } else {
            $GroupSettingInfo = $JsonParameters.PSobject.Properties["GroupSettingInfo"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "ChangeGroupName"))) { #optional property not found
            $ChangeGroupName = $null
        } else {
            $ChangeGroupName = $JsonParameters.PSobject.Properties["ChangeGroupName"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "ChangeGroupDescription"))) { #optional property not found
            $ChangeGroupDescription = $null
        } else {
            $ChangeGroupDescription = $JsonParameters.PSobject.Properties["ChangeGroupDescription"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GalleryType"))) { #optional property not found
            $GalleryType = $null
        } else {
            $GalleryType = $JsonParameters.PSobject.Properties["GalleryType"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GalleryInternalName"))) { #optional property not found
            $GalleryInternalName = $null
        } else {
            $GalleryInternalName = $JsonParameters.PSobject.Properties["GalleryInternalName"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "GalleryMetadata"))) { #optional property not found
            $GalleryMetadata = $null
        } else {
            $GalleryMetadata = $JsonParameters.PSobject.Properties["GalleryMetadata"].value
        }

        $PSO = [PSCustomObject]@{
            "ChangeGroupVisibility" = ${ChangeGroupVisibility}
            "GroupSettingInfo" = ${GroupSettingInfo}
            "ChangeGroupName" = ${ChangeGroupName}
            "ChangeGroupDescription" = ${ChangeGroupDescription}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }

}