Model/M365GroupLifecycleActions.ps1
# # Cloud Governance Api # Contact: support@avepoint.com # <# M365GroupLifecycleActions<PSCustomObject> #> function New-M365GroupLifecycleActions { [CmdletBinding()] Param ( [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${M365GroupLifecycleActionType} = "None", [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsSendCancellation} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${SendCancellationEmailTemplateId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [System.Nullable[Boolean]] ${IsNotifyEnabled} = $false, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject[]] ${NotifyUsers}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${NotifyEmailTemplateId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [PSCustomObject] ${EntraGroupLifecycleActionType} = "Delete", [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ActivityId}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${ActivityType}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Type}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Title}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${Description}, [Parameter(ValueFromPipelineByPropertyName = $true)] [String] ${RunAfter} ) Process { 'Creating PSCustomObject: Cloud.Governance.Client => M365GroupLifecycleActions' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $PSO = [PSCustomObject]@{ "M365GroupLifecycleActionType" = ${M365GroupLifecycleActionType} "IsSendCancellation" = ${IsSendCancellation} "SendCancellationEmailTemplateId" = ${SendCancellationEmailTemplateId} "IsNotifyEnabled" = ${IsNotifyEnabled} "NotifyUsers" = ${NotifyUsers} "NotifyEmailTemplateId" = ${NotifyEmailTemplateId} "EntraGroupLifecycleActionType" = ${EntraGroupLifecycleActionType} "ActivityId" = ${ActivityId} "ActivityType" = ${ActivityType} "Type" = ${Type} "Title" = ${Title} "Description" = ${Description} "RunAfter" = ${RunAfter} } return $PSO } } <# M365GroupLifecycleActions<PSCustomObject> #> function ConvertFrom-JsonToM365GroupLifecycleActions { Param( [AllowEmptyString()] [string]$Json ) Process { 'Converting JSON to PSCustomObject: Cloud.Governance.Client => M365GroupLifecycleActions' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $JsonParameters = ConvertFrom-Json -InputObject $Json # check if Json contains properties not defined in M365GroupLifecycleActions $AllProperties = $("M365GroupLifecycleActionType", "IsSendCancellation", "SendCancellationEmailTemplateId", "IsNotifyEnabled", "NotifyUsers", "NotifyEmailTemplateId", "EntraGroupLifecycleActionType", "ActivityId", "ActivityType", "Type", "Title", "Description", "RunAfter") 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 "M365GroupLifecycleActionType"))) { #optional property not found $M365GroupLifecycleActionType = $null } else { $M365GroupLifecycleActionType = $JsonParameters.PSobject.Properties["M365GroupLifecycleActionType"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsSendCancellation"))) { #optional property not found $IsSendCancellation = $null } else { $IsSendCancellation = $JsonParameters.PSobject.Properties["IsSendCancellation"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "SendCancellationEmailTemplateId"))) { #optional property not found $SendCancellationEmailTemplateId = $null } else { $SendCancellationEmailTemplateId = $JsonParameters.PSobject.Properties["SendCancellationEmailTemplateId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "IsNotifyEnabled"))) { #optional property not found $IsNotifyEnabled = $null } else { $IsNotifyEnabled = $JsonParameters.PSobject.Properties["IsNotifyEnabled"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "NotifyUsers"))) { #optional property not found $NotifyUsers = $null } else { $NotifyUsers = $JsonParameters.PSobject.Properties["NotifyUsers"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "NotifyEmailTemplateId"))) { #optional property not found $NotifyEmailTemplateId = $null } else { $NotifyEmailTemplateId = $JsonParameters.PSobject.Properties["NotifyEmailTemplateId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "EntraGroupLifecycleActionType"))) { #optional property not found $EntraGroupLifecycleActionType = $null } else { $EntraGroupLifecycleActionType = $JsonParameters.PSobject.Properties["EntraGroupLifecycleActionType"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ActivityId"))) { #optional property not found $ActivityId = $null } else { $ActivityId = $JsonParameters.PSobject.Properties["ActivityId"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "ActivityType"))) { #optional property not found $ActivityType = $null } else { $ActivityType = $JsonParameters.PSobject.Properties["ActivityType"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Type"))) { #optional property not found $Type = $null } else { $Type = $JsonParameters.PSobject.Properties["Type"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Title"))) { #optional property not found $Title = $null } else { $Title = $JsonParameters.PSobject.Properties["Title"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "Description"))) { #optional property not found $Description = $null } else { $Description = $JsonParameters.PSobject.Properties["Description"].value } if (!([bool]($JsonParameters.PSobject.Properties.name -match "RunAfter"))) { #optional property not found $RunAfter = $null } else { $RunAfter = $JsonParameters.PSobject.Properties["RunAfter"].value } $PSO = [PSCustomObject]@{ "M365GroupLifecycleActionType" = ${M365GroupLifecycleActionType} "IsSendCancellation" = ${IsSendCancellation} "SendCancellationEmailTemplateId" = ${SendCancellationEmailTemplateId} "IsNotifyEnabled" = ${IsNotifyEnabled} "NotifyUsers" = ${NotifyUsers} "NotifyEmailTemplateId" = ${NotifyEmailTemplateId} "EntraGroupLifecycleActionType" = ${EntraGroupLifecycleActionType} "ActivityId" = ${ActivityId} "ActivityType" = ${ActivityType} "Type" = ${Type} "Title" = ${Title} "Description" = ${Description} "RunAfter" = ${RunAfter} } return $PSO } } |