def main():
    argument_spec = dict(name=dict(required=True), state=dict(default='present', choices=['present', 'absent']), display_name=dict(), policy=dict(type='dict'), delivery_policy=dict(type='dict'), subscriptions=dict(default=[], type='list', elements='dict'), purge_subscriptions=dict(type='bool', default=True))
    module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)
    name = module.params.get('name')
    state = module.params.get('state')
    display_name = module.params.get('display_name')
    policy = module.params.get('policy')
    delivery_policy = module.params.get('delivery_policy')
    subscriptions = module.params.get('subscriptions')
    purge_subscriptions = module.params.get('purge_subscriptions')
    check_mode = module.check_mode
    sns_topic = SnsTopicManager(module, name, state, display_name, policy, delivery_policy, subscriptions, purge_subscriptions, check_mode)
    if (state == 'present'):
        changed = sns_topic.ensure_ok()
    elif (state == 'absent'):
        changed = sns_topic.ensure_gone()
    sns_facts = dict(changed=changed, sns_arn=sns_topic.topic_arn, sns_topic=sns_topic.get_info())
    module.exit_json(**sns_facts)
def main():
    argument_spec = dict(name=dict(required=True), state=dict(default='present', choices=['present', 'absent']), display_name=dict(), policy=dict(type='dict'), delivery_policy=dict(type='dict'), subscriptions=dict(default=[], type='list', elements='dict'), purge_subscriptions=dict(type='bool', default=True))
    module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)
    name = module.params.get('name')
    state = module.params.get('state')
    display_name = module.params.get('display_name')
    policy = module.params.get('policy')
    delivery_policy = module.params.get('delivery_policy')
    subscriptions = module.params.get('subscriptions')
    purge_subscriptions = module.params.get('purge_subscriptions')
    check_mode = module.check_mode
    sns_topic = SnsTopicManager(module, name, state, display_name, policy, delivery_policy, subscriptions, purge_subscriptions, check_mode)
    if (state == 'present'):
        changed = sns_topic.ensure_ok()
    elif (state == 'absent'):
        changed = sns_topic.ensure_gone()
    sns_facts = dict(changed=changed, sns_arn=sns_topic.topic_arn, sns_topic=sns_topic.get_info())
    module.exit_json(**sns_facts)