@@ -24,42 +24,41 @@ public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey)
24
24
Item = ApiTransactionKey ,
25
25
} ;
26
26
27
- // parameters for request
28
- string month = "2017-06" ;
29
-
27
+ // Set a valid month for the request
28
+ string month = "2017-07" ;
30
29
30
+ // Build tbe request object
31
31
var request = new getAccountUpdaterJobSummaryRequest ( ) ;
32
32
request . month = month ;
33
33
34
-
35
-
36
-
37
-
38
-
39
-
40
- // instantiate the controller that will call the service
34
+ // Instantiate the controller that will call the service
41
35
var controller = new getAccountUpdaterJobSummaryController ( request ) ;
42
36
controller . Execute ( ) ;
43
37
44
- // get the response from the service (errors contained if any)
38
+ // Get the response from the service (errors contained if any)
45
39
var response = controller . GetApiResponse ( ) ;
46
40
47
41
if ( response != null && response . messages . resultCode == messageTypeEnum . Ok )
48
42
{
43
+ Console . WriteLine ( "SUCCESS: Get Account Updater Summary for Month : " + month ) ;
49
44
if ( response . auSummary == null )
45
+ {
46
+ Console . WriteLine ( "No Account Updater summary for this month." ) ;
50
47
return response ;
48
+ }
51
49
50
+ // Displaying the summary of each response in the list
52
51
foreach ( var result in response . auSummary )
53
52
{
54
- Console . WriteLine ( "Reason Code: {0}" , result . auReasonCode ) ;
55
- Console . WriteLine ( "Reason Description: {0}" , result . reasonDescription ) ;
56
- Console . WriteLine ( "# of Profiles updated for this reason: {0}" , result . profileCount ) ;
53
+ Console . WriteLine ( " Reason Code : " + result . auReasonCode ) ;
54
+ Console . WriteLine ( " Reason Description : " + result . reasonDescription ) ;
55
+ Console . WriteLine ( " # of Profiles updated for this reason : " + result . profileCount ) ;
57
56
}
58
57
}
59
58
else if ( response != null )
60
59
{
61
- Console . WriteLine ( "Error: " + response . messages . message [ 0 ] . code + " " +
62
- response . messages . message [ 0 ] . text ) ;
60
+ Console . WriteLine ( "ERROR : Invalid response" ) ;
61
+ Console . WriteLine ( "Response : " + response . messages . message [ 0 ] . code + " " + response . messages . message [ 0 ] . text ) ;
63
62
}
64
63
65
64
return response ;
0 commit comments