# Path: awscfncli2/config/formats.py
# CANNED_STACK_POLICIES = {
#     'ALLOW_ALL': '{"Statement":[{"Effect":"Allow","Action":"Update:*","Principal":"*","Resource":"*"}]}',
#     'ALLOW_MODIFY': '{"Statement":[{"Effect":"Allow","Action":["Update:Modify"],"Principal":"*","Resource":"*"}]}',
#     'DENY_DELETE': '{"Statement":[{"Effect":"Allow","NotAction":"Update:Delete","Principal":"*","Resource":"*"}]}',
#     'DENY_ALL': '{"Statement":[{"Effect":"Deny","Action":"Update:*","Principal":"*","Resource":"*"}]}',
# }
# 
# Path: awscfncli2/runner/commands/command.py
# class Command(object):
#     SKIP_UPDATE_REFERENCES = False
# 
#     def __init__(self, pretty_printer, options):
#         assert isinstance(pretty_printer, StackPrettyPrinter)
#         self.ppt = pretty_printer
#         self.options = options
# 
#     def run(self, stack_context):
#         raise NotImplementedError
# 
# Path: awscfncli2/runner/commands/utils.py
# def update_termination_protection(session,
#                                   termination_protection,
#                                   stack_name,
#                                   ppt):
#     """Update termination protection on a stack"""
# 
#     if termination_protection is None:
#         # don't care, don't change
#         return
# 
#     client = session.client('cloudformation')
# 
#     if termination_protection:
#         ppt.secho('Enabling TerminationProtection')
#     else:
#         ppt.secho('Disabling TerminationProtection', fg='red')
# 
#     client.update_termination_protection(
#         StackName=stack_name,
#         EnableTerminationProtection=termination_protection)
# 
# def is_no_updates_being_performed_exception(ex):
#     """Check whether given exception is "no update to be performed"
#     botocore doesn't throw a distinct exception class in this case.
#     """
#     if isinstance(ex, botocore.exceptions.ClientError):
#         error = ex.response.get('Error', {})
#         error_message = error.get('Message', 'Unknown')
#         return error_message.endswith('No updates are to be performed.')
#     else:
#         return False


from collections import namedtuple
from ...config import CANNED_STACK_POLICIES
from .command import Command
from .utils import update_termination_protection, \
    is_no_updates_being_performed_exception



class StackUpdateOptions(namedtuple('StackUpdateOptions',
                                    ['no_wait',
                                     'use_previous_template',
                                     'ignore_no_update',
                                     'override_policy'])):
    pass



# Path: awscfncli2/config/formats.py
# CANNED_STACK_POLICIES = {
#     'ALLOW_ALL': '{"Statement":[{"Effect":"Allow","Action":"Update:*","Principal":"*","Resource":"*"}]}',
#     'ALLOW_MODIFY': '{"Statement":[{"Effect":"Allow","Action":["Update:Modify"],"Principal":"*","Resource":"*"}]}',
#     'DENY_DELETE': '{"Statement":[{"Effect":"Allow","NotAction":"Update:Delete","Principal":"*","Resource":"*"}]}',
#     'DENY_ALL': '{"Statement":[{"Effect":"Deny","Action":"Update:*","Principal":"*","Resource":"*"}]}',
# }
# 
# Path: awscfncli2/runner/commands/command.py
# class Command(object):
#     SKIP_UPDATE_REFERENCES = False
# 
#     def __init__(self, pretty_printer, options):
#         assert isinstance(pretty_printer, StackPrettyPrinter)
#         self.ppt = pretty_printer
#         self.options = options
# 
#     def run(self, stack_context):
#         raise NotImplementedError
# 
# Path: awscfncli2/runner/commands/utils.py
# def update_termination_protection(session,
#                                   termination_protection,
#                                   stack_name,
#                                   ppt):
#     """Update termination protection on a stack"""
# 
#     if termination_protection is None:
#         # don't care, don't change
#         return
# 
#     client = session.client('cloudformation')
# 
#     if termination_protection:
#         ppt.secho('Enabling TerminationProtection')
#     else:
#         ppt.secho('Disabling TerminationProtection', fg='red')
# 
#     client.update_termination_protection(
#         StackName=stack_name,
#         EnableTerminationProtection=termination_protection)
# 
# def is_no_updates_being_performed_exception(ex):
#     """Check whether given exception is "no update to be performed"
#     botocore doesn't throw a distinct exception class in this case.
#     """
#     if isinstance(ex, botocore.exceptions.ClientError):
#         error = ex.response.get('Error', {})
#         error_message = error.get('Message', 'Unknown')
#         return error_message.endswith('No updates are to be performed.')
#     else:
#         return False


# Path: awscfncli2/runner/commands/stack_update_command.py
from collections import namedtuple
from ...config import CANNED_STACK_POLICIES
from .command import Command
from .utils import update_termination_protection, \
    is_no_updates_being_performed_exception




class StackUpdateOptions(namedtuple('StackUpdateOptions',
                                    ['no_wait',
                                     'use_previous_template',
                                     'ignore_no_update',
                                     'override_policy'])):
    pass



class StackUpdateCommand(Command):