Model/MachineIdentityCreatedMachineIdentity.ps1

#
# Identity Security Cloud V2025 API
# 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: v2025
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

<#
.SYNOPSIS

No summary available.

.DESCRIPTION

Details of the created machine identity.

.PARAMETER Id
Unique identifier for the machine identity.
.PARAMETER Name
Name of the machine identity.
.PARAMETER Created
Creation timestamp.
.PARAMETER Modified
Last modified timestamp.
.PARAMETER BusinessApplication
Associated business application.
.PARAMETER Description
Description of the machine identity.
.PARAMETER Attributes
The attributes assigned to the identity.
.PARAMETER Subtype
Subtype of the machine identity.
.PARAMETER Owners
List of owners.
.PARAMETER SourceId
Source identifier.
.PARAMETER Uuid
UUID of the machine identity.
.PARAMETER NativeIdentity
Native identity value.
.PARAMETER ManuallyEdited
Indicates if manually edited.
.PARAMETER ManuallyCreated
Indicates if manually created.
.PARAMETER DatasetId
Dataset identifier.
.PARAMETER Source
No description available.
.PARAMETER UserEntitlements
List of user entitlements.
.PARAMETER ExistsOnSource
Existence status on source.
.OUTPUTS

MachineIdentityCreatedMachineIdentity<PSCustomObject>
#>


function Initialize-V2025MachineIdentityCreatedMachineIdentity {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.DateTime]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.DateTime]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${BusinessApplication},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Attributes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ValidateSet("AI Agent", "Application")]
        [String]
        ${Subtype},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Owners},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Uuid},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NativeIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${ManuallyEdited} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Boolean]]
        ${ManuallyCreated} = $false,
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${DatasetId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Source},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${UserEntitlements},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ExistsOnSource}
    )

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

        if (!$Id) {
            throw "invalid value for 'Id', 'Id' cannot be null."
        }

        if (!$Created) {
            throw "invalid value for 'Created', 'Created' cannot be null."
        }

        if (!$Modified) {
            throw "invalid value for 'Modified', 'Modified' cannot be null."
        }

        if (!$Subtype) {
            throw "invalid value for 'Subtype', 'Subtype' cannot be null."
        }

        if (!$ManuallyEdited) {
            throw "invalid value for 'ManuallyEdited', 'ManuallyEdited' cannot be null."
        }


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "businessApplication" = ${BusinessApplication}
            "description" = ${Description}
            "attributes" = ${Attributes}
            "subtype" = ${Subtype}
            "owners" = ${Owners}
            "sourceId" = ${SourceId}
            "uuid" = ${Uuid}
            "nativeIdentity" = ${NativeIdentity}
            "manuallyEdited" = ${ManuallyEdited}
            "manuallyCreated" = ${ManuallyCreated}
            "datasetId" = ${DatasetId}
            "source" = ${Source}
            "userEntitlements" = ${UserEntitlements}
            "existsOnSource" = ${ExistsOnSource}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityCreatedMachineIdentity<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityCreatedMachineIdentity<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityCreatedMachineIdentity<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in V2025MachineIdentityCreatedMachineIdentity
        $AllProperties = ("id", "name", "created", "modified", "businessApplication", "description", "attributes", "subtype", "owners", "sourceId", "uuid", "nativeIdentity", "manuallyEdited", "manuallyCreated", "datasetId", "source", "userEntitlements", "existsOnSource")
        foreach ($name in $JsonParameters.PsObject.Properties.Name) {
            if (!($AllProperties.Contains($name))) {
                throw "Error! JSON key '$name' not found in the properties: $($AllProperties)"
            }
        }

        If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json
            throw "Error! Empty JSON cannot be serialized due to the required property 'id' missing."
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) {
            throw "Error! JSON cannot be serialized due to the required property 'id' missing."
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "created"))) {
            throw "Error! JSON cannot be serialized due to the required property 'created' missing."
        } else {
            $Created = $JsonParameters.PSobject.Properties["created"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "modified"))) {
            throw "Error! JSON cannot be serialized due to the required property 'modified' missing."
        } else {
            $Modified = $JsonParameters.PSobject.Properties["modified"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "subtype"))) {
            throw "Error! JSON cannot be serialized due to the required property 'subtype' missing."
        } else {
            $Subtype = $JsonParameters.PSobject.Properties["subtype"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "manuallyEdited"))) {
            throw "Error! JSON cannot be serialized due to the required property 'manuallyEdited' missing."
        } else {
            $ManuallyEdited = $JsonParameters.PSobject.Properties["manuallyEdited"].value
        }

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "attributes"))) { #optional property not found
            $Attributes = $null
        } else {
            $Attributes = $JsonParameters.PSobject.Properties["attributes"].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 "sourceId"))) { #optional property not found
            $SourceId = $null
        } else {
            $SourceId = $JsonParameters.PSobject.Properties["sourceId"].value
        }

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

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

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

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

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

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "created" = ${Created}
            "modified" = ${Modified}
            "businessApplication" = ${BusinessApplication}
            "description" = ${Description}
            "attributes" = ${Attributes}
            "subtype" = ${Subtype}
            "owners" = ${Owners}
            "sourceId" = ${SourceId}
            "uuid" = ${Uuid}
            "nativeIdentity" = ${NativeIdentity}
            "manuallyEdited" = ${ManuallyEdited}
            "manuallyCreated" = ${ManuallyCreated}
            "datasetId" = ${DatasetId}
            "source" = ${Source}
            "userEntitlements" = ${UserEntitlements}
            "existsOnSource" = ${ExistsOnSource}
        }

        return $PSO
    }

}