machine-identities/src/PSSailpoint.MachineIdentities/Model/MachineIdentityBulkResult.ps1

#
# SailPoint Identity Security API - Machine Identities
# Use these APIs to interact with the SailPoint Identity Security 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

Outcome of a bulk operation for one requested machine identity ID.

.PARAMETER Id
The requested machine identity ID.
.PARAMETER Status
HTTP status code for this ID. `200` means the operation succeeded. Other values explain why it did not, for example `400` when the ID is missing or not valid, `404` when the machine identity is not found or the caller does not own it, and `409` when the ID appears more than once in the request.
.PARAMETER Message
Message describing the outcome for this ID.
.OUTPUTS

MachineIdentityBulkResult<PSCustomObject>
#>


function Initialize-MachineIdentityBulkResult {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Id},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [System.Nullable[Int32]]
        ${Status},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${Message}
    )

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

        if (!$Id -and $Id.length -gt 128) {
            throw "invalid value for 'Id', the character length must be smaller than or equal to 128."
        }


        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "status" = ${Status}
            "message" = ${Message}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to MachineIdentityBulkResult<PSCustomObject>

.DESCRIPTION

Convert from JSON to MachineIdentityBulkResult<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

MachineIdentityBulkResult<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in MachineIdentityBulkResult
        $AllProperties = ("id", "status", "message")
        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 "id"))) { #optional property not found
            $Id = $null
        } else {
            $Id = $JsonParameters.PSobject.Properties["id"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "id" = ${Id}
            "status" = ${Status}
            "message" = ${Message}
        }

        return $PSO
    }

}