Model/CampaignReport.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 No description available. .PARAMETER Id The unique ID of the campaign report. .PARAMETER Name The human readable report name .PARAMETER CampaignId The unique ID of the campaign. .PARAMETER Type No description available. .PARAMETER Format No description available. .PARAMETER Created The date the report was created. .PARAMETER Modified The date the report was modified. .PARAMETER Status No description available. .OUTPUTS CampaignReport<PSCustomObject> #> function Initialize-CampaignReport { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Id}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Name}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${CampaignId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("STATUS", "SIGN_OFF", "COMPOSITION", "REMEDIATION")] [PSCustomObject] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("PDF", "CSV")] [PSCustomObject] ${Format}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.DateTime] ${Created}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[System.DateTime]] ${Modified}, [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateSet("IN_PROGRESS", "SUCCESS", "FAILED")] [PSCustomObject] ${Status} ) Process { 'Creating PSCustomObject: PSSailpoint.GovCertification => CampaignReport' | 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 (!$CampaignId) { throw "invalid value for 'CampaignId', 'CampaignId' cannot be null." } if (!$Type) { throw "invalid value for 'Type', 'Type' cannot be null." } if (!$Format) { throw "invalid value for 'Format', 'Format' cannot be null." } if (!$Created) { throw "invalid value for 'Created', 'Created' cannot be null." } if (!$Status) { throw "invalid value for 'Status', 'Status' cannot be null." } $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} "campaignId" = ${CampaignId} "type" = ${Type} "format" = ${Format} "created" = ${Created} "modified" = ${Modified} "status" = ${Status} } return $PSO } } <# .SYNOPSIS Convert from JSON to CampaignReport<PSCustomObject> .DESCRIPTION Convert from JSON to CampaignReport<PSCustomObject> .PARAMETER Json Json object .OUTPUTS CampaignReport<PSCustomObject> #> function ConvertFrom-JsonToCampaignReport { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.GovCertification => CampaignReport' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in CampaignReport $AllProperties = ("id", "name", "campaignId", "type", "format", "created", "modified", "status") 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 "campaignId"))) { throw "Error! JSON cannot be serialized due to the required property 'campaignId' missing." } else { $CampaignId = $JsonParameters.PSobject.Properties["campaignId"].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 "format"))) { throw "Error! JSON cannot be serialized due to the required property 'format' missing." } else { $Format = $JsonParameters.PSobject.Properties["format"].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 "status"))) { throw "Error! JSON cannot be serialized due to the required property 'status' missing." } else { $Status = $JsonParameters.PSobject.Properties["status"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "modified"))) { #optional property not found $Modified = $null } else { $Modified = $JsonParameters.PSobject.Properties["modified"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "name" = ${Name} "campaignId" = ${CampaignId} "type" = ${Type} "format" = ${Format} "created" = ${Created} "modified" = ${Modified} "status" = ${Status} } return $PSO } } |