Model/CreateSecurityGroupGallery.ps1

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

<#
CreateSecurityGroupGallery<PSCustomObject>
#>


function New-CreateSecurityGroupGallery {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${OfficeTenantId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupNameAndDescription},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${GroupContact},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Owners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Members},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Tenant},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${ElectionProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${RenewalProfile},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${GalleryInternalName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${GalleryMetadata}
    )

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

        
        $PSO = [PSCustomObject]@{
            "OfficeTenantId" = ${OfficeTenantId}
            "GroupNameAndDescription" = ${GroupNameAndDescription}
            "GroupContact" = ${GroupContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "Tenant" = ${Tenant}
            "ElectionProfile" = ${ElectionProfile}
            "RenewalProfile" = ${RenewalProfile}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }
}

<#
CreateSecurityGroupGallery<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in CreateSecurityGroupGallery
        $AllProperties = $("OfficeTenantId", "GroupNameAndDescription", "GroupContact", "Owners", "Members", "Tenant", "ElectionProfile", "RenewalProfile", "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 "OfficeTenantId"))) { #optional property not found
            $OfficeTenantId = $null
        } else {
            $OfficeTenantId = $JsonParameters.PSobject.Properties["OfficeTenantId"].value
        }

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "RenewalProfile"))) { #optional property not found
            $RenewalProfile = $null
        } else {
            $RenewalProfile = $JsonParameters.PSobject.Properties["RenewalProfile"].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]@{
            "OfficeTenantId" = ${OfficeTenantId}
            "GroupNameAndDescription" = ${GroupNameAndDescription}
            "GroupContact" = ${GroupContact}
            "Owners" = ${Owners}
            "Members" = ${Members}
            "Tenant" = ${Tenant}
            "ElectionProfile" = ${ElectionProfile}
            "RenewalProfile" = ${RenewalProfile}
            "GalleryType" = ${GalleryType}
            "GalleryInternalName" = ${GalleryInternalName}
            "GalleryMetadata" = ${GalleryMetadata}
        }

        return $PSO
    }

}