@@ -70,6 +70,16 @@ def _assemble_and_send_request(self):
7070 OriginCountryCode = self .OriginCountryCode ,
7171 DestinationCountryCode = self .DestinationCountryCode ,
7272 )
73+
74+ def enable_post_shipment (self ,trackingnumber ):
75+ """
76+ Enable post shipment upload - when uploading docs after the shipment has been processed
77+ or confirmed, you must provide the tracking number.
78+ The shipment also must have been processed with the POST_SHIPMENT_UPLOAD_REQUESTED ETD attribute.
79+ """
80+ self .ProcessingOptions .Options = ["POST_SHIPMENT_UPLOAD" ]
81+ self .ProcessingOptions .PostShipmentUploadDetail .TrackingNumber = trackingnumber
82+
7383 def get_document (self , line_number ,customer_reference ,
7484 document_type , file_name , document_content , expiration_date = None
7585 ):
@@ -81,5 +91,59 @@ def get_document(self, line_number,customer_reference,
8191 document_item .DocumentContent = document_content
8292 document_item .ExpirationDate = expiration_date
8393 return document_item
94+
8495 def add_documents (self , document_item ):
8596 self .Documents .append (document_item )
97+
98+
99+ class FedexUploadImagesRequest (FedexBaseService ):
100+ """
101+ This class allows you to submit images.
102+ You will need to add images to self.Images,
103+ then send the request.
104+ """
105+
106+ def __init__ (self , config_obj , * args , ** kwargs ):
107+ """
108+ The optional keyword args detailed on L{FedexBaseService}
109+ apply here as well.
110+ @type config_obj: L{FedexConfig}
111+ @param config_obj: A valid FedexConfig object.
112+ """
113+
114+ self ._config_obj = config_obj
115+
116+ # Holds version info for the VersionId SOAP object.
117+ self ._version_info = {'service_id' : 'cdus' , 'major' : '11' ,
118+ 'intermediate' : '0' , 'minor' : '0' }
119+
120+ super (FedexUploadImagesRequest , self ).__init__ (
121+ self ._config_obj , 'UploadDocumentService_v11.wsdl' , * args , ** kwargs )
122+
123+ def _prepare_wsdl_objects (self ):
124+ """
125+ This is the data that will be used to create your shipment. Create
126+ the data structure and get it ready for the WSDL request.
127+ """
128+ self .Images = []
129+
130+ def _assemble_and_send_request (self ):
131+ """
132+ Fires off the Fedex request.
133+
134+ @warning: NEVER CALL THIS METHOD DIRECTLY. CALL send_request(),
135+ WHICH RESIDES ON FedexBaseService AND IS INHERITED.
136+ """
137+
138+ # Fire off the query.
139+ return self .client .service .uploadImages (
140+ WebAuthenticationDetail = self .WebAuthenticationDetail ,
141+ ClientDetail = self .ClientDetail ,
142+ TransactionDetail = self .TransactionDetail ,
143+ Version = self .VersionId ,
144+ Images = self .Images ,
145+ )
146+
147+ def add_image (self , image_item ):
148+ self .Images .append (image_item )
149+
0 commit comments