1
+ from fedex .base_service import FedexBaseService
2
+
3
+
4
+ class FedexCreatePickupRequest (FedexBaseService ):
5
+
6
+ def __init__ (self , config_obj , * args , ** kwargs ):
7
+ self ._config_obj = config_obj
8
+ # Holds version info for the VersionId SOAP object.
9
+ self ._version_info = {
10
+ 'service_id' : 'disp' ,
11
+ 'major' : '11' ,
12
+ 'intermediate' : '0' ,
13
+ 'minor' : '0'
14
+ }
15
+ self .OriginDetail = None
16
+ self .PackageCount = None
17
+ self .TotalWeight = None
18
+ self .CarrierCode = None
19
+ self .OversizePackageCount = None
20
+ self .Remarks = None
21
+ self .CommodityDescription = None
22
+ self .CountryRelationship = None
23
+ super (FedexCreatePickupRequest , self ).__init__ (self ._config_obj , 'PickupService_v11.wsdl' , * args , ** kwargs )
24
+
25
+ def _prepare_wsdl_objects (self ):
26
+ self .OriginDetail = self .client .factory .create ('PickupOriginDetail' )
27
+
28
+ self .OriginDetail .PickupLocation = self .client .factory .create ('ContactAndAddress' )
29
+ self .OriginDetail .PickupLocation .Contact = self .client .factory .create ('Contact' )
30
+ self .OriginDetail .PickupLocation .Address = self .client .factory .create ('Address' )
31
+
32
+ self .OriginDetail .PackageLocation = self .client .factory .create ('PickupBuildingLocationType' )
33
+ self .OriginDetail .BuildingPart = self .client .factory .create ('BuildingPartCode' )
34
+
35
+ self .TotalWeight = self .client .factory .create ('Weight' )
36
+
37
+ self .CarrierCode = self .client .factory .create ('CarrierCodeType' )
38
+
39
+ self .logger .debug (self .OriginDetail )
40
+ self .logger .debug (self .TotalWeight )
41
+ self .logger .debug (self .CarrierCode )
42
+
43
+ def _assemble_and_send_request (self ):
44
+ """
45
+ Fires off the Fedex request.
46
+
47
+ @warning: NEVER CALL THIS METHOD DIRECTLY. CALL send_request(),
48
+ WHICH RESIDES ON FedexBaseService AND IS INHERITED.
49
+ """
50
+
51
+ # Fire off the query.
52
+ return self .client .service .createPickup (
53
+ WebAuthenticationDetail = self .WebAuthenticationDetail ,
54
+ ClientDetail = self .ClientDetail ,
55
+ TransactionDetail = self .TransactionDetail ,
56
+ Version = self .VersionId ,
57
+ OriginDetail = self .OriginDetail ,
58
+ PackageCount = self .PackageCount ,
59
+ TotalWeight = self .TotalWeight ,
60
+ CarrierCode = self .CarrierCode ,
61
+ OversizePackageCount = self .OversizePackageCount ,
62
+ Remarks = self .Remarks ,
63
+ CommodityDescription = self .CommodityDescription ,
64
+ CountryRelationship = self .CountryRelationship
65
+ )
0 commit comments