Model/CampaignTemplateGet.ps1
|
# # Identity Security Cloud API - Next Generation Certification Campaigns # 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 Campaign Template .PARAMETER Id ID of the campaign template .PARAMETER Name Name of the campaign template. .PARAMETER Description Description of the campaign template. .PARAMETER Type No description available. .PARAMETER RemediatorRef No description available. .PARAMETER MandatoryCommentRequirement No description available. .PARAMETER EmailNotificationEnabled Enables email notification for this campaign .PARAMETER AutoRevokeAllowed Allows auto revoke for this campaign .PARAMETER RecommendationsEnabled Enables IAI for this campaign. Accepts true even if the IAI product feature is off. If IAI is turned off then campaigns generated from this template will indicate false. The real value will then be returned if IAI is ever enabled for the org in the future. .PARAMETER SunsetCommentsRequired Determines if comments on sunset date changes are required. .PARAMETER Reviewer No description available. .PARAMETER DeadlineDuration The time period during which the campaign should be completed, formatted as an ISO-8601 Duration. When this template generates a campaign, the campaign's deadline will be the current date plus this duration. For example, if generation occurred on 2020-01-01 and this field was ""P2W"" (two weeks), the resulting campaign's deadline would be 2020-01-15 (the current date plus 14 days). If it is passed as empty then deadline is not set, but this need to be set before campaign activation api by using PATCH operation .PARAMETER CampaignName The campaign name. .PARAMETER CampaignDescription The campaign description. .PARAMETER FilterRef No description available. .PARAMETER SearchBasedParams No description available. .PARAMETER SourceIds A direct list of sourceIds to include in this campaign. .PARAMETER Schedule No description available. .OUTPUTS CampaignTemplateGet<PSCustomObject> #> function Initialize-CampaignTemplateGet { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Id}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Description}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("IDENTITY", "UNCORRELATED_ACCOUNT", "MACHINE_ACCOUNT")] [PSCustomObject] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${RemediatorRef}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("ALL_DECISIONS", "REVOKE_ONLY_DECISIONS", "NO_DECISIONS")] [PSCustomObject] ${MandatoryCommentRequirement}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${EmailNotificationEnabled} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${AutoRevokeAllowed} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${RecommendationsEnabled} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${SunsetCommentsRequired} = $true, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Reviewer}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${DeadlineDuration}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${CampaignName}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${CampaignDescription}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${FilterRef}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${SearchBasedParams}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String[]] ${SourceIds}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${Schedule} ) Process { 'Creating PSCustomObject: PSSailpoint.GovCertification => CampaignTemplateGet' | 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 (!$Description) { throw "invalid value for 'Description', 'Description' cannot be null." } if (!$Type) { throw "invalid value for 'Type', 'Type' cannot be null." } if (!$Reviewer) { throw "invalid value for 'Reviewer', 'Reviewer' cannot be null." } if (!$CampaignName) { throw "invalid value for 'CampaignName', 'CampaignName' cannot be null." } if (!$CampaignDescription) { throw "invalid value for 'CampaignDescription', 'CampaignDescription' cannot be null." } $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} "description" = ${Description} "type" = ${Type} "remediatorRef" = ${RemediatorRef} "mandatoryCommentRequirement" = ${MandatoryCommentRequirement} "emailNotificationEnabled" = ${EmailNotificationEnabled} "autoRevokeAllowed" = ${AutoRevokeAllowed} "recommendationsEnabled" = ${RecommendationsEnabled} "sunsetCommentsRequired" = ${SunsetCommentsRequired} "reviewer" = ${Reviewer} "deadlineDuration" = ${DeadlineDuration} "campaignName" = ${CampaignName} "campaignDescription" = ${CampaignDescription} "filterRef" = ${FilterRef} "searchBasedParams" = ${SearchBasedParams} "sourceIds" = ${SourceIds} "schedule" = ${Schedule} } return $PSO } } <# .SYNOPSIS Convert from JSON to CampaignTemplateGet<PSCustomObject> .DESCRIPTION Convert from JSON to CampaignTemplateGet<PSCustomObject> .PARAMETER Json Json object .OUTPUTS CampaignTemplateGet<PSCustomObject> #> function ConvertFrom-JsonToCampaignTemplateGet { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.GovCertification => CampaignTemplateGet' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in CampaignTemplateGet $AllProperties = ("id", "name", "description", "type", "ownerId", "remediatorRef", "mandatoryCommentRequirement", "emailNotificationEnabled", "autoRevokeAllowed", "recommendationsEnabled", "sunsetCommentsRequired", "reviewer", "deadlineDuration", "campaignName", "campaignDescription", "filterRef", "searchBasedParams", "sourceIds", "schedule", "scheduleStatus", "scheduleError", "created", "modified") 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 "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 "type"))) { throw "Error! JSON cannot be serialized due to the required property 'type' missing." } else { $Type = $JsonParameters.PSobject.Properties["type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ownerId"))) { throw "Error! JSON cannot be serialized due to the required property 'ownerId' missing." } else { $OwnerId = $JsonParameters.PSobject.Properties["ownerId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "reviewer"))) { throw "Error! JSON cannot be serialized due to the required property 'reviewer' missing." } else { $Reviewer = $JsonParameters.PSobject.Properties["reviewer"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "campaignName"))) { throw "Error! JSON cannot be serialized due to the required property 'campaignName' missing." } else { $CampaignName = $JsonParameters.PSobject.Properties["campaignName"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "campaignDescription"))) { throw "Error! JSON cannot be serialized due to the required property 'campaignDescription' missing." } else { $CampaignDescription = $JsonParameters.PSobject.Properties["campaignDescription"].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 "remediatorRef"))) { #optional property not found $RemediatorRef = $null } else { $RemediatorRef = $JsonParameters.PSobject.Properties["remediatorRef"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "mandatoryCommentRequirement"))) { #optional property not found $MandatoryCommentRequirement = $null } else { $MandatoryCommentRequirement = $JsonParameters.PSobject.Properties["mandatoryCommentRequirement"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "emailNotificationEnabled"))) { #optional property not found $EmailNotificationEnabled = $null } else { $EmailNotificationEnabled = $JsonParameters.PSobject.Properties["emailNotificationEnabled"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "autoRevokeAllowed"))) { #optional property not found $AutoRevokeAllowed = $null } else { $AutoRevokeAllowed = $JsonParameters.PSobject.Properties["autoRevokeAllowed"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "recommendationsEnabled"))) { #optional property not found $RecommendationsEnabled = $null } else { $RecommendationsEnabled = $JsonParameters.PSobject.Properties["recommendationsEnabled"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "sunsetCommentsRequired"))) { #optional property not found $SunsetCommentsRequired = $null } else { $SunsetCommentsRequired = $JsonParameters.PSobject.Properties["sunsetCommentsRequired"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "deadlineDuration"))) { #optional property not found $DeadlineDuration = $null } else { $DeadlineDuration = $JsonParameters.PSobject.Properties["deadlineDuration"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "filterRef"))) { #optional property not found $FilterRef = $null } else { $FilterRef = $JsonParameters.PSobject.Properties["filterRef"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "searchBasedParams"))) { #optional property not found $SearchBasedParams = $null } else { $SearchBasedParams = $JsonParameters.PSobject.Properties["searchBasedParams"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "sourceIds"))) { #optional property not found $SourceIds = $null } else { $SourceIds = $JsonParameters.PSobject.Properties["sourceIds"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "schedule"))) { #optional property not found $Schedule = $null } else { $Schedule = $JsonParameters.PSobject.Properties["schedule"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "scheduleStatus"))) { #optional property not found $ScheduleStatus = $null } else { $ScheduleStatus = $JsonParameters.PSobject.Properties["scheduleStatus"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "scheduleError"))) { #optional property not found $ScheduleError = $null } else { $ScheduleError = $JsonParameters.PSobject.Properties["scheduleError"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} "description" = ${Description} "type" = ${Type} "ownerId" = ${OwnerId} "remediatorRef" = ${RemediatorRef} "mandatoryCommentRequirement" = ${MandatoryCommentRequirement} "emailNotificationEnabled" = ${EmailNotificationEnabled} "autoRevokeAllowed" = ${AutoRevokeAllowed} "recommendationsEnabled" = ${RecommendationsEnabled} "sunsetCommentsRequired" = ${SunsetCommentsRequired} "reviewer" = ${Reviewer} "deadlineDuration" = ${DeadlineDuration} "campaignName" = ${CampaignName} "campaignDescription" = ${CampaignDescription} "filterRef" = ${FilterRef} "searchBasedParams" = ${SearchBasedParams} "sourceIds" = ${SourceIds} "schedule" = ${Schedule} "scheduleStatus" = ${ScheduleStatus} "scheduleError" = ${ScheduleError} "created" = ${Created} "modified" = ${Modified} } return $PSO } } |