<s> from twilio . rest . resources . util import normalize_dates , parse_date <EOL> from twilio . rest . resources import InstanceResource , ListResource <EOL> class ShortCode ( InstanceResource ) : <EOL> def update ( self , ** kwargs ) : <EOL> return self . parent . update ( self . name , ** kwargs ) <EOL> class ShortCodes ( ListResource ) : <EOL> name = "<STR_LIT>" <EOL> key = "<STR_LIT>" <EOL> instance = ShortCode <EOL> def list ( self , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return self . get_instances ( kwargs ) <EOL> def update ( self , sid , url = None , method = None , fallback_url = None , <EOL> fallback_method = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> kwargs [ "<STR_LIT>" ] = kwargs . get ( "<STR_LIT>" , url ) <EOL> kwargs [ "<STR_LIT>" ] = kwargs . get ( "<STR_LIT>" , method ) <EOL> kwargs [ "<STR_LIT>" ] = kwargs . get ( "<STR_LIT>" , fallback_url ) <EOL> kwargs [ "<STR_LIT>" ] = kwargs . get ( "<STR_LIT>" , fallback_method ) <EOL> return self . update_instance ( sid , kwargs ) <EOL> class Sms ( object ) : <EOL> """<STR_LIT>""" <EOL> name = "<STR_LIT>" <EOL> key = "<STR_LIT>" <EOL> def __init__ ( self , base_uri , auth ) : <EOL> self . uri = "<STR_LIT>" % base_uri <EOL> self . messages = SmsMessages ( self . uri , auth ) <EOL> self . short_codes = ShortCodes ( self . uri , auth ) <EOL> class SmsMessage ( InstanceResource ) : <EOL> pass <EOL> class SmsMessages ( ListResource ) : <EOL> name = "<STR_LIT>" <EOL> key = "<STR_LIT>" <EOL> instance = SmsMessage <EOL> def create ( self , from_ = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> kwargs [ "<STR_LIT>" ] = from_ <EOL> return self . create_instance ( kwargs ) <EOL> @ normalize_dates <EOL> def list ( self , from_ = None , before = None , after = None , date_sent = None , ** kw ) : <EOL> """<STR_LIT>""" <EOL> kw [ "<STR_LIT>" ] = from_ <EOL> kw [ "<STR_LIT>" ] = before <EOL> kw [ "<STR_LIT>" ] = after <EOL> kw [ "<STR_LIT>" ] = parse_date ( date_sent ) <EOL> return self . get_instances ( kw ) </s>
