Public/Resource Property Types/Add-VSSNSTopicSubscription.ps1
function Add-VSSNSTopicSubscription { <# .SYNOPSIS Adds an AWS::SNS::Topic.Subscription resource property to the template .DESCRIPTION Adds an AWS::SNS::Topic.Subscription resource property to the template .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-subscription.html .PARAMETER Endpoint Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-subscription.html#cfn-sns-topic-subscription-endpoint PrimitiveType: String Required: True UpdateType: Immutable .PARAMETER Protocol Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-subscription.html#cfn-sns-topic-subscription-protocol PrimitiveType: String Required: True UpdateType: Immutable .FUNCTIONALITY Vaporshell #> [OutputType('Vaporshell.Resource.SNS.Topic.Subscription')] [cmdletbinding()] Param ( [parameter(Mandatory = $true)] [ValidateScript( { $allowedTypes = "System.String","Vaporshell.Function" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { throw "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")." } })] $Endpoint, [parameter(Mandatory = $true)] [ValidateScript( { $allowedTypes = "System.String","Vaporshell.Function" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { throw "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")." } })] $Protocol ) Begin { $obj = [PSCustomObject]@{} } Process { foreach ($psParamKey in $PSBoundParameters.Keys) { $val = $((Get-Variable $psParamKey).Value) if ($val -eq "True") { $val = "true" } elseif ($val -eq "False") { $val = "false" } $obj | Add-Member -MemberType NoteProperty -Name $psParamKey -Value $val } } End { $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.SNS.Topic.Subscription' } } |