func (t *Template) GetAWSLogsSubscriptionFilterWithName(name string) (AWSLogsSubscriptionFilter, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case AWSLogsSubscriptionFilter:
			return resource, nil
		case map[string]interface{}:
			if resType, ok := resource["Type"]; ok {
				if resType == "AWS::Logs::SubscriptionFilter" {
					if b, err := json.Marshal(resource); err == nil {
						var result AWSLogsSubscriptionFilter
						if err := json.Unmarshal(b, &result); err == nil {
							return result, nil
						}
					}
				}
			}
		}
	}
	return AWSLogsSubscriptionFilter{}, errors.New("resource not found")
}
GetAWSLogsSubscriptionFilterWithName retrieves all AWSLogsSubscriptionFilter items from an AWS CloudFormation template
whose logical ID matches the provided name. Returns an error if not found.
package cloudformation
import (
	"encoding/json"
	"errors"
	"fmt"
)
type AWSLogsSubscriptionFilter struct {
	DestinationArn string `json:"DestinationArn,omitempty"`
	FilterPattern string `json:"FilterPattern,omitempty"`
	LogGroupName string `json:"LogGroupName,omitempty"`
	RoleArn string `json:"RoleArn,omitempty"`
}
func (r *AWSLogsSubscriptionFilter) AWSCloudFormationType() string {
	return "AWS::Logs::SubscriptionFilter"
}
func (r *AWSLogsSubscriptionFilter) MarshalJSON() ([]byte, error) {
	type Properties AWSLogsSubscriptionFilter
	return json.Marshal(&struct {
		Type       string
		Properties Properties
	}{
		Type:       r.AWSCloudFormationType(),
		Properties: (Properties)(*r),
	})
}
func (r *AWSLogsSubscriptionFilter) UnmarshalJSON(b []byte) error {
	type Properties AWSLogsSubscriptionFilter
	res := &struct {
		Type       string
		Properties *Properties
	}{}
	if err := json.Unmarshal(b, &res); err != nil {
		fmt.Printf("ERROR: %s\n", err)
		return err
	}
	if res.Properties != nil {
		*r = AWSLogsSubscriptionFilter(*res.Properties)
	}
	return nil
}
func (t *Template) GetAllAWSLogsSubscriptionFilterResources() map[string]AWSLogsSubscriptionFilter {
	results := map[string]AWSLogsSubscriptionFilter{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case AWSLogsSubscriptionFilter:
			results[name] = resource
		case map[string]interface{}:
			if resType, ok := resource["Type"]; ok {
				if resType == "AWS::Logs::SubscriptionFilter" {
					if b, err := json.Marshal(resource); err == nil {
						var result AWSLogsSubscriptionFilter
						if err := json.Unmarshal(b, &result); err == nil {
							results[name] = result
						}
					}
				}
			}
		}
	}
	return results
}