<s> """<STR_LIT>""" <EOL> from awscli . customizations import utils <EOL> from awscli . arguments import CustomArgument <EOL> from awscli . customizations . utils import validate_mutually_exclusive_handler <EOL> TO_HELP = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> CC_HELP = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> BCC_HELP = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> SUBJECT_HELP = '<STR_LIT>' <EOL> TEXT_HELP = '<STR_LIT>' <EOL> HTML_HELP = '<STR_LIT>' <EOL> def register_ses_send_email ( event_handler ) : <EOL> event_handler . register ( '<STR_LIT>' , <EOL> _promote_args ) <EOL> event_handler . register ( <EOL> '<STR_LIT>' , <EOL> validate_mutually_exclusive_handler ( <EOL> [ '<STR_LIT>' ] , [ '<STR_LIT:to>' , '<STR_LIT>' , '<STR_LIT>' ] ) ) <EOL> event_handler . register ( <EOL> '<STR_LIT>' , <EOL> validate_mutually_exclusive_handler ( <EOL> [ '<STR_LIT:message>' ] , [ '<STR_LIT:text>' , '<STR_LIT:html>' ] ) ) <EOL> def _promote_args ( argument_table , ** kwargs ) : <EOL> argument_table [ '<STR_LIT:message>' ] . required = False <EOL> argument_table [ '<STR_LIT>' ] . required = False <EOL> utils . rename_argument ( argument_table , '<STR_LIT:source>' , <EOL> new_name = '<STR_LIT>' ) <EOL> argument_table [ '<STR_LIT:to>' ] = AddressesArgument ( <EOL> '<STR_LIT:to>' , '<STR_LIT>' , help_text = TO_HELP ) <EOL> argument_table [ '<STR_LIT>' ] = AddressesArgument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , help_text = CC_HELP ) <EOL> argument_table [ '<STR_LIT>' ] = AddressesArgument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , help_text = BCC_HELP ) <EOL> argument_table [ '<STR_LIT>' ] = BodyArgument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , help_text = SUBJECT_HELP ) <EOL> argument_table [ '<STR_LIT:text>' ] = BodyArgument ( <EOL> '<STR_LIT:text>' , '<STR_LIT>' , help_text = TEXT_HELP ) <EOL> argument_table [ '<STR_LIT:html>' ] = BodyArgument ( <EOL> '<STR_LIT:html>' , '<STR_LIT>' , help_text = HTML_HELP ) <EOL> def _build_destination ( params , key , value ) : <EOL> if '<STR_LIT>' not in params : <EOL> params [ '<STR_LIT>' ] = { } <EOL> params [ '<STR_LIT>' ] [ key ] = value <EOL> def _build_message ( params , key , value ) : <EOL> if '<STR_LIT>' not in params : <EOL> params [ '<STR_LIT>' ] = { '<STR_LIT>' : { } , '<STR_LIT>' : { } } <EOL> if key in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> params [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ key ] = { '<STR_LIT>' : value } <EOL> elif key == '<STR_LIT>' : <EOL> params [ '<STR_LIT>' ] [ '<STR_LIT>' ] = { '<STR_LIT>' : value } <EOL> class AddressesArgument ( CustomArgument ) : <EOL> def __init__ ( self , name , json_key , help_text = '<STR_LIT>' , dest = None , default = None , <EOL> action = None , required = None , choices = None , cli_type_name = None ) : <EOL> super ( AddressesArgument , self ) . __init__ ( name = name , help_text = help_text , <EOL> required = required , nargs = '<STR_LIT:+>' ) <EOL> self . _json_key = json_key <EOL> def add_to_params ( self , parameters , value ) : <EOL> if value : <EOL> _build_destination ( parameters , self . _json_key , value ) <EOL> class BodyArgument ( CustomArgument ) : <EOL> def __init__ ( self , name , json_key , help_text = '<STR_LIT>' , required = None ) : <EOL> super ( BodyArgument , self ) . __init__ ( name = name , help_text = help_text , <EOL> required = required ) <EOL> self . _json_key = json_key <EOL> def add_to_params ( self , parameters , value ) : <EOL> if value : <EOL> _build_message ( parameters , self . _json_key , value ) </s>
