jit-activations/src/PSSailpoint.JitActivations/Model/JitActivationCallerMetadata.ps1

#
# Identity Security Cloud API - JIT Activations
# Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.
# Version: v1
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Caller-specific context for the request. Field names depend on the request origin. The properties below apply when the request origin is Slack.

.PARAMETER Type
Request origin type. Matches `requestOrigin` when both are sent.
.PARAMETER SlackUserId
Slack user identifier of the caller.
.PARAMETER CommandText
Slack command text that produced this request.
.PARAMETER ChannelId
Slack channel identifier.
.PARAMETER ThreadId
Slack thread identifier of the message that produced this request.
.PARAMETER MessageId
Slack message identifier of the message that produced this request.
.PARAMETER WorkspaceId
Slack workspace identifier.
.OUTPUTS

JitActivationCallerMetadata<PSCustomObject>
#>


function Initialize-JitActivationCallerMetadata {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Type},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SlackUserId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${CommandText},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ChannelId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ThreadId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${MessageId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${WorkspaceId}
    )

    Process {
        'Creating PSCustomObject: PSSailpoint.JitActivations => JitActivationCallerMetadata' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug


        $PSO = [PSCustomObject]@{
            "type" = ${Type}
            "slackUserId" = ${SlackUserId}
            "commandText" = ${CommandText}
            "channelId" = ${ChannelId}
            "threadId" = ${ThreadId}
            "messageId" = ${MessageId}
            "workspaceId" = ${WorkspaceId}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to JitActivationCallerMetadata<PSCustomObject>

.DESCRIPTION

Convert from JSON to JitActivationCallerMetadata<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

JitActivationCallerMetadata<PSCustomObject>
#>

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

    Process {
        'Converting JSON to PSCustomObject: PSSailpoint.JitActivations => JitActivationCallerMetadata' | Write-Debug
        $PSBoundParameters | Out-DebugParameter | Write-Debug

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in JitActivationCallerMetadata
        $AllProperties = ("type", "slackUserId", "commandText", "channelId", "threadId", "messageId", "workspaceId")
        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 "type"))) { #optional property not found
            $Type = $null
        } else {
            $Type = $JsonParameters.PSobject.Properties["type"].value
        }

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "type" = ${Type}
            "slackUserId" = ${SlackUserId}
            "commandText" = ${CommandText}
            "channelId" = ${ChannelId}
            "threadId" = ${ThreadId}
            "messageId" = ${MessageId}
            "workspaceId" = ${WorkspaceId}
        }

        return $PSO
    }

}