machine-account-creation-request/src/PSSailpoint.MachineAccountCreationRequest/Model/Machineaccountcreateaccessdto.ps1

#
# Identity Security Cloud API - Machine Account Creation Request
# 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

A summary endpoint which returns list of sources and subtypes for which user has an entitlement to request machine accounts.

.PARAMETER SourceId
Source ID.
.PARAMETER SourceName
Source name.
.PARAMETER Subtypes
List of subtypes for which the user has an entitlement to request machine accounts.
.OUTPUTS

Machineaccountcreateaccessdto<PSCustomObject>
#>


function Initialize-Machineaccountcreateaccessdto {
    [CmdletBinding()]
    Param (
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceId},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [String]
        ${SourceName},
        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [PSCustomObject[]]
        ${Subtypes}
    )

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


        $PSO = [PSCustomObject]@{
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "subtypes" = ${Subtypes}
        }

        return $PSO
    }
}

<#
.SYNOPSIS

Convert from JSON to Machineaccountcreateaccessdto<PSCustomObject>

.DESCRIPTION

Convert from JSON to Machineaccountcreateaccessdto<PSCustomObject>

.PARAMETER Json

Json object

.OUTPUTS

Machineaccountcreateaccessdto<PSCustomObject>
#>

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

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

        $JsonParameters = ConvertFrom-Json -InputObject $Json

        # check if Json contains properties not defined in Machineaccountcreateaccessdto
        $AllProperties = ("sourceId", "sourceName", "subtypes")
        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 "sourceId"))) { #optional property not found
            $SourceId = $null
        } else {
            $SourceId = $JsonParameters.PSobject.Properties["sourceId"].value
        }

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

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

        $PSO = [PSCustomObject]@{
            "sourceId" = ${SourceId}
            "sourceName" = ${SourceName}
            "subtypes" = ${Subtypes}
        }

        return $PSO
    }

}