<s> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> from jasmin . vendor . enum import Enum <EOL> from jasmin . vendor . smpp . pdu . namedtuple import namedtuple <EOL> from jasmin . vendor . smpp . pdu import constants <EOL> CommandId = Enum ( * constants . command_id_name_map . keys ( ) ) <EOL> CommandStatus = Enum ( * constants . command_status_name_map . keys ( ) ) <EOL> Tag = Enum ( * constants . tag_name_map . keys ( ) ) <EOL> Option = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> EsmClassMode = Enum ( * constants . esm_class_mode_name_map . keys ( ) ) <EOL> EsmClassType = Enum ( * constants . esm_class_type_name_map . keys ( ) ) <EOL> EsmClassGsmFeatures = Enum ( * constants . esm_class_gsm_features_name_map . keys ( ) ) <EOL> EsmClassBase = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class EsmClass ( EsmClassBase ) : <EOL> def __new__ ( cls , mode , type , gsmFeatures = [ ] ) : <EOL> return EsmClassBase . __new__ ( cls , mode , type , set ( gsmFeatures ) ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . mode , self . type , self . gsmFeatures ) <EOL> RegisteredDeliveryReceipt = Enum ( * constants . registered_delivery_receipt_name_map . keys ( ) ) <EOL> RegisteredDeliverySmeOriginatedAcks = Enum ( * constants . registered_delivery_sme_originated_acks_name_map . keys ( ) ) <EOL> RegisteredDeliveryBase = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class RegisteredDelivery ( RegisteredDeliveryBase ) : <EOL> def __new__ ( cls , receipt , smeOriginatedAcks = [ ] , intermediateNotification = False ) : <EOL> return RegisteredDeliveryBase . __new__ ( cls , receipt , set ( smeOriginatedAcks ) , intermediateNotification ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . receipt , self . smeOriginatedAcks , self . intermediateNotification ) <EOL> AddrTon = Enum ( * constants . addr_ton_name_map . keys ( ) ) <EOL> AddrNpi = Enum ( * constants . addr_npi_name_map . keys ( ) ) <EOL> PriorityFlag = Enum ( * constants . priority_flag_name_map . keys ( ) ) <EOL> ReplaceIfPresentFlag = Enum ( * constants . replace_if_present_flap_name_map . keys ( ) ) <EOL> DataCodingScheme = Enum ( '<STR_LIT>' , '<STR_LIT>' , * constants . data_coding_scheme_name_map . keys ( ) ) <EOL> DataCodingDefault = Enum ( * constants . data_coding_default_name_map . keys ( ) ) <EOL> DataCodingGsmMsgCoding = Enum ( * constants . data_coding_gsm_message_coding_name_map . keys ( ) ) <EOL> DataCodingGsmMsgClass = Enum ( * constants . data_coding_gsm_message_class_name_map . keys ( ) ) <EOL> DataCodingGsmMsgBase = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class DataCodingGsmMsg ( DataCodingGsmMsgBase ) : <EOL> def __new__ ( cls , msgCoding , msgClass ) : <EOL> return DataCodingGsmMsgBase . __new__ ( cls , msgCoding , msgClass ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . msgCoding , self . msgClass ) <EOL> class DataCoding ( object ) : <EOL> def __init__ ( self , scheme = DataCodingScheme . DEFAULT , schemeData = DataCodingDefault . SMSC_DEFAULT_ALPHABET ) : <EOL> self . scheme = scheme <EOL> self . schemeData = schemeData <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . scheme , self . schemeData ) <EOL> def __eq__ ( self , other ) : <EOL> if self . scheme != other . scheme : <EOL> return False <EOL> if self . schemeData != other . schemeData : <EOL> return False <EOL> return True <EOL> def __ne__ ( self , other ) : <EOL> return not self . __eq__ ( other ) <EOL> DestFlag = Enum ( * constants . dest_flag_name_map . keys ( ) ) <EOL> MessageState = Enum ( * constants . message_state_name_map . keys ( ) ) <EOL> CallbackNumDigitModeIndicator = Enum ( * constants . callback_num_digit_mode_indicator_name_map . keys ( ) ) <EOL> SubaddressTypeTag = Enum ( * constants . subaddress_type_tag_name_map . keys ( ) ) <EOL> CallbackNumBase = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class CallbackNum ( CallbackNumBase ) : <EOL> def __new__ ( cls , digitModeIndicator , ton = AddrTon . UNKNOWN , npi = AddrNpi . UNKNOWN , digits = None ) : <EOL> return CallbackNumBase . __new__ ( cls , digitModeIndicator , ton , npi , digits ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . digitModeIndicator , self . ton , self . npi , self . digits ) <EOL> SubaddressBase = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class Subaddress ( SubaddressBase ) : <EOL> def __new__ ( cls , typeTag , value ) : <EOL> return SubaddressBase . __new__ ( cls , typeTag , value ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . typeTag , self . value ) <EOL> AddrSubunit = Enum ( * constants . addr_subunit_name_map . keys ( ) ) <EOL> NetworkType = Enum ( * constants . network_type_name_map . keys ( ) ) <EOL> BearerType = Enum ( * constants . bearer_type_name_map . keys ( ) ) <EOL> PayloadType = Enum ( * constants . payload_type_name_map . keys ( ) ) <EOL> PrivacyIndicator = Enum ( * constants . privacy_indicator_name_map . keys ( ) ) <EOL> LanguageIndicator = Enum ( * constants . language_indicator_name_map . keys ( ) ) <EOL> DisplayTime = Enum ( * constants . display_time_name_map . keys ( ) ) <EOL> MsAvailabilityStatus = Enum ( * constants . ms_availability_status_name_map . keys ( ) ) <EOL> NetworkErrorCode = Enum ( * constants . network_error_code_name_map . keys ( ) ) <EOL> DeliveryFailureReason = Enum ( * constants . delivery_failure_reason_name_map . keys ( ) ) <EOL> MoreMessagesToSend = Enum ( * constants . more_messages_to_send_name_map . keys ( ) ) <EOL> class PDU ( object ) : <EOL> commandId = None <EOL> mandatoryParams = [ ] <EOL> optionalParams = [ ] <EOL> def __init__ ( self , seqNum = None , status = CommandStatus . ESME_ROK , ** kwargs ) : <EOL> self . id = self . commandId <EOL> self . seqNum = seqNum <EOL> self . status = status <EOL> self . params = kwargs <EOL> for mParam in self . mandatoryParams : <EOL> if mParam not in self . params : <EOL> self . params [ mParam ] = None <EOL> def __repr__ ( self ) : <EOL> r = "<STR_LIT>" % ( self . id , self . seqNum , self . status ) <EOL> for mParam in self . mandatoryParams : <EOL> if mParam in self . params : <EOL> r += "<STR_LIT>" % ( mParam , self . params [ mParam ] ) <EOL> for oParam in self . params . keys ( ) : <EOL> if oParam not in self . mandatoryParams : <EOL> r += "<STR_LIT>" % ( oParam , self . params [ oParam ] ) <EOL> r += '<STR_LIT>' <EOL> return r <EOL> def __eq__ ( self , pdu ) : <EOL> if self . id != pdu . id : <EOL> return False <EOL> if self . seqNum != pdu . seqNum : <EOL> return False <EOL> if self . status != pdu . status : <EOL> return False <EOL> if self . params != pdu . params : <EOL> return False <EOL> return True <EOL> def __ne__ ( self , other ) : <EOL> return not self . __eq__ ( other ) <EOL> class PDURequest ( PDU ) : <EOL> requireAck = None <EOL> class PDUResponse ( PDU ) : <EOL> noBodyOnError = False <EOL> def __init__ ( self , seqNum = None , status = CommandStatus . ESME_ROK , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> PDU . __init__ ( self , seqNum , status , ** kwargs ) <EOL> if self . noBodyOnError : <EOL> if status != CommandStatus . ESME_ROK : <EOL> self . params = { } <EOL> class PDUDataRequest ( PDURequest ) : <EOL> pass </s>
