Public/NamingContexts/New-R1NamingContextContent.ps1

# .ExternalHelp psRadiantOne-help.xml
function New-R1NamingContextContent {
    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
    [OutputType([void])]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true
        )]
        [ValidateNotNullOrEmpty()]
        [string]$dn,

        [parameter(
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true
        )]
        [ValidateLength(1, 500)]
        [string]$relationshipObjectDn,

        [parameter(
            Mandatory = $false,
            ValueFromPipelineByPropertyName = $true
        )]
        [bool]$isQuoteTableNames,

        [parameter(
            Mandatory = $false,
            ValueFromPipelineByPropertyName = $true
        )]
        [bool]$isQuoteColumnNames,

        [parameter(
            Mandatory = $false,
            ValueFromPipelineByPropertyName = $true
        )]
        [bool]$isRelatedObjectsOnly,

        [parameter(
            Mandatory = $false,
            ValueFromPipelineByPropertyName = $true
        )]
        [string]$schema
    )

    Begin {

        Assert-R1Session -RequireToken

    }#begin

    Process {

        $URI = Resolve-R1ServiceUrl -Service Namespace -Path "naming_contexts/$($dn | Get-EscapedString)/add_content"

        $Body = $PSBoundParameters | Get-Parameter -ParametersToRemove dn | ConvertTo-R1JsonBody

        if ($PSCmdlet.ShouldProcess($dn, 'Add Child Content')) {

            $null = Invoke-R1RestMethod -Uri $URI -Method POST -Body $Body

        }

    }#process

    End { }#end

}