intelligence/src/PSSailpoint.Intelligence/Model/Intelmachineaccountwire.ps1

#
# Identity Security Cloud API - Intelligence
# 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

Machine account row on the non-human identity aggregate accounts.items list. Every property in required is always present on the wire. Nullable object refs (source, machineIdentity, ownerIdentity) may be null. String fields may be empty when upstream has no value; booleans, timestamps, attributes, and connectorAttributes are always emitted (empty object when absent).

.PARAMETER Id
Unique account identifier in Identity Security Cloud.
.PARAMETER Name
Account name on the correlated source.
.PARAMETER NativeIdentity
Native identifier on the source system.
.PARAMETER Source
Source metadata for the machine account when present upstream.
.PARAMETER Enabled
True when the account is enabled for use on the source.
.PARAMETER Locked
True when the account is locked on the source.
.PARAMETER MachineIdentity
Reference to the parent machine identity when populated upstream.
.PARAMETER OwnerIdentity
Reference to the owning human identity when populated upstream.
.PARAMETER Description
Free-text account description from the source.
.PARAMETER Subtype
Account subtype label from upstream classification.
.PARAMETER AccessType
Access type label for the account (for example account or entitlement).
.PARAMETER Environment
Environment label associated with the account.
.PARAMETER ClassificationMethod
Method used to classify the account as a machine account.
.PARAMETER ManuallyEdited
True when an administrator manually edited account attributes.
.PARAMETER ManuallyCorrelated
True when an administrator manually correlated the account.
.PARAMETER HasEntitlements
True when the account holds one or more entitlements.
.PARAMETER Created
Timestamp when the account record was created.
.PARAMETER Modified
Timestamp when the account record was last modified.
.PARAMETER Attributes
Extended account attributes from the source connector.
.PARAMETER ConnectorAttributes
Connector-specific attribute bag from upstream.
.OUTPUTS

Intelmachineaccountwire<PSCustomObject>
#>


function Initialize-Intelmachineaccountwire {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Name},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${NativeIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${Source},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${Enabled},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${Locked},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${MachineIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject]
        ${OwnerIdentity},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Description},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Subtype},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${AccessType},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Environment},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${ClassificationMethod},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${ManuallyEdited},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${ManuallyCorrelated},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [Boolean]
        ${HasEntitlements},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.DateTime]
        ${Created},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.DateTime]
        ${Modified},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${Attributes},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Collections.Hashtable]
        ${ConnectorAttributes}
    )

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

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

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

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

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

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

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

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

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

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

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

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

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

        if (!$HasEntitlements) {
            throw "invalid value for 'HasEntitlements', 'HasEntitlements' 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 (!$Attributes) {
            throw "invalid value for 'Attributes', 'Attributes' cannot be null."
        }

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


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "nativeIdentity" = ${NativeIdentity}
            "source" = ${Source}
            "enabled" = ${Enabled}
            "locked" = ${Locked}
            "machineIdentity" = ${MachineIdentity}
            "ownerIdentity" = ${OwnerIdentity}
            "description" = ${Description}
            "subtype" = ${Subtype}
            "accessType" = ${AccessType}
            "environment" = ${Environment}
            "classificationMethod" = ${ClassificationMethod}
            "manuallyEdited" = ${ManuallyEdited}
            "manuallyCorrelated" = ${ManuallyCorrelated}
            "hasEntitlements" = ${HasEntitlements}
            "created" = ${Created}
            "modified" = ${Modified}
            "attributes" = ${Attributes}
            "connectorAttributes" = ${ConnectorAttributes}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Intelmachineaccountwire<PSCustomObject>

.DESCRIPTION

Convert from JSON to Intelmachineaccountwire<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Intelmachineaccountwire<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Intelmachineaccountwire
        $AllProperties = ("id", "name", "nativeIdentity", "source", "enabled", "locked", "machineIdentity", "ownerIdentity", "description", "subtype", "accessType", "environment", "classificationMethod", "manuallyEdited", "manuallyCorrelated", "hasEntitlements", "created", "modified", "attributes", "connectorAttributes")
        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 "name"))) {
            throw "Error! JSON cannot be serialized due to the required property 'name' missing."
        } else {
            $Name = $JsonParameters.PSobject.Properties["name"].value
        }

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

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

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

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

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

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "description"))) {
            throw "Error! JSON cannot be serialized due to the required property 'description' missing."
        } else {
            $Description = $JsonParameters.PSobject.Properties["description"].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 "accessType"))) {
            throw "Error! JSON cannot be serialized due to the required property 'accessType' missing."
        } else {
            $AccessType = $JsonParameters.PSobject.Properties["accessType"].value
        }

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

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "classificationMethod"))) {
            throw "Error! JSON cannot be serialized due to the required property 'classificationMethod' missing."
        } else {
            $ClassificationMethod = $JsonParameters.PSobject.Properties["classificationMethod"].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 "manuallyCorrelated"))) {
            throw "Error! JSON cannot be serialized due to the required property 'manuallyCorrelated' missing."
        } else {
            $ManuallyCorrelated = $JsonParameters.PSobject.Properties["manuallyCorrelated"].value
        }

        if (!([bool]($JsonParameters.PSobject.Properties.name -match "hasEntitlements"))) {
            throw "Error! JSON cannot be serialized due to the required property 'hasEntitlements' missing."
        } else {
            $HasEntitlements = $JsonParameters.PSobject.Properties["hasEntitlements"].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 "attributes"))) {
            throw "Error! JSON cannot be serialized due to the required property 'attributes' missing."
        } else {
            $Attributes = $JsonParameters.PSobject.Properties["attributes"].value
        }

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "name" = ${Name}
            "nativeIdentity" = ${NativeIdentity}
            "source" = ${Source}
            "enabled" = ${Enabled}
            "locked" = ${Locked}
            "machineIdentity" = ${MachineIdentity}
            "ownerIdentity" = ${OwnerIdentity}
            "description" = ${Description}
            "subtype" = ${Subtype}
            "accessType" = ${AccessType}
            "environment" = ${Environment}
            "classificationMethod" = ${ClassificationMethod}
            "manuallyEdited" = ${ManuallyEdited}
            "manuallyCorrelated" = ${ManuallyCorrelated}
            "hasEntitlements" = ${HasEntitlements}
            "created" = ${Created}
            "modified" = ${Modified}
            "attributes" = ${Attributes}
            "connectorAttributes" = ${ConnectorAttributes}
        }

        return $PSO
    }

}