Model/CampaignReportDownload.ps1
|
# # SailPoint Identity Security API - Certification Campaigns # 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 No description available. .PARAMETER Id The unique ID of the campaign report. .PARAMETER DownloadUrl A URL to download the campaign report. A presigned download URL is valid for 90 minutes from the time it is returned. Call this endpoint again to get a new URL. .OUTPUTS CampaignReportDownload<PSCustomObject> #> function Initialize-CampaignReportDownload { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Id}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${DownloadUrl} ) Process { 'Creating PSCustomObject: PSSailpoint.CertificationCampaigns => CampaignReportDownload' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug if (!$Id) { throw "invalid value for 'Id', 'Id' cannot be null." } if (!$DownloadUrl) { throw "invalid value for 'DownloadUrl', 'DownloadUrl' cannot be null." } $PSO = [PSCustomObject]@{ "id" = ${Id} "downloadUrl" = ${DownloadUrl} } return $PSO } } <# .SYNOPSIS Convert from JSON to CampaignReportDownload<PSCustomObject> .DESCRIPTION Convert from JSON to CampaignReportDownload<PSCustomObject> .PARAMETER Json Json object .OUTPUTS CampaignReportDownload<PSCustomObject> #> function ConvertFrom-JsonToCampaignReportDownload { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: PSSailpoint.CertificationCampaigns => CampaignReportDownload' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in CampaignReportDownload $AllProperties = ("id", "downloadUrl") 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 "downloadUrl"))) { throw "Error! JSON cannot be serialized due to the required property 'downloadUrl' missing." } else { $DownloadUrl = $JsonParameters.PSobject.Properties["downloadUrl"].value } $PSO = [PSCustomObject]@{ "id" = ${Id} "downloadUrl" = ${DownloadUrl} } return $PSO } } |