Subversion Repositories SmartDukaan

Rev

Rev 9005 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9005 Rev 9018
Line 50... Line 50...
50
 */
50
 */
51
public class GetAdGroups {
51
public class GetAdGroups {
52
 
52
 
53
	private static final int PAGE_SIZE = 100;
53
	private static final int PAGE_SIZE = 100;
54
	
54
	
-
 
55
	public static void main(String args[]){
-
 
56
		try {
-
 
57
			runExample(106590944L);
-
 
58
		} catch (Exception e) {
-
 
59
			e.printStackTrace();
-
 
60
		}
-
 
61
	}
-
 
62
	
55
	public static List<Map<String,String>> runExample(Long campaignId) throws Exception {
63
	public static List<Map<String,String>> runExample(Long campaignId) throws Exception {
56
		Credential oAuth2Credential = new OfflineCredentials.Builder()
64
		Credential oAuth2Credential = new OfflineCredentials.Builder()
57
		.forApi(Api.ADWORDS)
65
		.forApi(Api.ADWORDS)
58
		.fromFile()
66
		.fromFile()
59
		.build()
67
		.build()
Line 105... Line 113...
105
							adgroupMap.put("BidAmount", new_bid.getBid().getMicroAmount()+"");
113
							adgroupMap.put("BidAmount", new_bid.getBid().getMicroAmount()+"");
106
							adgroupMap.put("CatalogItemId", "0");
114
							adgroupMap.put("CatalogItemId", "0");
107
							adgroupDataMainList.add(adgroupMap);
115
							adgroupDataMainList.add(adgroupMap);
108
						}						
116
						}						
109
					}
117
					}
-
 
118
					
110
				}
119
				}
111
			} else {
120
			} else {
112
				System.out.println("No ad groups were found.");
121
				System.out.println("No ad groups were found.");
113
			}
122
			}
114
 
123